Search in sources :

Example 1 with VisualEditorHyperLinkDialog

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

the class VisualEditorEditingTests method VisualEditorEditing_004_insertLinks.

@Test(groups = { "VisualEditorLinks", "VisualEditorEditing_004" })
public void VisualEditorEditing_004_insertLinks() {
    String articleName2 = PageContent.ARTICLE_NAME_PREFIX + base.getTimeStamp();
    ArrayList<String> linkWikiTexts = new ArrayList<>();
    linkWikiTexts.add(WikiTextContent.BLUELINK_TEXT);
    linkWikiTexts.add(WikiTextContent.REDLINK_TEXT);
    linkWikiTexts.add(WikiTextContent.EXTERNAL_LINK_TEXT);
    base.loginAs(credentials.userNameVEPreferred, credentials.passwordVEPreferred, wikiURL);
    VisualEditorPageObject ve = base.openVEOnArticle(wikiURL, articleName2);
    ve.verifyVEToolBarPresent();
    ve.verifyEditorSurfacePresent();
    VisualEditorHyperLinkDialog veLinkDialog = ve.clickLinkButton();
    veLinkDialog.typeInLinkInput(PageContent.INTERNAL_LINK);
    veLinkDialog.verifyMatchingPageIsTop();
    veLinkDialog.clickLinkResult();
    ve = veLinkDialog.clickDoneButton();
    ve.typeReturn();
    veLinkDialog = ve.clickLinkButton();
    veLinkDialog.typeInLinkInput(PageContent.REDLINK);
    veLinkDialog.verifyNewPageIsTop();
    veLinkDialog.clickLinkResult();
    ve = veLinkDialog.clickDoneButton();
    ve.typeReturn();
    veLinkDialog = ve.clickLinkButton();
    veLinkDialog.typeInLinkInput(PageContent.EXTERNAL_LINK);
    veLinkDialog.verifyExternalLinkIsTop();
    veLinkDialog.clickLinkResult();
    ve = veLinkDialog.clickDoneButton();
    ve.typeReturn();
    VisualEditorSaveChangesDialog saveDialog = ve.clickPublishButton();
    VisualEditorReviewChangesDialog reviewDialog = saveDialog.clickReviewYourChanges();
    reviewDialog.verifyAddedDiffs(linkWikiTexts);
    saveDialog = reviewDialog.clickReturnToSaveFormButton();
    ArticlePageObject article = saveDialog.savePage();
    article.verifyVEPublishComplete();
    article.verifyElementInContent(By.cssSelector("a[href*='" + PageContent.INTERNAL_LINK + "']"));
    article.verifyElementInContent(By.cssSelector("a.new[href*='" + PageContent.REDLINK + "']"));
    article.verifyElementInContent(By.cssSelector("a.external[href*='" + PageContent.EXTERNAL_LINK + "']"));
}
Also used : 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) VisualEditorHyperLinkDialog(com.wikia.webdriver.pageobjectsfactory.componentobject.visualeditordialogs.VisualEditorHyperLinkDialog) VisualEditorSaveChangesDialog(com.wikia.webdriver.pageobjectsfactory.componentobject.visualeditordialogs.VisualEditorSaveChangesDialog) Test(org.testng.annotations.Test)

Aggregations

VisualEditorHyperLinkDialog (com.wikia.webdriver.pageobjectsfactory.componentobject.visualeditordialogs.VisualEditorHyperLinkDialog)1 VisualEditorReviewChangesDialog (com.wikia.webdriver.pageobjectsfactory.componentobject.visualeditordialogs.VisualEditorReviewChangesDialog)1 VisualEditorSaveChangesDialog (com.wikia.webdriver.pageobjectsfactory.componentobject.visualeditordialogs.VisualEditorSaveChangesDialog)1 ArticlePageObject (com.wikia.webdriver.pageobjectsfactory.pageobject.article.ArticlePageObject)1 VisualEditorPageObject (com.wikia.webdriver.pageobjectsfactory.pageobject.visualeditor.VisualEditorPageObject)1 ArrayList (java.util.ArrayList)1 Test (org.testng.annotations.Test)1