use of org.xwiki.xclass.test.po.ClassSheetPage in project xwiki-platform by xwiki.
the class ClassEditorTest method testRenameField.
/**
* Tests that class fields can be renamed.
*/
@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 testRenameField() {
// Add a class field.
editor.addField("Number").setDefaultValue("13");
// Save and edit the class template.
editor.clickSaveAndView();
new ClassSheetPage().clickTemplateLink().edit();
// Change the field value.
EntryEditPage inlineEditor = new EntryEditPage();
Assert.assertEquals("13", inlineEditor.getValue("number1"));
inlineEditor.setValue("number1", "27");
// Save and edit again the class.
inlineEditor.clickSaveAndView();
getUtil().gotoPage(getTestClassName(), getTestMethodName());
new ViewPage().edit();
// Rename the class field.
ClassFieldEditPane field = new ClassFieldEditPane("number1");
field.openConfigPanel();
field.setName("age");
// Save and edit again the class template.
new ApplicationClassEditPage().clickSaveAndView();
new ClassSheetPage().clickTemplateLink().edit();
Assert.assertEquals("27", new EntryEditPage().getValue("age"));
}
Aggregations