use of org.xwiki.test.ui.po.editor.ObjectEditPane 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.ObjectEditPane 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.ObjectEditPane 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();
}
use of org.xwiki.test.ui.po.editor.ObjectEditPane in project xwiki-platform by xwiki.
the class EditObjectsTest method testObjectAddAndRemove.
@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 testObjectAddAndRemove() {
ObjectEditPage oep = ObjectEditPage.gotoPage("Test", "EditObjectsTestObject");
FormElement object = oep.addObject("XWiki.XWikiUsers");
object.setFieldValue(By.id("XWiki.XWikiUsers_0_first_name"), "John");
// Add another object
FormElement object2 = oep.addObject("XWiki.XWikiUsers");
// Check that the unsaved value from the first object wasn't lost
Assert.assertEquals("John", object.getFieldValue(By.id("XWiki.XWikiUsers_0_first_name")));
// Check that the value from the second object is unset
Assert.assertEquals("", object2.getFieldValue(By.id("XWiki.XWikiUsers_1_first_name")));
// Delete the second object
oep.deleteObject("XWiki.XWikiUsers", 1);
// Let's save the form and check that changes were persisted.
oep = oep.clickSaveAndView().editObjects();
List<ObjectEditPane> xwikiUsersForms = oep.getObjectsOfClass("XWiki.XWikiUsers");
Assert.assertEquals(1, xwikiUsersForms.size());
Assert.assertEquals("John", xwikiUsersForms.get(0).getFieldValue(By.id("XWiki.XWikiUsers_0_first_name")));
}
use of org.xwiki.test.ui.po.editor.ObjectEditPane in project xwiki-platform by xwiki.
the class EditObjectsTest method testPropertyDisplayersForNewObjects.
/**
* @see <a href="https://jira.xwiki.org/browse/XWIKI-9061">XWIKI-9061</a>: Property displayers don't work in the
* object editor for objects that have just been added
*/
@Test
public void testPropertyDisplayersForNewObjects() throws Exception {
getUtil().rest().deletePage(getTestClassName(), getTestMethodName());
// Create a class with two properties: a date and a list of users.
ClassEditPage classEditor = ClassEditPage.gotoPage(getTestClassName(), getTestMethodName());
classEditor.addProperty("date", "Date");
classEditor.addProperty("author", "Users");
// Add an object of this class and set its properties.
String className = getTestClassName() + "." + getTestMethodName();
ObjectEditPage objectEditor = ObjectEditPage.gotoPage(getTestClassName(), getTestMethodName());
ObjectEditPane object = objectEditor.addObject(className);
object.openDatePicker("date").setDay("15");
object.getUserPicker("author").sendKeys("ad").waitForSuggestions().select("Admin");
// Save, edit again and check the values.
object = objectEditor.clickSaveAndView().editObjects().getObjectsOfClass(className).get(0);
Assert.assertEquals("15", object.openDatePicker("date").getDay());
Assert.assertEquals("Administrator", object.getUserPicker("author").waitToLoad().getAcceptedSuggestions().get(0).getName());
}
Aggregations