// Create the test page.
testPage = getUtil().createPage(getTestClassName(), pageName, "one\ntwo\nthree", "Test");
// Change the content and the meta data.
WikiEditPage wikiEditPage = testPage.editWiki();
wikiEditPage.setContent("one\n**two**\nfour");
wikiEditPage.setTitle("Compare verSions test");
wikiEditPage.setParent("Sandbox.WebHome");
wikiEditPage.setEditComment("Changed content and meta data.");
wikiEditPage.clickSaveAndContinue();
wikiEditPage.setTitle("Compare versions test");
wikiEditPage.setMinorEdit(true);
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");