Search in sources :

Example 6 with ArticlePage

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

the class CategoryPageTest method mercury_category_navigateToCategoryPageFromLinkInArticle.

@Test(groups = "mercury_category_navigateToCategoryPageWithArticleAndWithoutMembersFromLink")
public void mercury_category_navigateToCategoryPageFromLinkInArticle() {
    final String categoryName = String.format("Category:%s", TestContext.getCurrentMethodName());
    new ArticleContent().push(String.format("[[%s]]", categoryName));
    CategoryPage categoryPage = new ArticlePage().open().openCategoryPageFromCategoriesDropdown();
    Assert.assertTrue(categoryPage.hasCategoryMembers());
}
Also used : ArticleContent(com.wikia.webdriver.common.core.api.ArticleContent) ArticlePage(com.wikia.webdriver.elements.mercury.pages.ArticlePage) CategoryPage(com.wikia.webdriver.elements.mercury.pages.CategoryPage) Test(org.testng.annotations.Test)

Example 7 with ArticlePage

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

the class SearchMobileWikiTests method mercury_search_userIsRedirectedToSearchResultsPage.

@Execute(onWikia = MercuryWikis.MERCURY_AUTOMATION_TESTING)
@InBrowser(emulator = Emulator.GOOGLE_NEXUS_5)
@Test(groups = { "mercury_search_userIsRedirectedToSearchResultsPage", "Mercury_Search_001" })
public void mercury_search_userIsRedirectedToSearchResultsPage() {
    SearchResultsPage searchResults = new ArticlePage().open(MercurySubpages.MAIN_PAGE).getTopBar().openSearch().typeInSearch(SEARCH_PHRASE).clickEnterAndNavigateToSearchResults(Skin.MOBILE_WIKI);
    Assertion.assertTrue(searchResults.isSearchResultsPageOpen());
}
Also used : SearchResultsPage(com.wikia.webdriver.elements.mercury.pages.SearchResultsPage) ArticlePage(com.wikia.webdriver.elements.mercury.pages.ArticlePage) Execute(com.wikia.webdriver.common.core.annotations.Execute) Test(org.testng.annotations.Test) InBrowser(com.wikia.webdriver.common.core.annotations.InBrowser)

Example 8 with ArticlePage

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

the class TopBarTests method mercury_topbar_closeButtonAppears.

@Test(groups = "mercury_topbar_closeButtonAppears")
public void mercury_topbar_closeButtonAppears() {
    TopBar topBar = new ArticlePage().open(MercurySubpages.MAIN_PAGE).getTopBar();
    topBar.openSearch();
    Assertion.assertTrue(topBar.isCloseIconVisible());
    topBar.clickCloseButton();
    Assertion.assertTrue(topBar.isSearchIconVisible());
    topBar.openNavigation();
    Assertion.assertTrue(topBar.isCloseIconVisible());
    topBar.clickCloseButton();
    Assertion.assertTrue(topBar.isHamburgerIconVisible());
}
Also used : TopBar(com.wikia.webdriver.elements.mercury.components.TopBar) ArticlePage(com.wikia.webdriver.elements.mercury.pages.ArticlePage) Test(org.testng.annotations.Test)

Example 9 with ArticlePage

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

the class HeaderTest method mercury_header_heroImageIsProperlyStyled.

@Test(groups = "mercury_header_heroImageIsProperlyStyled")
public void mercury_header_heroImageIsProperlyStyled() {
    Header header = new ArticlePage().open(MercurySubpages.INFOBOX_1).getHeader();
    Map<String, String> attributeExpectedValues = new HashMap<String, String>() {

        {
            put("background-color", "rgba(255, 255, 255, 1)");
            put("background-position", "50% 50%");
            put("background-repeat", "no-repeat");
        }
    };
    for (Map.Entry<String, String> attribute : attributeExpectedValues.entrySet()) {
        String attributeName = attribute.getKey();
        Assertion.assertEquals(header.getHeroImageCssValue(attributeName), attribute.getValue(), String.format(INVALID_ATTRIBUTE_MESSAGE_TEMPLATE, HERO_IMAGE_MESSAGE, attributeName));
    }
}
Also used : Header(com.wikia.webdriver.elements.mercury.components.Header) HashMap(java.util.HashMap) ArticlePage(com.wikia.webdriver.elements.mercury.pages.ArticlePage) HashMap(java.util.HashMap) Map(java.util.Map) Test(org.testng.annotations.Test)

Example 10 with ArticlePage

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

the class HeaderTest method mercury_header_checkElementsVisibilityWithoutInfobox.

@Test(groups = "mercury_header_checkElementsVisibilityWithoutInfobox")
public void mercury_header_checkElementsVisibilityWithoutInfobox() {
    Header header = new ArticlePage().open(MercurySubpages.NO_INFOBOX).getHeader();
    Assertion.assertTrue(header.isHeaderVisible(), String.format(ELEMENT_EXPECTATION_MESSAGE_TEMPLATE, HEADER_MESSAGE, VISIBLE_MESSAGE));
    Assertion.assertTrue(header.isPageTitleVisible(), String.format(ELEMENT_EXPECTATION_MESSAGE_TEMPLATE, PAGE_TITLE_MESSAGE, VISIBLE_MESSAGE));
    Assertion.assertFalse(header.isHeroImageVisible(), String.format(ELEMENT_EXPECTATION_MESSAGE_TEMPLATE, HERO_IMAGE_MESSAGE, INVISIBLE_MESSAGE));
}
Also used : Header(com.wikia.webdriver.elements.mercury.components.Header) ArticlePage(com.wikia.webdriver.elements.mercury.pages.ArticlePage) Test(org.testng.annotations.Test)

Aggregations

ArticlePage (com.wikia.webdriver.elements.mercury.pages.ArticlePage)25 Test (org.testng.annotations.Test)25 Header (com.wikia.webdriver.elements.mercury.components.Header)6 TopBar (com.wikia.webdriver.elements.mercury.components.TopBar)4 SignInPage (com.wikia.webdriver.pageobjectsfactory.pageobject.auth.signin.SignInPage)4 Execute (com.wikia.webdriver.common.core.annotations.Execute)3 InBrowser (com.wikia.webdriver.common.core.annotations.InBrowser)3 EditorHomePageObject (com.wikia.webdriver.elements.mercury.old.curatedcontent.EditorHomePageObject)3 ArticleContent (com.wikia.webdriver.common.core.api.ArticleContent)2 JavascriptActions (com.wikia.webdriver.common.core.elemnt.JavascriptActions)2 CuratedMainPagePageObject (com.wikia.webdriver.elements.mercury.old.curatedcontent.CuratedMainPagePageObject)2 CategoryPage (com.wikia.webdriver.elements.mercury.pages.CategoryPage)2 SkinHelper (com.wikia.webdriver.common.skin.SkinHelper)1 CuratedContentPageObject (com.wikia.webdriver.elements.mercury.old.curatedcontent.CuratedContentPageObject)1 SearchResultsPage (com.wikia.webdriver.elements.mercury.pages.SearchResultsPage)1 GuidelinesPage (com.wikia.webdriver.elements.mercury.pages.discussions.GuidelinesPage)1 HashMap (java.util.HashMap)1 Map (java.util.Map)1