Search in sources :

Example 6 with ClassSheetPage

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"));
}
Also used : EntryEditPage(org.xwiki.appwithinminutes.test.po.EntryEditPage) LongTextClassFieldEditPane(org.xwiki.appwithinminutes.test.po.LongTextClassFieldEditPane) ClassFieldEditPane(org.xwiki.appwithinminutes.test.po.ClassFieldEditPane) ClassSheetPage(org.xwiki.xclass.test.po.ClassSheetPage) ViewPage(org.xwiki.test.ui.po.ViewPage) ApplicationClassEditPage(org.xwiki.appwithinminutes.test.po.ApplicationClassEditPage) IgnoreBrowsers(org.xwiki.test.ui.browser.IgnoreBrowsers) Test(org.junit.Test)

Aggregations

Test (org.junit.Test)6 ClassSheetPage (org.xwiki.xclass.test.po.ClassSheetPage)6 ApplicationClassEditPage (org.xwiki.appwithinminutes.test.po.ApplicationClassEditPage)4 IgnoreBrowsers (org.xwiki.test.ui.browser.IgnoreBrowsers)4 ViewPage (org.xwiki.test.ui.po.ViewPage)4 ClassFieldEditPane (org.xwiki.appwithinminutes.test.po.ClassFieldEditPane)3 EntryEditPage (org.xwiki.appwithinminutes.test.po.EntryEditPage)3 LongTextClassFieldEditPane (org.xwiki.appwithinminutes.test.po.LongTextClassFieldEditPane)3 InlinePage (org.xwiki.test.ui.po.InlinePage)2 WebElement (org.openqa.selenium.WebElement)1 UserClassFieldEditPane (org.xwiki.appwithinminutes.test.po.UserClassFieldEditPane)1 AbstractTest (org.xwiki.test.ui.AbstractTest)1 ClassEditPage (org.xwiki.test.ui.po.editor.ClassEditPage)1 ObjectEditPage (org.xwiki.test.ui.po.editor.ObjectEditPage)1 UserPicker (org.xwiki.test.ui.po.editor.UserPicker)1 UserElement (org.xwiki.test.ui.po.editor.UserPicker.UserElement)1 DataTypesPage (org.xwiki.xclass.test.po.DataTypesPage)1