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");
}
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());
}
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");
}
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());
}
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);
}
Aggregations