Search in sources :

Example 1 with WYSIWYGEditPage

use of org.xwiki.test.ui.po.editor.WYSIWYGEditPage in project xwiki-platform by xwiki.

the class ViewPage method editSection.

public WYSIWYGEditPage editSection(int sectionNumber) {
    By sectionBy = By.xpath("//span[contains(@class, 'edit_section')][" + sectionNumber + "]/a");
    // Since Section Edit links are generated by JS (for XWiki Syntax 2.0) after the page has loaded make sure
    // we wait for them.
    getDriver().waitUntilElementIsVisible(sectionBy);
    getDriver().findElement(sectionBy).click();
    return new WYSIWYGEditPage();
}
Also used : WYSIWYGEditPage(org.xwiki.test.ui.po.editor.WYSIWYGEditPage) By(org.openqa.selenium.By) FindBy(org.openqa.selenium.support.FindBy)

Example 2 with WYSIWYGEditPage

use of org.xwiki.test.ui.po.editor.WYSIWYGEditPage in project xwiki-platform by xwiki.

the class EditWikiTest method testSwitchToWysiwygWithAdvancedContent.

/**
 * Tests that the warning about loosing some of the page content when switching to the WYSIWYG editor is not
 * displayed if the page syntax is xwiki/2.0.
 */
@Test
@IgnoreBrowsers({ @IgnoreBrowser(value = "internet.*", version = "8\\.*", reason = "See https://jira.xwiki.org/browse/XE-1146"), @IgnoreBrowser(value = "internet.*", version = "9\\.*", reason = "See https://jira.xwiki.org/browse/XE-1177") })
public void testSwitchToWysiwygWithAdvancedContent() {
    // Place some HTML in the page content.
    this.editPage.setContent("{{html}}<hr/>{{/html}}");
    // If we are asked to confirm the editor switch then we choose to remain on the wiki editor.
    getDriver().makeConfirmDialogSilent(false);
    // Switch to WYSIWYG editor.
    WYSIWYGEditPage wysiwygEditPage = this.editPage.editWYSIWYG();
    // Check that we are indeed in WYSIWYG edit mode.
    Assert.assertEquals(Editor.WYSIWYG, wysiwygEditPage.getEditor());
}
Also used : WYSIWYGEditPage(org.xwiki.test.ui.po.editor.WYSIWYGEditPage) IgnoreBrowsers(org.xwiki.test.ui.browser.IgnoreBrowsers) Test(org.junit.Test)

Aggregations

WYSIWYGEditPage (org.xwiki.test.ui.po.editor.WYSIWYGEditPage)2 Test (org.junit.Test)1 By (org.openqa.selenium.By)1 FindBy (org.openqa.selenium.support.FindBy)1 IgnoreBrowsers (org.xwiki.test.ui.browser.IgnoreBrowsers)1