use of org.xwiki.test.ui.po.editor.ObjectEditPage in project xwiki-platform by xwiki.
the class NotificationsIT method testNotificationDisplayerClass.
@Test
public void testNotificationDisplayerClass() throws Exception {
// Create the pages and a custom displayer for "update" events
getUtil().login(SUPERADMIN_USER_NAME, SUPERADMIN_PASSWORD);
getUtil().gotoPage(getTestClassName(), "WebHome");
getUtil().createPage(getTestClassName(), "ARandomPageThatShouldBeModified", "Page used for the tests of the NotificationDisplayerClass XObject.", "Test page");
getUtil().createPage(getTestClassName(), "NotificationDisplayerClassTest", "Page used for the tests of the NotificationDisplayerClass XObject.", "Test page 2");
Map<String, String> notificationDisplayerParameters = new HashMap<String, String>() {
{
put("XWiki.Notifications.Code.NotificationDisplayerClass_0_eventType", "update");
put("XWiki.Notifications.Code.NotificationDisplayerClass_0_notificationTemplate", "This is a test template");
}
};
ObjectEditPage editObjects = getUtil().editObjects(getTestClassName(), "NotificationDisplayerClassTest");
editObjects.addObject("XWiki.Notifications.Code.NotificationDisplayerClass");
editObjects.getObjectsOfClass("XWiki.Notifications.Code.NotificationDisplayerClass").get(0).fillFieldsByName(notificationDisplayerParameters);
editObjects.clickSaveAndContinue(true);
// Login as first user, and enable notifications on document updates
getUtil().login(FIRST_USER_NAME, FIRST_USER_PASSWORD);
NotificationsUserProfilePage p = NotificationsUserProfilePage.gotoPage(FIRST_USER_NAME);
p.getApplication(SYSTEM).setCollapsed(false);
p.setEventTypeState(SYSTEM, UPDATE, ALERT_FORMAT, BootstrapSwitch.State.ON);
// Login as second user and modify ARandomPageThatShouldBeModified
getUtil().login(SECOND_USER_NAME, SECOND_USER_PASSWORD);
ViewPage viewPage = getUtil().gotoPage(getTestClassName(), "ARandomPageThatShouldBeModified");
viewPage.edit();
WikiEditPage editPage = new WikiEditPage();
editPage.setContent("Something");
editPage.clickSaveAndView(true);
// Login as the first user, ensure that the notification is displayed with a custom template
getUtil().login(FIRST_USER_NAME, FIRST_USER_PASSWORD);
getUtil().gotoPage(getTestClassName(), "WebHome");
NotificationsTrayPage tray = new NotificationsTrayPage();
assertEquals("This is a test template", tray.getNotificationRawContent(0));
}
use of org.xwiki.test.ui.po.editor.ObjectEditPage in project xwiki-platform by xwiki.
the class RepositoryTest method getNumberOfExtensionVersionsObjects.
private int getNumberOfExtensionVersionsObjects(String extensionName) {
ObjectEditPage objectEditPage = goToObjectEditPage(extensionName);
List<ObjectEditPane> versionObjects = objectEditPage.getObjectsOfClass(XWikiRepositoryModel.EXTENSIONVERSION_CLASSNAME);
return versionObjects.size();
}
use of org.xwiki.test.ui.po.editor.ObjectEditPage in project xwiki-platform by xwiki.
the class RepositoryTest method getNumberOfExtensionVersionsDependenciesObjects.
private int getNumberOfExtensionVersionsDependenciesObjects(String extensionName) {
ObjectEditPage objectEditPage = goToObjectEditPage(extensionName);
List<ObjectEditPane> dependenciesObjects = objectEditPage.getObjectsOfClass(XWikiRepositoryModel.EXTENSIONDEPENDENCY_CLASSNAME);
return dependenciesObjects.size();
}
use of org.xwiki.test.ui.po.editor.ObjectEditPage in project xwiki-platform by xwiki.
the class RepositoryTestUtils method gotoExtensionObjectsEditPage.
/**
* @since 9.5RC1
*/
public ObjectEditPage gotoExtensionObjectsEditPage(String extensionName) {
LocalDocumentReference extensionPageReference = getExtensionPageReference(extensionName);
testUtils.gotoPage(extensionPageReference, "edit", Collections.singletonMap("editor", "object"));
return new ObjectEditPage();
}
use of org.xwiki.test.ui.po.editor.ObjectEditPage in project xwiki-platform by xwiki.
the class ApplicationsPanelAdministrationTest method createApplicationUIX.
private void createApplicationUIX(String applicationName) {
getUtil().deletePage(new LocalDocumentReference(Arrays.asList("Apps", applicationName), "WebHome"));
ViewPage page = getUtil().gotoPage("Apps", applicationName);
ObjectEditPage editPage = page.editObjects();
ObjectEditPane object = editPage.addObject("XWiki.UIExtensionClass");
fillField(object, "extensionPointId", "org.xwiki.platform.panels.Applications");
fillField(object, "name", applicationName);
fillField(object, "parameters", String.format("label=%s\ntarget=Apps.%s\nicon=icon:home", applicationName, applicationName));
editPage.clickSaveAndView();
}
Aggregations