From d628a33a12f023858b53868d1de43d9e6dff5f35 Mon Sep 17 00:00:00 2001 From: Aliaksej Mialeshka Date: Mon, 26 Feb 2024 20:42:14 +0100 Subject: [PATCH] update waits in tests --- .../android/nativeapp/AndroidBasicInteractionsTest.java | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/src/test/java/samples/android/nativeapp/AndroidBasicInteractionsTest.java b/src/test/java/samples/android/nativeapp/AndroidBasicInteractionsTest.java index 8cea72f..5edd379 100644 --- a/src/test/java/samples/android/nativeapp/AndroidBasicInteractionsTest.java +++ b/src/test/java/samples/android/nativeapp/AndroidBasicInteractionsTest.java @@ -35,7 +35,7 @@ public void openCheckBoxesScreen() { private void openViewControlsScreen() { ViewControlsScreen screen = ApplicationActivity.VIEW_CONTROLS.open(); - Assert.assertTrue(screen.state().isDisplayed(), String.format("%s screen should be opened", screen.getName())); + Assert.assertTrue(screen.state().waitForDisplayed(), String.format("%s screen should be opened", screen.getName())); } @Override @@ -57,7 +57,7 @@ public void tearDown() { @Test public void testSendKeys() { InvokeSearchScreen searchScreen = ApplicationActivity.SEARCH.open(); - Assert.assertTrue(searchScreen.state().isDisplayed(), String.format("%s should be opened", searchScreen.getName())); + Assert.assertTrue(searchScreen.state().waitForDisplayed(), String.format("%s should be opened", searchScreen.getName())); String query = "Hello world!"; searchScreen.submitSearch(query); Assert.assertEquals(searchScreen.getSearchResult(), query, "Search result don't match to entered query"); @@ -67,7 +67,7 @@ public void testSendKeys() { public void testSaveAndCompareScreenDump() { InvokeSearchScreen searchScreen = ApplicationActivity.SEARCH.open(); - Assert.assertTrue(searchScreen.state().isDisplayed(), String.format("%s should be opened", searchScreen.getName())); + Assert.assertTrue(searchScreen.state().waitForDisplayed(), String.format("%s should be opened", searchScreen.getName())); final String customDumpName = String.format("my dump of %s", searchScreen.getName()); searchScreen.dump().save(customDumpName); Assert.assertEquals(searchScreen.dump().compare(customDumpName), 0, "Current screen should have no visual difference comparing to just saved dump"); @@ -114,7 +114,7 @@ public void testVerticalSwipeToElement() { @Test public void testHorizontalSwipeToElement() { ViewTabsScrollableScreen viewTabsScrollableScreen = ApplicationActivity.VIEW_TABS_SCROLLABLE.open(); - Assert.assertTrue(viewTabsScrollableScreen.state().isDisplayed(), + Assert.assertTrue(viewTabsScrollableScreen.state().waitForDisplayed(), String.format("%s screen should be opened", viewTabsScrollableScreen.getName())); viewTabsScrollableScreen.swipeTabWithLongPress(4, 1); viewTabsScrollableScreen.selectTab(7);