Search in sources :

Example 1 with VisualEditorSaveChangesDialog

use of com.wikia.webdriver.pageobjectsfactory.componentobject.visualeditordialogs.VisualEditorSaveChangesDialog in project selenium-tests by Wikia.

the class VEImageTests method changeImageAlignment.

@Test(groups = { "VEImageTests", "VEMediaSetting" })
@Execute(asUser = User.USER_9)
public void changeImageAlignment() {
    int numOfMedia = 3;
    List<String> wikiTexts = new ArrayList<String>();
    wikiTexts.add("|centre");
    wikiTexts.add("|left");
    String randomArticleName = PageContent.ARTICLE_NAME_PREFIX + new VisualEditorPageObject().getTimeStamp();
    VisualEditorPageObject veCreatePage = new VisualEditorPageObject().openVEOnArticle(wikiURL, randomArticleName);
    VisualEditorAddMediaDialog mediaDialog = veCreatePage.searchImage("h");
    veCreatePage = mediaDialog.addExistingMedia(numOfMedia);
    veCreatePage.verifyMedias(numOfMedia);
    veCreatePage.clickPublishButton();
    new VisualEditorSaveChangesDialog(this.driver).savePage();
    veCreatePage.waitForPageLoad();
    ArticlePageObject article = new ArticlePageObject();
    article.openVEModeWithMainEditButton();
    VisualEditorPageObject ve = new VisualEditorPageObject();
    ve.alignMedia(2, Alignment.LEFT);
    ve.alignMedia(0, Alignment.CENTER);
    ve.verifyEditorSurfacePresent();
    ve.verifyVEToolBarPresent();
    VisualEditorSaveChangesDialog saveDialog = ve.clickPublishButton();
    VisualEditorReviewChangesDialog reviewDialog = saveDialog.clickReviewYourChanges();
    reviewDialog.verifyAddedDiffs(wikiTexts);
    saveDialog = reviewDialog.clickReturnToSaveFormButton();
    saveDialog.savePage();
    article.verifyVEPublishComplete();
}
Also used : VisualEditorAddMediaDialog(com.wikia.webdriver.pageobjectsfactory.componentobject.visualeditordialogs.VisualEditorAddMediaDialog) ArticlePageObject(com.wikia.webdriver.pageobjectsfactory.pageobject.article.ArticlePageObject) VisualEditorPageObject(com.wikia.webdriver.pageobjectsfactory.pageobject.visualeditor.VisualEditorPageObject) ArrayList(java.util.ArrayList) VisualEditorReviewChangesDialog(com.wikia.webdriver.pageobjectsfactory.componentobject.visualeditordialogs.VisualEditorReviewChangesDialog) VisualEditorSaveChangesDialog(com.wikia.webdriver.pageobjectsfactory.componentobject.visualeditordialogs.VisualEditorSaveChangesDialog) Execute(com.wikia.webdriver.common.core.annotations.Execute) Test(org.testng.annotations.Test)

Example 2 with VisualEditorSaveChangesDialog

use of com.wikia.webdriver.pageobjectsfactory.componentobject.visualeditordialogs.VisualEditorSaveChangesDialog in project selenium-tests by Wikia.

the class VERecaptchaTests method VEAddRecaptchaTests_001_AddExternalURL.

// Verify that second click on "Save page" button changes recaptcha.
@Test(groups = { "VERecaptchaTests", "VEAddRecaptcha_001", "VEAnon" })
public void VEAddRecaptchaTests_001_AddExternalURL() {
    String articleName = PageContent.ARTICLE_NAME_PREFIX + base.getTimeStamp();
    VisualEditorPageObject ve = base.openVEOnArticle(wikiURL, articleName);
    ve.verifyVEToolBarPresent();
    ve.verifyEditorSurfacePresent();
    ve.typeTextArea(URLsContent.EXTERNAL_URL);
    VisualEditorSaveChangesDialog saveDialog = ve.clickPublishButton();
    saveDialog = saveDialog.clickSaveWithRecaptcha();
    saveDialog.verifyRecaptchaImageSrc();
    String firstImgSrc = saveDialog.getRecaptchaImageSrc();
    saveDialog = saveDialog.clickSaveWithRecaptcha();
    saveDialog.verifyRecaptchaIsVisible();
    saveDialog.verifyRecaptchaImageSrc();
    saveDialog.verifyIsNewRecaptcha(firstImgSrc);
}
Also used : VisualEditorPageObject(com.wikia.webdriver.pageobjectsfactory.pageobject.visualeditor.VisualEditorPageObject) VisualEditorSaveChangesDialog(com.wikia.webdriver.pageobjectsfactory.componentobject.visualeditordialogs.VisualEditorSaveChangesDialog) Test(org.testng.annotations.Test)

Example 3 with VisualEditorSaveChangesDialog

use of com.wikia.webdriver.pageobjectsfactory.componentobject.visualeditordialogs.VisualEditorSaveChangesDialog in project selenium-tests by Wikia.

the class VETemplateTests method VETemplateTests_003_AddTemplates.

@RelatedIssue(issueID = "WW-108")
@Test(enabled = false, groups = { "VETemplate", "VETemplateTests_003", "VEAddTemplate" })
public void VETemplateTests_003_AddTemplates() {
    articleName = PageContent.ARTICLE_NAME_PREFIX + base.getTimeStamp();
    VisualEditorPageObject ve = base.openVEOnArticle(wikiURL, articleName);
    ve.verifyVEToolBarPresent();
    ve.verifyEditorSurfacePresent();
    int numBlockTransclusion = ve.getNumberOfBlockTransclusion();
    int numInlineTransclusion = ve.getNumberOfInlineTransclusion();
    VisualEditorInsertTemplateDialog templateDialog = (VisualEditorInsertTemplateDialog) ve.openDialogFromMenu(InsertDialog.TEMPLATE);
    VisualEditorEditTemplateDialog editTemplateDialog = templateDialog.selectSuggestedTemplate(0);
    ve = editTemplateDialog.clickDone();
    ve.verifyNumberOfBlockTransclusion(numBlockTransclusion);
    ve.verifyNumberOfInlineTransclusion(++numInlineTransclusion);
    templateDialog = (VisualEditorInsertTemplateDialog) ve.openDialogFromMenu(InsertDialog.TEMPLATE);
    editTemplateDialog = templateDialog.selectResultTemplate(VEContent.TEMPLATE_SEARCH_3CHARS_PARTIALMATCH, 1);
    ve = editTemplateDialog.closeDialog();
    ve.verifyNumberOfBlockTransclusion(++numBlockTransclusion);
    ve.verifyNumberOfInlineTransclusion(numInlineTransclusion);
    VisualEditorSaveChangesDialog saveDialog = ve.clickPublishButton();
    ArticlePageObject article = saveDialog.savePage();
    article.verifyVEPublishComplete();
}
Also used : ArticlePageObject(com.wikia.webdriver.pageobjectsfactory.pageobject.article.ArticlePageObject) VisualEditorInsertTemplateDialog(com.wikia.webdriver.pageobjectsfactory.componentobject.visualeditordialogs.VisualEditorInsertTemplateDialog) VisualEditorPageObject(com.wikia.webdriver.pageobjectsfactory.pageobject.visualeditor.VisualEditorPageObject) VisualEditorEditTemplateDialog(com.wikia.webdriver.pageobjectsfactory.componentobject.visualeditordialogs.VisualEditorEditTemplateDialog) VisualEditorSaveChangesDialog(com.wikia.webdriver.pageobjectsfactory.componentobject.visualeditordialogs.VisualEditorSaveChangesDialog) Test(org.testng.annotations.Test) RelatedIssue(com.wikia.webdriver.common.core.annotations.RelatedIssue)

Example 4 with VisualEditorSaveChangesDialog

use of com.wikia.webdriver.pageobjectsfactory.componentobject.visualeditordialogs.VisualEditorSaveChangesDialog in project selenium-tests by Wikia.

the class VETemplateTests method VETemplateTests_006_EditTemplate.

@RelatedIssue(issueID = "WW-108")
@Test(enabled = false, groups = { "VETemplate", "VETemplateTests_006", "VEAddTemplate" }, dependsOnGroups = "VETemplateTests_004")
public void VETemplateTests_006_EditTemplate() {
    List<String> templateWikiTexts = new ArrayList<>();
    templateWikiTexts.add(VEContent.TEMPLATE_WIKITEXT);
    VisualEditorPageObject ve = base.openVEOnArticle(wikiURL, articleName);
    ve.verifyVEToolBarPresent();
    ve.verifyEditorSurfacePresent();
    ve.clickTransclusion(0, Transclusion.INLINE);
    VisualEditorEditTemplateDialog editTemplateDialog = ve.openEditTemplateDialog();
    editTemplateDialog.typeInParam(VEContent.TEMPLATE_PARAM_LABEL1, VEContent.TEMPLATE_PARAM_VALUE1);
    editTemplateDialog.typeInParam(VEContent.TEMPLATE_PARAM_LABEL2, VEContent.TEMPLATE_PARAM_VALUE2);
    ve = editTemplateDialog.clickDone();
    VisualEditorSaveChangesDialog saveDialog = ve.clickPublishButton();
    VisualEditorReviewChangesDialog reviewDialog = saveDialog.clickReviewYourChanges();
    reviewDialog.verifyAddedDiffs(templateWikiTexts);
    saveDialog = reviewDialog.clickReturnToSaveFormButton();
    ArticlePageObject article = saveDialog.savePage();
    article.verifyVEPublishComplete();
}
Also used : ArticlePageObject(com.wikia.webdriver.pageobjectsfactory.pageobject.article.ArticlePageObject) VisualEditorPageObject(com.wikia.webdriver.pageobjectsfactory.pageobject.visualeditor.VisualEditorPageObject) VisualEditorEditTemplateDialog(com.wikia.webdriver.pageobjectsfactory.componentobject.visualeditordialogs.VisualEditorEditTemplateDialog) ArrayList(java.util.ArrayList) VisualEditorReviewChangesDialog(com.wikia.webdriver.pageobjectsfactory.componentobject.visualeditordialogs.VisualEditorReviewChangesDialog) VisualEditorSaveChangesDialog(com.wikia.webdriver.pageobjectsfactory.componentobject.visualeditordialogs.VisualEditorSaveChangesDialog) Test(org.testng.annotations.Test) RelatedIssue(com.wikia.webdriver.common.core.annotations.RelatedIssue)

Example 5 with VisualEditorSaveChangesDialog

use of com.wikia.webdriver.pageobjectsfactory.componentobject.visualeditordialogs.VisualEditorSaveChangesDialog in project selenium-tests by Wikia.

the class VETemplateTests method VETemplateTests_004_CheckBlockedTransclusion.

@RelatedIssue(issueID = "WW-108")
@Test(enabled = false, groups = { "VETemplate", "VETemplateTests_004", "VEAddTemplate", "VETemplateTests_005", "VETemplateTests_006" })
public void VETemplateTests_004_CheckBlockedTransclusion() {
    articleName = PageContent.ARTICLE_NAME_PREFIX + base.getTimeStamp();
    VisualEditorPageObject ve = base.openVEOnArticle(wikiURL, articleName);
    ve.verifyVEToolBarPresent();
    ve.verifyEditorSurfacePresent();
    String selectText = PageContent.ARTICLE_TEXT.substring(12, 13);
    int numBlockTransclusion = ve.getNumberOfBlockTransclusion();
    int numInlineTransclusion = ve.getNumberOfInlineTransclusion();
    ve.typeTextArea(PageContent.ARTICLE_TEXT);
    ve.selectText(selectText);
    VisualEditorInsertTemplateDialog templateDialog = (VisualEditorInsertTemplateDialog) ve.openDialogFromMenu(InsertDialog.TEMPLATE);
    VisualEditorEditTemplateDialog editTemplateDialog = templateDialog.selectResultTemplate(VEContent.TEMPLATE_SEARCH_EXACTMATCH, 0);
    ve = editTemplateDialog.clickDone();
    ve.verifyNumberOfBlockTransclusion(numBlockTransclusion);
    ve.verifyNumberOfInlineTransclusion(++numInlineTransclusion);
    templateDialog = (VisualEditorInsertTemplateDialog) ve.openDialogFromMenu(InsertDialog.TEMPLATE);
    editTemplateDialog = templateDialog.selectResultTemplate(VEContent.TEMPLATE_SEARCH_EXACTMATCH, 0);
    ve = editTemplateDialog.clickDone();
    ve.verifyNumberOfBlockTransclusion(numBlockTransclusion);
    ve.verifyNumberOfInlineTransclusion(++numInlineTransclusion);
    VisualEditorSaveChangesDialog saveDialog = ve.clickPublishButton();
    ArticlePageObject article = saveDialog.savePage();
    article.verifyVEPublishComplete();
}
Also used : ArticlePageObject(com.wikia.webdriver.pageobjectsfactory.pageobject.article.ArticlePageObject) VisualEditorInsertTemplateDialog(com.wikia.webdriver.pageobjectsfactory.componentobject.visualeditordialogs.VisualEditorInsertTemplateDialog) VisualEditorPageObject(com.wikia.webdriver.pageobjectsfactory.pageobject.visualeditor.VisualEditorPageObject) VisualEditorEditTemplateDialog(com.wikia.webdriver.pageobjectsfactory.componentobject.visualeditordialogs.VisualEditorEditTemplateDialog) VisualEditorSaveChangesDialog(com.wikia.webdriver.pageobjectsfactory.componentobject.visualeditordialogs.VisualEditorSaveChangesDialog) Test(org.testng.annotations.Test) RelatedIssue(com.wikia.webdriver.common.core.annotations.RelatedIssue)

Aggregations

VisualEditorSaveChangesDialog (com.wikia.webdriver.pageobjectsfactory.componentobject.visualeditordialogs.VisualEditorSaveChangesDialog)18 VisualEditorPageObject (com.wikia.webdriver.pageobjectsfactory.pageobject.visualeditor.VisualEditorPageObject)17 Test (org.testng.annotations.Test)17 ArticlePageObject (com.wikia.webdriver.pageobjectsfactory.pageobject.article.ArticlePageObject)16 VisualEditorReviewChangesDialog (com.wikia.webdriver.pageobjectsfactory.componentobject.visualeditordialogs.VisualEditorReviewChangesDialog)9 RelatedIssue (com.wikia.webdriver.common.core.annotations.RelatedIssue)6 ArrayList (java.util.ArrayList)4 VisualEditorEditTemplateDialog (com.wikia.webdriver.pageobjectsfactory.componentobject.visualeditordialogs.VisualEditorEditTemplateDialog)3 VisualEditorOptionsDialog (com.wikia.webdriver.pageobjectsfactory.componentobject.visualeditordialogs.VisualEditorOptionsDialog)3 Execute (com.wikia.webdriver.common.core.annotations.Execute)2 ArticleContent (com.wikia.webdriver.common.core.api.ArticleContent)2 VisualEditorInsertTemplateDialog (com.wikia.webdriver.pageobjectsfactory.componentobject.visualeditordialogs.VisualEditorInsertTemplateDialog)2 WikiHistoryPageObject (com.wikia.webdriver.pageobjectsfactory.pageobject.wikipage.WikiHistoryPageObject)2 VisualEditorAddMapDialog (com.wikia.webdriver.pageobjectsfactory.componentobject.visualeditordialogs.VisualEditorAddMapDialog)1 VisualEditorAddMediaDialog (com.wikia.webdriver.pageobjectsfactory.componentobject.visualeditordialogs.VisualEditorAddMediaDialog)1 VisualEditorHyperLinkDialog (com.wikia.webdriver.pageobjectsfactory.componentobject.visualeditordialogs.VisualEditorHyperLinkDialog)1 WebElement (org.openqa.selenium.WebElement)1