wikiEditPage.setEditComment("Fix typo in title.");
wikiEditPage.clickSaveAndContinue();
// Add objects.
ObjectEditPage objectEditPage = wikiEditPage.editObjects();
FormElement form = objectEditPage.addObject("XWiki.JavaScriptExtension");
Map<String, String> assignment = new HashMap<String, String>();
assignment.put("XWiki.JavaScriptExtension_0_name", "JavaScript code");
assignment.put("XWiki.JavaScriptExtension_0_code", "var tmp = alice;\nalice = bob;\nbob = tmp;");
assignment.put("XWiki.JavaScriptExtension_0_use", "onDemand");
form.fillFieldsByName(assignment);
objectEditPage.clickSaveAndContinue();
assignment.put("XWiki.JavaScriptExtension_0_name", "Code snippet");
assignment.put("XWiki.JavaScriptExtension_0_code", "var tmp = alice;\nalice = 2 * bob;\nbob = tmp;");
form.fillFieldsByName(assignment);
objectEditPage.clickSaveAndContinue();
// Create class.
ClassEditPage classEditPage = objectEditPage.editClass();
classEditPage.addProperty("age", "Number");