Search in sources :

Example 6 with InfoboxBuilderPage

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

the class InfoboxBuilderTests method verifyLoadingDefaultTheme.

@Test(groups = { "InfoboxBuilderTests", "InfoboxBuilder_004" })
@Execute(asUser = User.STAFF)
public void verifyLoadingDefaultTheme() {
    new WikiFeatures().openWikiFeatures(wikiURL).disableEuropaInfoboxTheme();
    InfoboxBuilderPage builderPage = new InfoboxBuilderPage().openExisting("Infobox_theme_default");
    Assertion.assertEquals(builderPage.getInfoboxWidth(), DEFAULT_INFOBOX_WIDTH);
}
Also used : WikiFeatures(com.wikia.webdriver.elements.oasis.pages.WikiFeatures) InfoboxBuilderPage(com.wikia.webdriver.elements.mercury.pages.InfoboxBuilderPage) Execute(com.wikia.webdriver.common.core.annotations.Execute) Test(org.testng.annotations.Test)

Example 7 with InfoboxBuilderPage

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

the class InfoboxBuilderTests method deletingAddedComponents.

@Test(groups = { "InfoboxBuilderTests", "InfoboxBuilder_001" })
@Execute(asUser = User.USER)
public void deletingAddedComponents() {
    Sidebar builderSidebar = new Sidebar();
    InfoboxBuilderPage builderPage = new InfoboxBuilderPage().openNew("InfoboxBuilderDeletingAddedComponents");
    int rowComponents = builderPage.countRows();
    int titleComponents = builderPage.countTitles();
    int imageComponents = builderPage.countImages();
    int headerComponents = builderPage.countHeaders();
    builderSidebar.addImageComponent().addTitleComponent().addRowComponent().addHeaderComponent();
    /* deleting last (newly added) components */
    builderPage.selectRowWithIndex(builderPage.countRows() - 1);
    builderSidebar.clickDeleteButton();
    Assertion.assertEquals(rowComponents, builderPage.countRows());
    builderPage.selectTitleWithIndex(builderPage.countTitles() - 1);
    builderSidebar.clickDeleteButton();
    Assertion.assertEquals(titleComponents, builderPage.countTitles());
    builderPage.selectImageWithIndex(builderPage.countImages() - 1);
    builderSidebar.clickDeleteButton();
    Assertion.assertEquals(imageComponents, builderPage.countImages());
    builderPage.selectHeaderWithIndex(builderPage.countImages() - 1);
    builderSidebar.clickDeleteButton();
    Assertion.assertEquals(headerComponents, builderPage.countHeaders());
}
Also used : InfoboxBuilderPage(com.wikia.webdriver.elements.mercury.pages.InfoboxBuilderPage) Execute(com.wikia.webdriver.common.core.annotations.Execute) Test(org.testng.annotations.Test)

Example 8 with InfoboxBuilderPage

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

the class InfoboxBuilderTests method verifyGoToSourceEditorNonEditedInfobox.

@Test(groups = { "InfoboxBuilderTests", "InfoboxBuilder_003" })
@Execute(asUser = User.USER)
public void verifyGoToSourceEditorNonEditedInfobox() {
    new InfoboxBuilderPage().openExisting("InfoboxBuilderSavingTemplate");
    new Sidebar().clickGoToSourceButton();
    Assertion.assertTrue(new TemplateEditPage().isEditAreaDisplayed());
    Assertion.assertTrue(driver.getCurrentUrl().contains("InfoboxBuilderSavingTemplate"));
}
Also used : TemplateEditPage(com.wikia.webdriver.elements.oasis.pages.TemplateEditPage) InfoboxBuilderPage(com.wikia.webdriver.elements.mercury.pages.InfoboxBuilderPage) Execute(com.wikia.webdriver.common.core.annotations.Execute) Test(org.testng.annotations.Test)

Example 9 with InfoboxBuilderPage

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

the class InfoboxBuilderTests method verifyOtherContentIsNotChanged.

@Test(groups = { "InfoboxBuilderTests", "InfoboxBuilder_004" })
public void verifyOtherContentIsNotChanged() {
    Sidebar builderSidebar = new Sidebar();
    final String templateName = "Infobox_other_content";
    final String infoboxRegexp = "(?s)<infobox[^>]*>.*</infobox>";
    String beforePublish = new TemplatePage().getRawContent(templateName).replaceAll(infoboxRegexp, "");
    new TemplatePage().open(templateName).loginAs(User.USER_4);
    InfoboxBuilderPage builderPage = new InfoboxBuilderPage().openExisting(templateName);
    builderSidebar.addRowComponent();
    builderPage.selectRowWithIndex(0);
    builderSidebar.clickDeleteButton();
    new Subhead().clickPublish();
    builderPage.logOut();
    String afterPublish = new TemplatePage().getRawContent(templateName).replaceAll(infoboxRegexp, "");
    Assert.assertEquals(beforePublish, afterPublish);
}
Also used : TemplatePage(com.wikia.webdriver.elements.oasis.pages.TemplatePage) InfoboxBuilderPage(com.wikia.webdriver.elements.mercury.pages.InfoboxBuilderPage) Test(org.testng.annotations.Test)

Example 10 with InfoboxBuilderPage

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

the class InfoboxBuilderTests method verifyChevronTooltip.

@Test(groups = { "InfoboxBuilderTests", "InfoboxBuilder_004" })
@Execute(asUser = User.USER)
public void verifyChevronTooltip() {
    Sidebar builderSidebar = new Sidebar();
    InfoboxBuilderPage builderPage = new InfoboxBuilderPage().openExisting("InfoboxBuilderChevronPopup");
    Assertion.assertTrue(builderPage.isSectionTooltipPresentBelow(0));
    Assertion.assertTrue(builderPage.isSectionTooltipPresentAbove(1));
    builderSidebar.addHeaderComponent();
    builderPage.selectHeaderWithIndex(2);
    builderSidebar.changeHeaderCollapsibilityState();
    Assertion.assertTrue(builderPage.isSectionTooltipPresentAbove(2));
}
Also used : InfoboxBuilderPage(com.wikia.webdriver.elements.mercury.pages.InfoboxBuilderPage) Execute(com.wikia.webdriver.common.core.annotations.Execute) Test(org.testng.annotations.Test)

Aggregations

InfoboxBuilderPage (com.wikia.webdriver.elements.mercury.pages.InfoboxBuilderPage)25 Test (org.testng.annotations.Test)25 Execute (com.wikia.webdriver.common.core.annotations.Execute)24 TemplatePage (com.wikia.webdriver.elements.oasis.pages.TemplatePage)5 WikiFeatures (com.wikia.webdriver.elements.oasis.pages.WikiFeatures)4 TemplateEditPage (com.wikia.webdriver.elements.oasis.pages.TemplateEditPage)3 PortableInfobox (com.wikia.webdriver.pageobjectsfactory.pageobject.PortableInfobox)1 SpecialThemeDesignerPageObject (com.wikia.webdriver.pageobjectsfactory.pageobject.special.themedesigner.SpecialThemeDesignerPageObject)1 WebElement (org.openqa.selenium.WebElement)1