use of org.xwiki.test.ui.browser.IgnoreBrowsers 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());
}
use of org.xwiki.test.ui.browser.IgnoreBrowsers in project xwiki-platform by xwiki.
the class KeyboardShortcutsTest method testKeyboardShortcuts.
@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 testKeyboardShortcuts() {
ViewPage vp = getUtil().gotoPage("Sandbox", "WebHome");
// Test default edit mode (WYSIWYG for Sandbox.WebHome) key
vp.sendKeys("e");
// Test Cancel key
vp.sendKeys(Keys.chord(Keys.ALT, "c"));
vp.waitUntilPageIsLoaded();
Assert.assertTrue(getUtil().isInViewMode());
// Test Wiki edit key
vp.sendKeys("k");
vp.waitUntilPageIsLoaded();
Assert.assertTrue(getUtil().isInWikiEditMode());
// Test WYSIWYG edit mode key
vp = getUtil().gotoPage("Sandbox", "WebHome");
vp.sendKeys("g");
// Test Inline Form edit mode key
vp = getUtil().gotoPage("Sandbox", "WebHome");
vp.sendKeys("f");
vp.waitUntilPageIsLoaded();
Assert.assertTrue(getUtil().isInInlineEditMode());
// Test Rights edit mode key on a terminal document
vp = getUtil().gotoPage("Sandbox", "TestPage1");
vp.sendKeys("r");
vp.waitUntilPageIsLoaded();
Assert.assertTrue(getUtil().isInRightsEditMode());
// Test Rights edit mode key on a non terminal document
vp = getUtil().gotoPage("Sandbox", "WebHome");
vp.sendKeys("r");
vp.waitUntilPageIsLoaded();
Assert.assertTrue(getUtil().isInAdminMode());
AdministrationPage administrationPage = new AdministrationPage();
Assert.assertTrue(administrationPage.hasSection("PageRights"));
// Test Object edit mode key
vp = getUtil().gotoPage("Sandbox", "WebHome");
vp.sendKeys("o");
vp.waitUntilPageIsLoaded();
Assert.assertTrue(getUtil().isInObjectEditMode());
// Test Class edit mode key
vp = getUtil().gotoPage("Sandbox", "WebHome");
vp.sendKeys("s");
vp.waitUntilPageIsLoaded();
Assert.assertTrue(getUtil().isInClassEditMode());
// Test Delete key
vp = getUtil().gotoPage("Sandbox", "WebHome");
vp.sendKeys(Keys.DELETE);
vp.waitUntilPageIsLoaded();
Assert.assertTrue(getUtil().isInDeleteMode());
// Test Rename key
vp = getUtil().gotoPage("Sandbox", "WebHome");
vp.sendKeys(Keys.F2);
vp.waitUntilPageIsLoaded();
Assert.assertTrue(getUtil().isInRenameMode());
// Test View Source key
vp = getUtil().gotoPage("Sandbox", "WebHome");
vp.sendKeys("d");
vp.waitUntilPageIsLoaded();
Assert.assertTrue(getUtil().isInSourceViewMode());
}
use of org.xwiki.test.ui.browser.IgnoreBrowsers in project xwiki-platform by xwiki.
the class LoginTest method testRedirectPreservesPOSTParameters.
@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 testRedirectPreservesPOSTParameters() {
String test = "Test string " + System.currentTimeMillis();
final String space = "Main";
final String page = "POSTTest";
LoginPage loginPage = this.vp.login();
loginPage.loginAsAdmin();
// start editing a page
WikiEditPage editPage = WikiEditPage.gotoPage(space, page);
editPage.setTitle(test);
editPage.setContent(test);
// emulate expired session: delete the cookies
getDriver().manage().deleteAllCookies();
// try to save
editPage.clickSaveAndView();
// we should have been redirected to login
String wantUrl = getUtil().getURL("XWiki", "XWikiLogin", "login");
if (wantUrl.indexOf('?') > 0) {
// strip parameters
wantUrl = wantUrl.substring(0, wantUrl.indexOf('?'));
}
Assert.assertTrue(getDriver().getCurrentUrl().startsWith(wantUrl));
loginPage.loginAsAdmin();
// we should have been redirected back to view, and the page should have been saved
Assert.assertTrue(getDriver().getCurrentUrl().startsWith(getUtil().getURL(space, page)));
editPage = WikiEditPage.gotoPage(space, page);
Assert.assertEquals(test, editPage.getTitle());
Assert.assertEquals(test, editPage.getContent());
}
use of org.xwiki.test.ui.browser.IgnoreBrowsers in project xwiki-platform by xwiki.
the class LoginTest method testLoginWithInvalidCredentials.
@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 testLoginWithInvalidCredentials() {
LoginPage loginPage = this.vp.login();
loginPage.loginAs("Admin", "wrong password");
Assert.assertTrue(loginPage.hasInvalidCredentialsErrorMessage());
}
use of org.xwiki.test.ui.browser.IgnoreBrowsers in project xwiki-platform by xwiki.
the class VersionTest method testDeleteLatestVersion.
/**
* See XWIKI-8781
*/
@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 testDeleteLatestVersion() throws Exception {
getUtil().rest().deletePage(SPACE_NAME, PAGE_NAME);
// Create first version of the page
ViewPage vp = getUtil().createPage(SPACE_NAME, PAGE_NAME, CONTENT1, TITLE);
// Adds second version
WikiEditPage wikiEditPage = vp.editWiki();
wikiEditPage.setContent(CONTENT2);
wikiEditPage.clickSaveAndView();
// TODO: Remove when XWIKI-6688 (Possible race condition when clicking on a tab at the bottom of a page in
// view mode) is fixed.
vp.waitForDocExtraPaneActive("comments");
// Verify and delete the latest version.
HistoryPane historyTab = vp.openHistoryDocExtraPane();
Assert.assertEquals("2.1", historyTab.getCurrentVersion());
historyTab = historyTab.deleteVersion("2.1");
// Verify that the current version is now the previous one.
Assert.assertEquals("1.1", historyTab.getCurrentVersion());
Assert.assertEquals("Administrator", historyTab.getCurrentAuthor());
}
Aggregations