From 7d41e747fc45bf0705687b2b47f9587dc7e063df Mon Sep 17 00:00:00 2001 From: Teppo Kurki Date: Wed, 31 Jul 2024 10:57:24 +0300 Subject: [PATCH] Add assertion messages --- .../com/vaadin/flow/uitest/ui/NavigationEventsIT.java | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-) diff --git a/flow-tests/test-root-context/src/test/java/com/vaadin/flow/uitest/ui/NavigationEventsIT.java b/flow-tests/test-root-context/src/test/java/com/vaadin/flow/uitest/ui/NavigationEventsIT.java index efde21036d2..63957de5192 100644 --- a/flow-tests/test-root-context/src/test/java/com/vaadin/flow/uitest/ui/NavigationEventsIT.java +++ b/flow-tests/test-root-context/src/test/java/com/vaadin/flow/uitest/ui/NavigationEventsIT.java @@ -46,10 +46,13 @@ public void assertNavigationToSelfProducesNavigationEvents() { private void assertMessages(int expectedSize) { List messages = getMessages(); - Assert.assertEquals(expectedSize, messages.size()); - Assert.assertEquals(NavigationEventsView.BEFORE_ENTER, + Assert.assertEquals("Unexpected amount of navigation events", + expectedSize, messages.size()); + Assert.assertEquals("Second to last event should be BeforeEnter", + NavigationEventsView.BEFORE_ENTER, messages.get(expectedSize - 2)); - Assert.assertEquals(NavigationEventsView.AFTER_NAVIGATION, + Assert.assertEquals("Last event should be AfterNavigation", + NavigationEventsView.AFTER_NAVIGATION, messages.get(expectedSize - 1)); }