use of com.wikia.webdriver.common.skin.SkinHelper in project selenium-tests by Wikia.
the class MainPageTests method MercuryCuratedMainPageTest_001_CheckElementsVisibilityElementsOrderAndRootPath.
@Test(groups = "MercuryCuratedMainPageTest_001")
@Execute(onWikia = MercuryWikis.MERCURY_CC)
@RelatedIssue(issueID = "XW-1739", comment = "if this tests fails just edit any article on mercurycc.wikia.com and wait 24h")
public void MercuryCuratedMainPageTest_001_CheckElementsVisibilityElementsOrderAndRootPath() {
init();
navigate.toPage(MercurySubpages.CC_MAIN_PAGE);
Assertion.assertTrue(new SkinHelper(driver).isSkin(Skin.MOBILE_WIKI));
new ArticlePageObject(driver).isFooterVisible();
boolean result = driver.getCurrentUrl().contains(ROOT_PATH);
PageObjectLogging.log("Current URL", "is set on " + ROOT_PATH, "is not set on " + ROOT_PATH, result);
result = curatedMainPage.isMobileTopLeaderboardVisible();
PageObjectLogging.log(PageElements.TOP_LEADERBOARD.name, MercuryMessages.VISIBLE_MSG, MercuryMessages.INVISIBLE_MSG, result);
result = curatedMainPage.isArticleTitleVisible();
PageObjectLogging.log(PageElements.ARTICLE_TITLE.name, MercuryMessages.VISIBLE_MSG, MercuryMessages.INVISIBLE_MSG, result);
result = curatedMainPage.isWikiaStatsContainerVisible();
PageObjectLogging.log(PageElements.WIKIA_STATS.name, MercuryMessages.VISIBLE_MSG, MercuryMessages.INVISIBLE_MSG, result);
Assertion.assertTrue(curatedMainPage.isMainPagePadSlotInDOM());
result = curatedMainPage.isFeaturedContentVisible();
PageObjectLogging.log(PageElements.FEATURED_CONTENT.name, MercuryMessages.VISIBLE_MSG, MercuryMessages.INVISIBLE_MSG, result);
result = curatedMainPage.isCuratedContentVisible();
PageObjectLogging.log(PageElements.CURATED_CONTENT.name, MercuryMessages.VISIBLE_MSG, MercuryMessages.INVISIBLE_MSG, result);
result = curatedMainPage.isMobileInContentVisible();
PageObjectLogging.log(PageElements.IN_CONTENT.name, MercuryMessages.VISIBLE_MSG, MercuryMessages.INVISIBLE_MSG, result);
result = curatedMainPage.isTrendingArticlesVisible();
PageObjectLogging.log(PageElements.TRENDING_ARTICLES.name, MercuryMessages.VISIBLE_MSG, MercuryMessages.INVISIBLE_MSG, result);
result = curatedMainPage.isMobilePrefooterVisible();
PageObjectLogging.log(PageElements.PREFOOTER.name, MercuryMessages.VISIBLE_MSG, MercuryMessages.INVISIBLE_MSG, result);
result = curatedMainPage.isTrendingVideosVisible();
PageObjectLogging.log(PageElements.TRENDING_VIDEOS.name, MercuryMessages.VISIBLE_MSG, MercuryMessages.INVISIBLE_MSG, result);
int lastPosition = 0;
String lastElement = "top";
for (PageElements element : PageElements.values()) {
int newPosition = curatedMainPage.getElementOffsetTop(element.className);
result = lastPosition <= newPosition;
PageObjectLogging.log(element.name, "is after " + lastElement, "is not after " + lastElement, result);
lastPosition = newPosition;
lastElement = element.name;
}
}
use of com.wikia.webdriver.common.skin.SkinHelper in project selenium-tests by Wikia.
the class Search method clickSearchSuggestion.
public String clickSearchSuggestion(int index, Skin fromSkin) {
String clickedSuggestion;
PageObjectLogging.logInfo("Select search suggestion no.: " + index);
WebElement searchResult = driver.findElements(By.cssSelector(searchSuggestionClass)).get(index);
wait.forElementClickable(searchResult);
clickedSuggestion = searchResult.getText();
searchResult.click();
// Mobile wiki opens the suggested page using AJAX, Mercury reloads the page and opens Mobile Wiki
if (fromSkin == Skin.MOBILE_WIKI) {
Loading loading = new Loading(driver);
loading.handleAsyncPageReload();
} else {
Assertion.assertTrue(new SkinHelper(driver).isSkin(Skin.MOBILE_WIKI));
}
return clickedSuggestion;
}
use of com.wikia.webdriver.common.skin.SkinHelper in project selenium-tests by Wikia.
the class SearchMercuryTests method mercury_search_navigateUsingSearchSuggestionsOnMobile.
@Execute(onWikia = MercuryWikis.MERCURY_AUTOMATION_TESTING)
@InBrowser(emulator = Emulator.GOOGLE_NEXUS_5)
@Test(groups = { "mercury_search_navigateUsingSearchSuggestionsOnMobile", "Mercury_Search_001" })
public void mercury_search_navigateUsingSearchSuggestionsOnMobile() {
String clickedSuggestion = new GuidelinesPage().open().getTopBar().openSearch().typeInSearch(SEARCH_PHRASE).clickSearchSuggestion(0, Skin.MERCURY);
Assertion.assertTrue(new SkinHelper(driver).isSkin(Skin.MOBILE_WIKI));
Assertion.assertEquals(clickedSuggestion.toLowerCase(), new ArticlePage().getHeader().getPageTitle().toLowerCase());
}
use of com.wikia.webdriver.common.skin.SkinHelper in project selenium-tests by Wikia.
the class SearchMercuryTests method mercury_search_navigateUsingSearchSuggestionsOnDesktop.
@Execute(onWikia = "dauto")
@Test(groups = { "mercury_search_navigateUsingSearchSuggestionsOnDesktop", "Mercury_Search_001" })
@InBrowser(browser = Browser.FIREFOX, browserSize = "1920x1080")
public void mercury_search_navigateUsingSearchSuggestionsOnDesktop() {
String clickedSuggestion = new GuidelinesPage().open().getTopBar().typeInDesktopSearchAndSelectSuggestion(SEARCH_PHRASE, 0);
Assertion.assertTrue(new SkinHelper(driver).isSkin(Skin.OASIS));
Assertion.assertEquals(clickedSuggestion.toLowerCase(), new ArticlePageObject().getArticleName().toLowerCase());
}
use of com.wikia.webdriver.common.skin.SkinHelper in project selenium-tests by Wikia.
the class ArticlePage method open.
public ArticlePage open(String pageName) {
getNavigate().toPage(pageName);
new SkinHelper(driver).isSkin(Skin.MOBILE_WIKI);
return this;
}
Aggregations