Search in sources :

Example 1 with TemplatePage

use of com.wikia.webdriver.elements.oasis.pages.TemplatePage in project selenium-tests by Wikia.

the class InfoboxBuilderTests method setInfoboxTitleToUseArticleName.

@Test(groups = { "InfoboxBuilderTests", "InfoboxBuilder_002" })
@Execute(asUser = User.USER)
public void setInfoboxTitleToUseArticleName() {
    TemplatePage template = new TemplatePage();
    Sidebar builderSidebar = new Sidebar();
    InfoboxBuilderPage builderPage = new InfoboxBuilderPage().openExisting("SetInfoboxTitleToUseArticleName").deleteTitleUsingPopUp(0);
    builderSidebar.addTitleComponent();
    builderPage.selectTitleWithIndex(0);
    builderSidebar.setTitleToUseArticleName();
    new Subhead().clickPublish();
    Assertion.assertTrue(template.isTemplatePagePresent());
    String infoboxTitle = template.getPortableInfobox().getTitleTextWithIndex(0);
    Assertion.assertEquals("SetInfoboxTitleToUseArticleName", infoboxTitle);
}
Also used : TemplatePage(com.wikia.webdriver.elements.oasis.pages.TemplatePage) InfoboxBuilderPage(com.wikia.webdriver.elements.mercury.pages.InfoboxBuilderPage) Execute(com.wikia.webdriver.common.core.annotations.Execute) Test(org.testng.annotations.Test)

Example 2 with TemplatePage

use of com.wikia.webdriver.elements.oasis.pages.TemplatePage 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 3 with TemplatePage

use of com.wikia.webdriver.elements.oasis.pages.TemplatePage in project selenium-tests by Wikia.

the class TemplateClassificationTest method templateClassification_createTemplateAndChangeItsType.

@Test(groups = "templateClassification_createTemplateAndChangeItsType")
public void templateClassification_createTemplateAndChangeItsType() {
    TemplatePage templatePage = new TemplatePage().createTemplate(DEFAULT_TEMPLATE_NAME).open(DEFAULT_TEMPLATE_NAME);
    TemplateClassification templateClassification = templatePage.getTemplateClassification();
    templateClassification.open().resetTemplateType().save();
    String oldTemplateType = templateClassification.getTemplateType();
    Assertion.assertEquals(templateClassification.getTemplateType(), TemplateTypes.UNKNOWN.getType());
    templateClassification.open().changeTemplateType(TemplateTypes.INFOBOX).save();
    Assertion.assertEquals(templateClassification.getTemplateType(), TemplateTypes.INFOBOX.getType());
    templateClassification.open().changeTemplateType(TemplateTypes.QUOTE).save();
    String currentTemplateType = templateClassification.getTemplateType();
    Assertion.assertNotEquals(currentTemplateType, oldTemplateType);
}
Also used : TemplateClassification(com.wikia.webdriver.elements.oasis.components.templateclassificiation.TemplateClassification) TemplatePage(com.wikia.webdriver.elements.oasis.pages.TemplatePage) Test(org.testng.annotations.Test)

Example 4 with TemplatePage

use of com.wikia.webdriver.elements.oasis.pages.TemplatePage in project selenium-tests by Wikia.

the class PortableInfoboxTests method verifyCopiedTemplateSyntaxInArticlePresence.

@Test(groups = { "PortableInfoboxTests", "PortableInfobox_002" })
@Execute(asUser = User.USER_9)
public void verifyCopiedTemplateSyntaxInArticlePresence() {
    TemplatePage template = new TemplatePage();
    ArticlePageObject article = new ArticlePageObject();
    PortableInfobox infobox = new PortableInfobox();
    AceEditor editor = new AceEditor();
    template.openArticleByName(wikiURL, String.format("%s:%s", PageContent.TEMPLATE_NAMESPACE, PageContent.INFOBOX_2)).editArticleInSrcUsingDropdown();
    String templateSyntax = editor.getContent();
    (new ArticleContent()).clear();
    article.open();
    new ArticlePurger().purgeArticleAsLoggedUser();
    article.openCurrectArticleSourceMode().addContentInSourceMode(templateSyntax).submitArticle();
    Assertion.assertTrue(infobox.isInfoboxTitleVisible());
}
Also used : ArticleContent(com.wikia.webdriver.common.core.api.ArticleContent) ArticlePageObject(com.wikia.webdriver.pageobjectsfactory.pageobject.article.ArticlePageObject) TemplatePage(com.wikia.webdriver.elements.oasis.pages.TemplatePage) ArticlePurger(com.wikia.webdriver.common.core.helpers.ArticlePurger) PortableInfobox(com.wikia.webdriver.pageobjectsfactory.pageobject.PortableInfobox) AceEditor(com.wikia.webdriver.pageobjectsfactory.componentobject.AceEditor) Execute(com.wikia.webdriver.common.core.annotations.Execute) Test(org.testng.annotations.Test)

Example 5 with TemplatePage

use of com.wikia.webdriver.elements.oasis.pages.TemplatePage in project selenium-tests by Wikia.

the class InfoboxBuilderTests method savingTemplate.

@Test(groups = { "InfoboxBuilderTests", "InfoboxBuilder_001" })
@Execute(asUser = User.USER)
public void savingTemplate() {
    Sidebar builderSidebar = new Sidebar();
    InfoboxBuilderPage builderPage = new InfoboxBuilderPage();
    String templateName = "InfoboxBuilderSavingTemplate";
    builderPage.openExisting(templateName).selectRowWithIndex(0);
    builderSidebar.clickDeleteButton();
    builderSidebar.addRowComponent();
    new Subhead().clickPublish();
    Assertion.assertEquals(templateName.toLowerCase(), new TemplatePage().getHeaderText().toLowerCase());
}
Also used : TemplatePage(com.wikia.webdriver.elements.oasis.pages.TemplatePage) InfoboxBuilderPage(com.wikia.webdriver.elements.mercury.pages.InfoboxBuilderPage) Execute(com.wikia.webdriver.common.core.annotations.Execute) Test(org.testng.annotations.Test)

Aggregations

TemplatePage (com.wikia.webdriver.elements.oasis.pages.TemplatePage)7 Test (org.testng.annotations.Test)7 Execute (com.wikia.webdriver.common.core.annotations.Execute)5 InfoboxBuilderPage (com.wikia.webdriver.elements.mercury.pages.InfoboxBuilderPage)5 ArticleContent (com.wikia.webdriver.common.core.api.ArticleContent)1 ArticlePurger (com.wikia.webdriver.common.core.helpers.ArticlePurger)1 TemplateClassification (com.wikia.webdriver.elements.oasis.components.templateclassificiation.TemplateClassification)1 WikiFeatures (com.wikia.webdriver.elements.oasis.pages.WikiFeatures)1 AceEditor (com.wikia.webdriver.pageobjectsfactory.componentobject.AceEditor)1 PortableInfobox (com.wikia.webdriver.pageobjectsfactory.pageobject.PortableInfobox)1 ArticlePageObject (com.wikia.webdriver.pageobjectsfactory.pageobject.article.ArticlePageObject)1 SpecialThemeDesignerPageObject (com.wikia.webdriver.pageobjectsfactory.pageobject.special.themedesigner.SpecialThemeDesignerPageObject)1