use of org.xwiki.test.ui.browser.IgnoreBrowsers in project xwiki-platform by xwiki.
the class VersionTest method testRollbackToFirstVersion.
@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 testRollbackToFirstVersion() 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 that we can rollback to the first version
HistoryPane historyTab = vp.openHistoryDocExtraPane();
vp = historyTab.rollbackToVersion("1.1");
// Rollback doesn't wait...
// Wait for the comment tab to be selected since we're currently on the history tab and rolling
// back is going to load a new page and make the focus active on the comments tab.
vp.waitForDocExtraPaneActive("comments");
Assert.assertEquals("First version of Content", vp.getContent());
historyTab = vp.openHistoryDocExtraPane();
Assert.assertEquals("Rollback to version 1.1", historyTab.getCurrentVersionComment());
Assert.assertEquals("Administrator", historyTab.getCurrentAuthor());
}
use of org.xwiki.test.ui.browser.IgnoreBrowsers in project xwiki-platform by xwiki.
the class AddEntryTest method testEntryNameWithURLSpecialCharacters.
/**
* Tests that entry name is URL encoded.
*/
@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 testEntryNameWithURLSpecialCharacters() {
EntryNamePane entryNamePane = homePage.clickAddNewEntry();
String entryName = "A?b=c&d#" + RandomStringUtils.randomAlphanumeric(3);
entryNamePane.setName(entryName);
EntryEditPage entryEditPage = entryNamePane.clickAdd();
entryEditPage.setValue("description", "This is a test panel.");
entryEditPage.clickSaveAndView();
getUtil().gotoPage(getTestClassName(), getTestMethodName());
homePage = new ApplicationHomePage();
LiveTableElement entriesLiveTable = homePage.getEntriesLiveTable();
entriesLiveTable.waitUntilReady();
// The column header is not translated because we haven't generated the document translation bundle.
Assert.assertTrue(entriesLiveTable.hasRow("panel.livetable.doc.title", entryName));
}
use of org.xwiki.test.ui.browser.IgnoreBrowsers in project xwiki-platform by xwiki.
the class ApplicationNameTest method testEmptyAppNameWithNextStepButton.
/**
* Try to create an application with an empty name using the next step button.
*/
@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 testEmptyAppNameWithNextStepButton() {
ApplicationCreatePage appCreatePage = ApplicationCreatePage.gotoPage();
Assert.assertFalse(appCreatePage.getContent().contains(EMPTY_APP_NAME_ERROR_MESSAGE));
// Try to move to the next step without typing the application name.
String urlBeforeClick = getDriver().getCurrentUrl();
appCreatePage.clickNextStepButton();
Assert.assertEquals(urlBeforeClick, getDriver().getCurrentUrl());
// Type the application name.
appCreatePage.setApplicationName("A");
appCreatePage.waitForApplicationNamePreview();
Assert.assertFalse(appCreatePage.getContent().contains(EMPTY_APP_NAME_ERROR_MESSAGE));
// Clear the application name using the Backspace key.
appCreatePage.getApplicationNameInput().sendKeys(Keys.BACK_SPACE);
appCreatePage.waitForApplicationNameError();
Assert.assertTrue(appCreatePage.getContent().contains(EMPTY_APP_NAME_ERROR_MESSAGE));
// Try to create the application even if the error message is displayed.
urlBeforeClick = getDriver().getCurrentUrl();
appCreatePage.clickNextStepButton();
Assert.assertEquals(urlBeforeClick, getDriver().getCurrentUrl());
// Fix the application name and move to the next step.
appCreatePage.setApplicationName(getTestMethodName());
appCreatePage.waitForApplicationNamePreview();
Assert.assertEquals(getTestMethodName() + " Structure", appCreatePage.clickNextStep().getDocumentTitle());
}
use of org.xwiki.test.ui.browser.IgnoreBrowsers in project xwiki-platform by xwiki.
the class ApplicationNameTest method testEmptyAppNameWithEnter.
/**
* Try to create an application with an empty name using the Enter key.
*/
@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 testEmptyAppNameWithEnter() {
ApplicationCreatePage appCreatePage = ApplicationCreatePage.gotoPage();
Assert.assertFalse(appCreatePage.getContent().contains(EMPTY_APP_NAME_ERROR_MESSAGE));
// Press Enter key without typing the application name.
appCreatePage.getApplicationNameInput().sendKeys(Keys.RETURN);
appCreatePage.waitForApplicationNameError();
Assert.assertTrue(appCreatePage.getContent().contains(EMPTY_APP_NAME_ERROR_MESSAGE));
// Type the application name.
appCreatePage.setApplicationName("B");
appCreatePage.waitForApplicationNamePreview();
Assert.assertFalse(appCreatePage.getContent().contains(EMPTY_APP_NAME_ERROR_MESSAGE));
// Clear the application name using the Backspace key.
appCreatePage.getApplicationNameInput().sendKeys(Keys.BACK_SPACE);
appCreatePage.waitForApplicationNameError();
Assert.assertTrue(appCreatePage.getContent().contains(EMPTY_APP_NAME_ERROR_MESSAGE));
// Try to create the application even if the error message is displayed.
appCreatePage.getApplicationNameInput().sendKeys(Keys.RETURN);
Assert.assertTrue(appCreatePage.getContent().contains(EMPTY_APP_NAME_ERROR_MESSAGE));
// Fix the application name and move to the next step using the Enter key.
appCreatePage.setApplicationName(getTestMethodName());
appCreatePage.waitForApplicationNamePreview();
appCreatePage.getApplicationNameInput().sendKeys(Keys.RETURN);
Assert.assertEquals(getTestMethodName() + " Structure", new ViewPage().getDocumentTitle());
}
use of org.xwiki.test.ui.browser.IgnoreBrowsers in project xwiki-platform by xwiki.
the class AppsLiveTableTest method testActionRights.
/**
* Tests that the actions are displayed only when the current user has the right to perform them.
*/
@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 testActionRights() {
// Create the application.
String appName = RandomStringUtils.randomAlphabetic(6);
createApplication(appName);
// The application author should be able to edit and delete the application.
ApplicationsLiveTableElement appsLiveTable = homePage.getAppsLiveTable();
appsLiveTable.waitUntilReady();
appsLiveTable.filterApplicationName(appName);
Assert.assertTrue(appsLiveTable.canEditApplication(appName));
Assert.assertTrue(appsLiveTable.canDeleteApplication(appName));
// Logout. Guests shouldn't be able to edit nor delete the application.
homePage.logout();
getUtil().recacheSecretToken();
homePage = new AppWithinMinutesHomePage();
appsLiveTable = homePage.getAppsLiveTable();
appsLiveTable.waitUntilReady();
appsLiveTable.filterApplicationName(appName);
Assert.assertFalse(appsLiveTable.canEditApplication(appName));
Assert.assertFalse(appsLiveTable.canDeleteApplication(appName));
// Login with a different user. The new user shouldn't be able to delete the application.
getUtil().createUserAndLogin("someOtherUser", "somePassword");
appsLiveTable = AppWithinMinutesHomePage.gotoPage().getAppsLiveTable();
appsLiveTable.waitUntilReady();
appsLiveTable.filterApplicationName(appName);
Assert.assertTrue(appsLiveTable.canEditApplication(appName));
Assert.assertFalse(appsLiveTable.canDeleteApplication(appName));
}
Aggregations