Package org.xwiki.test.ui.framework.elements.editor

Examples of org.xwiki.test.ui.framework.elements.editor.ObjectEditPage.addObject()


        wep.setContent("this is the content");
        ViewPage vp = wep.clickSaveAndView();

        // Add an XWikiGroups object
        ObjectEditPage oep = vp.editObjects();
        oep.addObject("XWiki.XWikiGroups");
        vp = oep.clickSaveAndView();

        oep = vp.editObjects();
        Assert.assertEquals(1, oep.getObjectsOfClass("XWiki.XWikiGroups").size());
    }
View Full Code Here


        wep.setContent("this is the content");
        ViewPage vp = wep.clickSaveAndView();

        // Add an object of the class created and set the value to be the test page
        ObjectEditPage oep = vp.editObjects();
        FormElement objectForm = oep.addObject("Test.EditObjectsTestClass");
        objectForm.setFieldValue(By.id("Test.EditObjectsTestClass_0_prop"), "Test.EditObjectsTestClass");
        oep.clickSaveAndView();

        // Set multiselect to true
        cep = new ClassEditPage();
View Full Code Here

        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"), "3");
        vp = oep.clickSaveAndView();
        Assert.assertEquals("this is the content: 3", vp.getContent());

        // Change number to double type
View Full Code Here

        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"), "choice 3");
        vp = oep.clickSaveAndView();
        Assert.assertEquals("this is the content: choice 3", vp.getContent());

        // Change list to a multiple select.
View Full Code Here

        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.
View Full Code Here

    @Test
    public void testObjectAddAndRemove()
    {
        ObjectEditPage oep = new ObjectEditPage();
        oep.switchToEdit("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");
View Full Code Here

        oep.switchToEdit("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")));
View Full Code Here

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

        ViewPage vp = getUtil().createPage("Test", "EditObjectsTestObject",
            "this is the content: {{velocity}}$doc.display('prop'){{/velocity}}", getTestMethodName());

        // Add an object of the class created
        ObjectEditPage oep = vp.editObjects();
        FormElement objectForm = oep.addObject("Test.EditObjectsTestClass");
        objectForm.setFieldValue(By.id("Test.EditObjectsTestClass_0_prop"), "testing value");
        vp = oep.clickSaveAndView();

        Assert.assertEquals("this is the content: testing value", vp.getContent());
    }
View Full Code Here

            "$!doc.getObject('Test.EditObjectsTestClass').getProperty('prop1').value{{/velocity}}",
            getTestMethodName());

        // Add an object of the class created
        ObjectEditPage oep = vp.editObjects();
        FormElement objectForm = oep.addObject("Test.EditObjectsTestClass");
        objectForm.setFieldValue(By.id("Test.EditObjectsTestClass_0_prop1"), "testing value 1");
        objectForm.setFieldValue(By.id("Test.EditObjectsTestClass_0_prop2"), "testing value 2");
        vp = oep.clickSaveAndView();

        Assert.assertEquals("this is the content: testing value 1/testing value 2/testing value 1", vp.getContent());
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.