Search in sources :

Example 1 with WikiArticleEditMode

use of com.wikia.webdriver.pageobjectsfactory.pageobject.wikipage.editmode.WikiArticleEditMode in project selenium-tests by Wikia.

the class InteractiveMapPageObject method openEmbedMapPageEdit.

public WikiArticleEditMode openEmbedMapPageEdit(String wikiURL) {
    ArticlePageObject article = new ArticlePageObject();
    article.navigateToArticleEditPage(wikiURL, URLsContent.EMBEDED_MAP_ARTICLE);
    return new WikiArticleEditMode();
}
Also used : ArticlePageObject(com.wikia.webdriver.pageobjectsfactory.pageobject.article.ArticlePageObject) WikiArticleEditMode(com.wikia.webdriver.pageobjectsfactory.pageobject.wikipage.editmode.WikiArticleEditMode)

Example 2 with WikiArticleEditMode

use of com.wikia.webdriver.pageobjectsfactory.pageobject.wikipage.editmode.WikiArticleEditMode in project selenium-tests by Wikia.

the class SpecialCreatePage method addPageWithGivenTitleAndDefaultContent.

public void addPageWithGivenTitleAndDefaultContent(String title) {
    populateTitleField(title);
    WikiArticleEditMode article = new WikiArticleEditMode();
    article.typeInContent(PageContent.ARTICLE_TEXT);
    article.clickOnPublish();
}
Also used : WikiArticleEditMode(com.wikia.webdriver.pageobjectsfactory.pageobject.wikipage.editmode.WikiArticleEditMode)

Example 3 with WikiArticleEditMode

use of com.wikia.webdriver.pageobjectsfactory.pageobject.wikipage.editmode.WikiArticleEditMode in project selenium-tests by Wikia.

the class ArticleRTETest method ArticleRTETest_001.

@Test(dataProvider = "wikiTextsProvider", groups = { "RTE" })
public void ArticleRTETest_001(String[] wikiTexts) {
    WikiArticleEditMode edit = new WikiArticleEditMode();
    edit.editArticleByName("RTE_test_page", wikiURL);
    edit.clickOnSourceButton();
    for (String wikitext : wikiTexts) {
        String tmp1;
        String tmp2;
        edit.clearSource();
        WebElement e = driver.findElement(By.cssSelector(".cke_source"));
        e.sendKeys(wikitext);
        edit.clickOnVisualButton();
        edit.clickOnSourceButton();
        e = driver.findElement(By.cssSelector(".cke_source"));
        ;
        if (Assertion.assertStringContains(e.getAttribute("value"), wikitext)) {
            tmp1 = e.getAttribute("value").replace("<", "&lt");
            tmp1.replace(">", "&gt");
            PageObjectLogging.log("checking value passed", "<pre>" + e.getAttribute("value") + "</pre>", true);
        } else {
            tmp1 = e.getAttribute("value").replace("<", "&lt;");
            tmp1 = tmp1.replace(">", "&gt;");
            tmp1 = tmp1.replace(" ", "&nbsp;");
            tmp2 = wikitext.replace("<", "&lt;");
            tmp2 = tmp2.replace(">", "&gt;");
            tmp2 = tmp2.replace(" ", "&nbsp;");
            PageObjectLogging.log("checking value failed", "should be: <pre>" + tmp2 + "</pre>", false);
            PageObjectLogging.log("checking value failed", "result is: <pre>" + tmp1 + "</pre>", false, driver);
        }
    }
    edit.clickOnVisualButton();
    edit.clickOnPublishButton();
}
Also used : WikiArticleEditMode(com.wikia.webdriver.pageobjectsfactory.pageobject.wikipage.editmode.WikiArticleEditMode) WebElement(org.openqa.selenium.WebElement) Test(org.testng.annotations.Test)

Example 4 with WikiArticleEditMode

use of com.wikia.webdriver.pageobjectsfactory.pageobject.wikipage.editmode.WikiArticleEditMode in project selenium-tests by Wikia.

the class EmbedMapTests method EmbedMapTests_001_EmbedMapInWikiaPage.

@Test(enabled = false, groups = { "EmbedMapTests_001", "EmbedMapTests", "InteractiveMaps" })
@Execute(asUser = User.USER)
public void EmbedMapTests_001_EmbedMapInWikiaPage() {
    WikiBasePageObject base = new WikiBasePageObject();
    InteractiveMapsPageObject specialMap = base.openSpecialInteractiveMaps(wikiURL);
    InteractiveMapPageObject selectedMap = specialMap.clickMapWithIndex(InteractiveMapsContent.SELECTED_MAP_INDEX);
    selectedMap.verifyMapOpened();
    String wikiEmbedCode = selectedMap.getEmbedMapWikiCode();
    String mapID = selectedMap.getEmbedMapID();
    WikiArticleEditMode editMode = selectedMap.openEmbedMapPageEdit(wikiURL);
    editMode.clickSourceButton();
    editMode.clearSource();
    editMode.verifySourceEditorContentIsEmpty();
    editMode.typeContentInSourceMode(wikiEmbedCode);
    editMode.clickOnPublish();
    editMode.verifyEmbededMap(mapID);
}
Also used : InteractiveMapPageObject(com.wikia.webdriver.pageobjectsfactory.pageobject.special.interactivemaps.InteractiveMapPageObject) WikiArticleEditMode(com.wikia.webdriver.pageobjectsfactory.pageobject.wikipage.editmode.WikiArticleEditMode) WikiBasePageObject(com.wikia.webdriver.pageobjectsfactory.pageobject.WikiBasePageObject) InteractiveMapsPageObject(com.wikia.webdriver.pageobjectsfactory.pageobject.special.interactivemaps.InteractiveMapsPageObject) Execute(com.wikia.webdriver.common.core.annotations.Execute) Test(org.testng.annotations.Test)

Aggregations

WikiArticleEditMode (com.wikia.webdriver.pageobjectsfactory.pageobject.wikipage.editmode.WikiArticleEditMode)4 Test (org.testng.annotations.Test)2 Execute (com.wikia.webdriver.common.core.annotations.Execute)1 WikiBasePageObject (com.wikia.webdriver.pageobjectsfactory.pageobject.WikiBasePageObject)1 ArticlePageObject (com.wikia.webdriver.pageobjectsfactory.pageobject.article.ArticlePageObject)1 InteractiveMapPageObject (com.wikia.webdriver.pageobjectsfactory.pageobject.special.interactivemaps.InteractiveMapPageObject)1 InteractiveMapsPageObject (com.wikia.webdriver.pageobjectsfactory.pageobject.special.interactivemaps.InteractiveMapsPageObject)1 WebElement (org.openqa.selenium.WebElement)1