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