// Create a class with two string properties
getUtil().addClassProperty("Test", "EditObjectsTestClass", "prop1", "String");
getUtil().addClassProperty("Test", "EditObjectsTestClass", "prop2", "String");
// Create object page
ViewPage vp = getUtil().createPage("Test", "EditObjectsTestObject",
"this is the content: {{velocity}}$doc.display('prop1')/$doc.display('prop2')/" +
"$!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());
// Delete the first property from the class
ClassEditPage cep = getUtil().editClass("Test", "EditObjectsTestClass");
cep.deleteProperty("prop1");
cep.clickSaveAndView();
vp = getUtil().gotoPage("Test", "EditObjectsTestObject");
Assert.assertEquals("this is the content: /testing value 2/testing value 1", vp.getContent());
oep = vp.editObjects();
Assert.assertNotNull(getDriver().findElement(By.className("deprecatedProperties")));
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());
}