use of org.xwiki.test.ui.po.ViewPage in project xwiki-platform by xwiki.
the class EditInlineTest method testInlineEditPreservesTitle.
/* See XWIKI-2389 */
@Test
@IgnoreBrowser(value = "internet.*", version = "9\\.*", reason = "See https://jira.xwiki.org/browse/XE-1177")
public void testInlineEditPreservesTitle() {
String title = RandomStringUtils.randomAlphanumeric(4);
getUtil().gotoPage(getTestClassName(), getTestMethodName(), "save", "title=" + title);
ViewPage vp = new ViewPage();
Assert.assertEquals(title, vp.getDocumentTitle());
InlinePage ip = vp.editInline();
ViewPage vp2 = ip.clickSaveAndView();
Assert.assertEquals(title, vp2.getDocumentTitle());
}
use of org.xwiki.test.ui.po.ViewPage in project xwiki-platform by xwiki.
the class EditInlineTest method testInlineEditPreservesParent.
/* See XWIKI-2389 */
@Test
public void testInlineEditPreservesParent() {
// Use the parentchild hierarchy mode to be able to assert the parent.
getUtil().setHierarchyMode("parentchild");
getUtil().gotoPage(getTestClassName(), getTestMethodName(), "save", "parent=Blog.WebHome");
ViewPage vp = new ViewPage();
Assert.assertTrue(vp.hasBreadcrumbContent("Blog", false));
InlinePage ip = vp.editInline();
ViewPage vp2 = ip.clickSaveAndView();
Assert.assertTrue(vp2.hasBreadcrumbContent("Blog", false));
// Now try the same in the default hierarchy mode, to make sure the default mode preserves the parent.
getUtil().setHierarchyMode("reference");
getUtil().gotoPage(getTestClassName(), getTestMethodName(), "edit", "editor=inline");
InlinePage ip2 = new InlinePage();
ip2.clickSaveAndView();
// Switch again to the parentchild hierarchy mode to be able to assert the parent.
getUtil().setHierarchyMode("parentchild");
ViewPage vp3 = getUtil().gotoPage(getTestClassName(), getTestMethodName());
Assert.assertTrue(vp3.hasBreadcrumbContent("Blog", false));
// Restore the hierarchy mode.
getUtil().setHierarchyMode("reference");
}
use of org.xwiki.test.ui.po.ViewPage in project xwiki-platform by xwiki.
the class EditInlineTest method testInlineEditCanChangeParent.
/* See XE-168 */
@Test
public void testInlineEditCanChangeParent() {
// Use the parentchild hierarchy mode to be able to assert the parent.
getUtil().setHierarchyMode("parentchild");
getUtil().gotoPage(getTestClassName(), getTestMethodName(), "edit", "editor=inline&parent=Main.SomeParent");
ViewPage vp = new InlinePage().clickSaveAndView();
// Check the new parent in the breadcrumbs.
Assert.assertTrue(vp.hasBreadcrumbContent("SomeParent", false));
// Restore the hierarchy mode.
getUtil().setHierarchyMode("reference");
}
Aggregations