use of com.wikia.webdriver.elements.mercury.old.ArticlePageObject in project selenium-tests by Wikia.
the class NavigationTests method init.
private void init() {
this.curatedContent = new CuratedContentPageObject();
this.navigate = new Navigate();
this.loading = new Loading(driver);
this.article = new ArticlePageObject(driver);
}
use of com.wikia.webdriver.elements.mercury.old.ArticlePageObject in project selenium-tests by Wikia.
the class ArticlePageTests method mercury_article_navigateToArticlesWithColonAndQuestionMark.
@Test(groups = "mercury_article_navigateToArticlesWithColonAndQuestionMark")
public void mercury_article_navigateToArticlesWithColonAndQuestionMark() {
init();
ArticlePageObject article = new ArticlePageObject(driver);
String encodedQuestionMarkUrl = "/wiki/Question%3Fmark%3Fquestion";
String encodedColonUrl = "/wiki/Colon%3Acolon%3Acolon";
PageObjectLogging.logWarning("Info", "Accessing article directly through URL");
navigate.toPage(encodedColonUrl);
boolean result = driver.getCurrentUrl().contains(encodedColonUrl);
PageObjectLogging.log("URL for colon", "is encoded", "is not encoded", result);
result = MercurySubpages.COLON.toLowerCase().contains(article.getArticleTitle().toLowerCase());
PageObjectLogging.log("Article title for colon", "is correct", "is not correct", result);
navigate.toPage(encodedQuestionMarkUrl);
result = driver.getCurrentUrl().contains(encodedQuestionMarkUrl);
PageObjectLogging.log("URL for question mark", "is encoded", "is not encoded", result);
result = MercurySubpages.QUESTION_MARK.toLowerCase().contains(article.getArticleTitle().toLowerCase());
PageObjectLogging.log("Article title for question mark", "is correct", "is not correct", result);
PageObjectLogging.logWarning("Info", "Accessing article through link in content");
article.clickOnAnchorInContent(0);
loading.handleAsyncPageReload();
result = !driver.getCurrentUrl().contains(encodedColonUrl);
PageObjectLogging.log("URL for colon", "is not encoded", "is encoded", result);
result = MercurySubpages.COLON.toLowerCase().contains(article.getArticleTitle().toLowerCase());
PageObjectLogging.log("Article title for colon", "is correct", "is not correct", result);
article.clickOnAnchorInContent(0);
loading.handleAsyncPageReload();
result = driver.getCurrentUrl().contains(encodedQuestionMarkUrl);
PageObjectLogging.log("URL for question mark", "is encoded", "is not encoded", result);
result = MercurySubpages.QUESTION_MARK.toLowerCase().contains(article.getArticleTitle().toLowerCase());
PageObjectLogging.log("Article title for question mark", "is correct", "is not correct", result);
PageObjectLogging.logWarning("Info", "Accessing article through link in navigation side");
topBar.openNavigation();
navigation.openSubMenu(3);
navigation.openPageLink(5);
result = !driver.getCurrentUrl().contains(encodedColonUrl);
PageObjectLogging.log("URL for colon", "is not encoded", "is encoded", result);
result = MercurySubpages.COLON.toLowerCase().contains(article.getArticleTitle().toLowerCase());
PageObjectLogging.log("Article title for colon", "is correct", "is not correct", result);
topBar.openNavigation();
navigation.openSubMenu(3);
navigation.openPageLink(4);
result = driver.getCurrentUrl().contains(encodedQuestionMarkUrl);
PageObjectLogging.log("URL for question mark", "is encoded", "is not encoded", result);
result = MercurySubpages.QUESTION_MARK.toLowerCase().contains(article.getArticleTitle().toLowerCase());
PageObjectLogging.log("Article title for question mark", "is correct", "is not correct", result);
PageObjectLogging.logWarning("Info", "Accessing article through link in search result");
topBar.openSearch().navigateToPage(MercurySubpages.COLON.substring(6));
result = driver.getCurrentUrl().contains(encodedColonUrl);
PageObjectLogging.log("URL for colon", "is encoded", "is not encoded", result);
result = MercurySubpages.COLON.toLowerCase().contains(article.getArticleTitle().toLowerCase());
PageObjectLogging.log("Article title for colon", "is correct", "is not correct", result);
topBar.openSearch().navigateToPage(MercurySubpages.QUESTION_MARK.substring(6));
result = driver.getCurrentUrl().contains(encodedQuestionMarkUrl);
PageObjectLogging.log("URL for question mark", "is encoded", "is not encoded", result);
result = MercurySubpages.QUESTION_MARK.toLowerCase().contains(article.getArticleTitle().toLowerCase());
PageObjectLogging.log("Article title for question mark", "is correct", "is not correct", result);
}
use of com.wikia.webdriver.elements.mercury.old.ArticlePageObject in project selenium-tests by Wikia.
the class ArticlePageTests method mercury_article_linksInTopContributorsSectionRedirectsToUserPage.
@Test(groups = "mercury_article_linksInTopContributorsSectionRedirectsToUserPage")
public void mercury_article_linksInTopContributorsSectionRedirectsToUserPage() {
init();
ArticlePageObject articlePage = new ArticlePageObject(driver);
navigate.toPage(MercurySubpages.MAIN_PAGE);
articlePage.clickTopContributor(0);
boolean result = articlePage.isUrlContainingUserPage();
PageObjectLogging.log("Url", "match pattern /wiki/User:", "does not match pattern /wiki/User:", result);
}
use of com.wikia.webdriver.elements.mercury.old.ArticlePageObject in project selenium-tests by Wikia.
the class ArticlePageTests method mercury_article_linkedImagesRedirectToCorrespondingUrl.
@Test(groups = "mercury_article_linkedImagesRedirectToCorrespondingUrl")
public void mercury_article_linkedImagesRedirectToCorrespondingUrl() {
init();
ArticlePageObject articlePage = new ArticlePageObject(driver);
navigate.toPage(MercurySubpages.LINKED_IMAGES);
String oldUrl = driver.getCurrentUrl();
articlePage.clickOnImage(0);
loading.handleAsyncPageReload();
boolean result = !driver.getCurrentUrl().equals(oldUrl);
PageObjectLogging.log("Redirection", "works", "does not work", result);
}
Aggregations