Search in sources :

Example 6 with ArticlePageObject

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);
}
Also used : CuratedContentPageObject(com.wikia.webdriver.elements.mercury.old.curatedcontent.CuratedContentPageObject) ArticlePageObject(com.wikia.webdriver.elements.mercury.old.ArticlePageObject) Loading(com.wikia.webdriver.elements.mercury.components.Loading) Navigate(com.wikia.webdriver.elements.common.Navigate)

Example 7 with ArticlePageObject

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);
}
Also used : ArticlePageObject(com.wikia.webdriver.elements.mercury.old.ArticlePageObject) Test(org.testng.annotations.Test)

Example 8 with ArticlePageObject

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);
}
Also used : ArticlePageObject(com.wikia.webdriver.elements.mercury.old.ArticlePageObject) Test(org.testng.annotations.Test)

Example 9 with ArticlePageObject

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);
}
Also used : ArticlePageObject(com.wikia.webdriver.elements.mercury.old.ArticlePageObject) Test(org.testng.annotations.Test)

Aggregations

ArticlePageObject (com.wikia.webdriver.elements.mercury.old.ArticlePageObject)9 Test (org.testng.annotations.Test)8 Execute (com.wikia.webdriver.common.core.annotations.Execute)1 RelatedIssue (com.wikia.webdriver.common.core.annotations.RelatedIssue)1 SkinHelper (com.wikia.webdriver.common.skin.SkinHelper)1 Navigate (com.wikia.webdriver.elements.common.Navigate)1 Loading (com.wikia.webdriver.elements.mercury.components.Loading)1 LoginPageObject (com.wikia.webdriver.elements.mercury.old.LoginPageObject)1 CuratedContentPageObject (com.wikia.webdriver.elements.mercury.old.curatedcontent.CuratedContentPageObject)1