Search in sources :

Example 1 with ArticlePage

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

the class LightboxTests method mercury_lightbox_PreserveScrollPositionAfterLightboxOpen.

@Test
public void mercury_lightbox_PreserveScrollPositionAfterLightboxOpen() {
    ArticlePage articlePage = new ArticlePage().open("/LightboxTest");
    articlePage.getLightbox().openLightboxImage(0);
    Long startingPosition = new JavascriptActions().getCurrentPosition();
    articlePage.getLightbox().clickCloseButton();
    Long closingPosition = new JavascriptActions().getCurrentPosition();
    Assertion.assertEquals(startingPosition, closingPosition, "Starting scroll position should be " + "the same as closing position");
    Assertion.assertTrue(startingPosition > 0 && closingPosition > 0, "Page shoudln't be scrolled" + "to top");
}
Also used : JavascriptActions(com.wikia.webdriver.common.core.elemnt.JavascriptActions) ArticlePage(com.wikia.webdriver.elements.mercury.pages.ArticlePage) Test(org.testng.annotations.Test)

Example 2 with ArticlePage

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

the class TopBarTests method mercury_topbar_topBarIsAlwaysVisible.

@Test(groups = "mercury_topbar_topBarIsAlwaysVisible")
public void mercury_topbar_topBarIsAlwaysVisible() {
    TopBar topBar = new ArticlePage().open(MercurySubpages.MAIN_PAGE).getTopBar();
    Assertion.assertTrue(topBar.isNavigationBarVisible());
    Assertion.assertTrue(topBar.isLogoVisible());
    Assertion.assertTrue(topBar.isHamburgerIconVisible());
    Assertion.assertTrue(topBar.isSearchIconVisible());
    driver.executeScript("window.scrollTo(100, document.body.scrollHeight)");
    Assertion.assertTrue(topBar.isNavigationBarVisible());
    Assertion.assertTrue(topBar.isLogoVisible());
    Assertion.assertTrue(topBar.isHamburgerIconVisible());
    Assertion.assertTrue(topBar.isSearchIconVisible());
}
Also used : TopBar(com.wikia.webdriver.elements.mercury.components.TopBar) ArticlePage(com.wikia.webdriver.elements.mercury.pages.ArticlePage) Test(org.testng.annotations.Test)

Example 3 with ArticlePage

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

the class EditorTests method MercuryCuratedEditorTest_002_addAndSaveSection.

@Test(groups = "MercuryCuratedEditorTest_002")
public void MercuryCuratedEditorTest_002_addAndSaveSection() {
    Boolean result = new ArticlePage().open(MercurySubpages.ECC_MAIN_PAGE).getCuratedMainPage().isFeaturedContentVisible();
    PageObjectLogging.logInfo(String.format("Curated content is visible: %s", result));
    new EditorHomePageObject().open().clickAddSection().typeDisplayName(SECTION_DISPLAY_NAME).clickOnImage().clickSearchForImageButton().type(SEARCH_IMAGE_QUERY).clickOnImage(0).clickDoneButton().clickDone().getSectionItemList().clickAddCategory().typeDisplayName(ITEM_DISPLAY_NAME).typePageName(ITEM_PAGE_NAME).clickOnImage().clickSearchForImageButton().type(SEARCH_IMAGE_QUERY).clickOnImage(0).clickDoneButton().clickDone().getSectionItemList().verifyItem(ITEM_DISPLAY_NAME).waitForAddCategoryButtonToBeVisible().clickDone().waitForAddCategoryButtonToBeVisible().publish();
    PageObjectLogging.log("Curated Content", MercuryMessages.VISIBLE_MSG, MercuryMessages.INVISIBLE_MSG, new CuratedMainPagePageObject().isCuratedContentVisible());
    new CuratedContentPageObject().clickOnCuratedContentElementByIndex(0);
    Assertion.assertNumber(new CuratedContentPageObject().getCuratedContentItemsNumber(), 1, "If error says that 3 elements were found - it means getList API returned cached response - ticket created: XW-1281");
}
Also used : CuratedContentPageObject(com.wikia.webdriver.elements.mercury.old.curatedcontent.CuratedContentPageObject) CuratedMainPagePageObject(com.wikia.webdriver.elements.mercury.old.curatedcontent.CuratedMainPagePageObject) ArticlePage(com.wikia.webdriver.elements.mercury.pages.ArticlePage) EditorHomePageObject(com.wikia.webdriver.elements.mercury.old.curatedcontent.EditorHomePageObject) Test(org.testng.annotations.Test)

Example 4 with ArticlePage

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

the class EditorTests method MercuryCuratedEditorTest_003_addAndSaveItemToOptionalSection.

@Test(groups = "MercuryCuratedEditorTest_003")
public void MercuryCuratedEditorTest_003_addAndSaveItemToOptionalSection() {
    Boolean result = new ArticlePage().open(MercurySubpages.ECC_MAIN_PAGE).getCuratedMainPage().isFeaturedContentVisible();
    PageObjectLogging.logInfo(String.format("Curated content is visible: %s", result));
    new EditorHomePageObject().open().clickAddCategory().typeDisplayName(ITEM_DISPLAY_NAME).typePageName(ITEM_PAGE_NAME).clickOnImage().clickSearchForImageButton().type(SEARCH_IMAGE_QUERY).clickOnImage(0).clickDoneButton().clickDone().waitForAddCategoryButtonToBeVisible().publish();
    PageObjectLogging.log("Curated Content", MercuryMessages.VISIBLE_MSG, MercuryMessages.INVISIBLE_MSG, new CuratedMainPagePageObject().isCuratedContentVisible());
}
Also used : CuratedMainPagePageObject(com.wikia.webdriver.elements.mercury.old.curatedcontent.CuratedMainPagePageObject) ArticlePage(com.wikia.webdriver.elements.mercury.pages.ArticlePage) EditorHomePageObject(com.wikia.webdriver.elements.mercury.old.curatedcontent.EditorHomePageObject) Test(org.testng.annotations.Test)

Example 5 with ArticlePage

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

the class EditorTests method MercuryCuratedEditorTest_001_addAndSaveItemToFeaturedContent.

@Test(groups = "MercuryCuratedEditorTest_001")
public void MercuryCuratedEditorTest_001_addAndSaveItemToFeaturedContent() {
    Boolean result = new ArticlePage().open(MercurySubpages.ECC_MAIN_PAGE).getCuratedMainPage().isFeaturedContentVisible();
    PageObjectLogging.logInfo(String.format("Curated content is visible: %s", result));
    new EditorHomePageObject().open().clickAddFeaturedContent().typeDisplayName(ITEM_DISPLAY_NAME).typePageName(ITEM_PAGE_NAME).clickOnImage().clickSearchForImageButton().type(SEARCH_IMAGE_QUERY).clickOnImage(0).clickDoneButton().clickDone().waitForAddCategoryButtonToBeVisible().publish();
    result = new ArticlePage().getCuratedMainPage().isFeaturedContentVisible();
    PageObjectLogging.log("Featured Content", MercuryMessages.VISIBLE_MSG, MercuryMessages.INVISIBLE_MSG, result);
}
Also used : ArticlePage(com.wikia.webdriver.elements.mercury.pages.ArticlePage) EditorHomePageObject(com.wikia.webdriver.elements.mercury.old.curatedcontent.EditorHomePageObject) 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