Package org.xwiki.test.ui.po.editor

Examples of org.xwiki.test.ui.po.editor.ObjectEditPage.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.
        cep = ClassEditPage.gotoPage("Test", "EditObjectsTestClass");
        cep.getStaticListClassEditElement("prop").setMultiSelect(true);
View Full Code Here


        oep = ObjectEditPage.gotoPage("Test", "EditObjectsTestObject");
        oep.getObjectsOfClass("Test.EditObjectsTestClass").get(0).setFieldValue(
            By.id("Test.EditObjectsTestClass_0_prop"), "choice 3");
        oep.getObjectsOfClass("Test.EditObjectsTestClass").get(0).setFieldValue(
            By.id("Test.EditObjectsTestClass_0_prop"), "choice 4");
        vp = oep.clickSaveAndView();
        Assert.assertEquals("this is the content: choice 3 choice 4", vp.getContent());
    }

    /**
     * Prove that a list can be changed from relational storage to plain storage and back without database corruption.
View Full Code Here

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

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

        // 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());
    }

    @Test
    @IgnoreBrowsers({
View Full Code Here

        // 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

        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

        // 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());

        // Delete the first property from the class
        ClassEditPage cep = getUtil().editClass("Test", "EditObjectsTestClass");
View Full Code Here

        Assert.assertNotNull(getDriver().findElement(By.cssSelector(".deprecatedProperties label")));
        Assert.assertEquals("prop1:", getDriver().findElement(By.cssSelector(".deprecatedProperties label")).getText());

        // Remove deprecated properties
        oep.removeAllDeprecatedProperties();
        vp = oep.clickSaveAndView();
        Assert.assertEquals("this is the content: /testing value 2/", vp.getContent());
    }

    @Test
    public void addInvalidProperty()
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.