Skip to content

Commit

Permalink
update waits in tests
Browse files Browse the repository at this point in the history
  • Loading branch information
mialeska committed Feb 26, 2024
1 parent 4f46078 commit d628a33
Showing 1 changed file with 4 additions and 4 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand All @@ -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");
Expand All @@ -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");
Expand Down Expand Up @@ -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);
Expand Down

0 comments on commit d628a33

Please sign in to comment.