Examples of ObjectEditPage


Examples of org.xwiki.test.ui.po.editor.ObjectEditPage

        wep = WikiEditPage.gotoPage("Test", "EditObjectsTestObject");
        wep.setContent("this is the content: {{velocity}}$doc.display('prop'){{/velocity}}");
        vp = wep.clickSaveAndView();

        // Add object
        ObjectEditPage oep = vp.editObjects();
        FormElement objectForm = oep.addObject("Test.EditObjectsTestClass");
        objectForm.setFieldValue(By.id("Test.EditObjectsTestClass_0_prop"), "this|that|other");
        vp = oep.clickSaveAndView();
        Assert.assertEquals("this is the content: this that other", vp.getContent());

        // Change list to relational storage.
        cep = ClassEditPage.gotoPage("Test", "EditObjectsTestClass");
        cep.getStaticListClassEditElement("prop").setRelationalStorage(true);
        vp = cep.clickSaveAndView();
        Assert.assertEquals("this is the content", vp.getContent());

        // Make sure we can still edit the object.
        oep = ObjectEditPage.gotoPage("Test", "EditObjectsTestObject");
        oep.getObjectsOfClass("Test.EditObjectsTestClass").get(0).setFieldValue(
            By.id("Test.EditObjectsTestClass_0_prop"), "this|other");
        vp = oep.clickSaveAndView();
        Assert.assertEquals("this is the content: this other", vp.getContent());

        // Change list to non-relational storage.
        cep = ClassEditPage.gotoPage("Test", "EditObjectsTestClass");
        cep.getStaticListClassEditElement("prop").setRelationalStorage(false);
        vp = cep.clickSaveAndView();
        Assert.assertEquals("this is the content", vp.getContent());

        // Make sure we can still edit the object.
        oep = ObjectEditPage.gotoPage("Test", "EditObjectsTestObject");
        oep.getObjectsOfClass("Test.EditObjectsTestClass").get(0).setFieldValue(
            By.id("Test.EditObjectsTestClass_0_prop"), "that|other");
        vp = oep.clickSaveAndView();
        Assert.assertEquals("this is the content: that other", vp.getContent());
    }
View Full Code Here

Examples of org.xwiki.test.ui.po.editor.ObjectEditPage

    @IgnoreBrowser(value = "internet.*", version = "8\\.*", reason="See http://jira.xwiki.org/browse/XE-1146"),
    @IgnoreBrowser(value = "internet.*", version = "9\\.*", reason="See http://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")));
    }
View Full Code Here

Examples of org.xwiki.test.ui.po.editor.ObjectEditPage

    }

    @Test
    public void testInlineObjectAddButton()
    {
        ObjectEditPage oep = ObjectEditPage.gotoPage("Test", "EditObjectsTestObject");
        oep.addObject("XWiki.XWikiUsers");
        oep.addObjectFromInlineLink("XWiki.XWikiUsers");
    }
View Full Code Here

Examples of org.xwiki.test.ui.po.editor.ObjectEditPage

        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());
    }
View Full Code Here

Examples of org.xwiki.test.ui.po.editor.ObjectEditPage

        // Create the sheet.
        getUtil().createPage(getTestClassName(), getTestMethodName() + "Sheet",
            "{{velocity}}$doc.display('color'){{/velocity}}", "");

        // Bind the class to the sheet.
        ObjectEditPage objectEditor = ObjectEditPage.gotoPage(getTestClassName(), getTestMethodName() + "Class");
        ObjectEditPane objectEditPane = objectEditor.addObject("XWiki.ClassSheetBinding");
        objectEditPane.setFieldValue(objectEditPane.byPropertyName("sheet"), getTestClassName() + "."
            + getTestMethodName() + "Sheet");
        objectEditor.clickSaveAndContinue();

        // Create the template.
        String classFullName = getTestClassName() + "." + getTestMethodName() + "Class";
        getUtil().deletePage(getTestClassName(), getTestMethodName() + "Template");
        objectEditor = ObjectEditPage.gotoPage(getTestClassName(), getTestMethodName() + "Template");
        objectEditPane = objectEditor.addObject(classFullName);
        objectEditPane.setFieldValue(objectEditPane.byPropertyName("color"), "red");
        objectEditor.clickSaveAndContinue();

        // Create the test instance.
        getUtil().deletePage(getTestClassName(), getTestMethodName());
        getUtil().gotoPage(getTestClassName(), getTestMethodName(), "edit",
            "template=" + getTestClassName() + "." + getTestMethodName() + "Template");
View Full Code Here
TOP
Copyright © 2018 www.massapi.com. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.