Search in sources :

Example 11 with SearchResultsPage

use of com.wikia.webdriver.elements.mercury.pages.SearchResultsPage in project selenium-tests by Wikia.

the class SearchMobileWikiTests method mercury_search_redirectToNewResultsPageFromNoResults.

@Execute(onWikia = MercuryWikis.MERCURY_AUTOMATION_TESTING)
@InBrowser(emulator = Emulator.GOOGLE_NEXUS_5)
@Test(groups = { "mercury_search_redirectToNewResultsPageFromNoResults", "Mercury_Search_002" })
public void mercury_search_redirectToNewResultsPageFromNoResults() {
    SearchResultsPage searchResults = new SearchResultsPage().openForQuery(SEARCH_PHRASE_NO_RESULTS).clickTryAnotherSearch().getSearch().typeInSearch(SEARCH_PHRASE).clickEnterAndNavigateToSearchResults(Skin.MOBILE_WIKI);
    Assertion.assertTrue(searchResults.isSearchResultsPageOpen());
    Assertion.assertFalse(searchResults.isNoResultsPagePresent());
    Assertion.assertTrue(searchResults.areResultsPresent());
}
Also used : SearchResultsPage(com.wikia.webdriver.elements.mercury.pages.SearchResultsPage) Execute(com.wikia.webdriver.common.core.annotations.Execute) Test(org.testng.annotations.Test) InBrowser(com.wikia.webdriver.common.core.annotations.InBrowser)

Example 12 with SearchResultsPage

use of com.wikia.webdriver.elements.mercury.pages.SearchResultsPage in project selenium-tests by Wikia.

the class SearchMobileWikiTests method mercury_search_loadingMoreResultsOnSearchResultsPage.

@Execute(onWikia = MercuryWikis.MERCURY_AUTOMATION_TESTING)
@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_NUMBER_FIRST_BATCH);
    resultsPage.clickLoadMoreButton();
    int moreResultsLoaded = resultsPage.getResultCardsNumber() - defaultCardNumber;
    Assertion.assertEquals(moreResultsLoaded, SEARCH_RESULTS_NUMBER_NEXT_BATCH);
    Assertion.assertTrue(resultsPage.isLoadMoreButtonVisible());
}
Also used : SearchResultsPage(com.wikia.webdriver.elements.mercury.pages.SearchResultsPage) Execute(com.wikia.webdriver.common.core.annotations.Execute) Test(org.testng.annotations.Test) InBrowser(com.wikia.webdriver.common.core.annotations.InBrowser)

Aggregations

Execute (com.wikia.webdriver.common.core.annotations.Execute)12 InBrowser (com.wikia.webdriver.common.core.annotations.InBrowser)12 SearchResultsPage (com.wikia.webdriver.elements.mercury.pages.SearchResultsPage)12 Test (org.testng.annotations.Test)12 ArticlePage (com.wikia.webdriver.elements.mercury.pages.ArticlePage)1 GuidelinesPage (com.wikia.webdriver.elements.mercury.pages.discussions.GuidelinesPage)1