@InBrowser(emulator = Emulator.GOOGLE_NEXUS_5) @Test(groups = "mercury_search_loadMoreResultsOnSearchResultsPageNotVisible") public void mercury_search_emptySearchPhrase() { SearchResultsPage resultsPage = new SearchResultsPage().openForQuery(EMPTY_SEARCH_PHRASE); Assertion.assertEquals(resultsPage.getResultCardsNumber(), 0); Assertion.assertFalse(resultsPage.isLoadMoreButtonVisible()); }
@InBrowser(emulator = Emulator.GOOGLE_NEXUS_5) @Test(groups = "mercury_search_loadingMoreResultsOnSearchResultsPage") public void mercury_search_loadingMoreResultsOnSearchResultsPage() { SearchResultsPage resultsPage = new SearchResultsPage().openForQuery(MULTIPLE_RESULTS_SEARCH_PHRASE); int defaultCardNumber = resultsPage.getResultCardsNumber(); Assertion.assertTrue(resultsPage.isLoadMoreButtonVisible()); Assertion.assertEquals(defaultCardNumber, SEARCH_RESULTS_DEFAULT_NUMBER); resultsPage.clickLoadMoreButton(); int moreResultsLoaded = resultsPage.getResultCardsNumber() - defaultCardNumber; Assertion.assertEquals(moreResultsLoaded, SEARCH_RESULTS_DEFAULT_NUMBER); Assertion.assertTrue(resultsPage.isLoadMoreButtonVisible()); }
@InBrowser(emulator = Emulator.GOOGLE_NEXUS_5) @Test(groups = "mercury_search_loadMoreResultsOnSearchResultsPageNotVisible") public void mercury_search_loadMoreResultsOnSearchResultsPageNotVisible() { SearchResultsPage resultsPage = new SearchResultsPage().openForQuery(SINGLE_RESULT_SEARCH_PHRASE); Assertion.assertTrue(resultsPage.getResultCardsNumber() < SEARCH_RESULTS_DEFAULT_NUMBER); Assertion.assertFalse(resultsPage.isLoadMoreButtonVisible()); }
@InBrowser(emulator = Emulator.GOOGLE_NEXUS_5) @Test(groups = "mercury_search_searchNoResultsPageDisplayed") public void mercury_search_searchNoResultsPageDisplayed() { SearchResultsPage searchResults = new SearchResultsPage().openForQuery(SEARCH_PHRASE_NO_RESULTS); Assertion.assertTrue(searchResults.isNoResultsPagePresent()); Assertion.assertFalse(searchResults.isLoadMoreButtonVisible()); }