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

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


        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


        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");
        objectEditPane = new ObjectEditPane(new InlinePage().getForm(), classFullName, 0);
        objectEditPane.setFieldValue(objectEditPane.byPropertyName("color"), "green");

        // Test the preview when the page is not yet saved.
        PreviewableEditPage editPage = new PreviewableEditPage();
        PreviewEditPage previewPage = editPage.clickPreview();
        assertEquals("green", previewPage.getContent());
View Full Code Here

TOP

Related Classes of org.xwiki.test.ui.po.editor.ObjectEditPane

Copyright © 2018 www.massapicom. 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.