Search in sources :

Example 6 with InlinePage

use of org.xwiki.test.ui.po.InlinePage 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");
}
Also used : InlinePage(org.xwiki.test.ui.po.InlinePage) ViewPage(org.xwiki.test.ui.po.ViewPage) Test(org.junit.Test)

Example 7 with InlinePage

use of org.xwiki.test.ui.po.InlinePage 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");
}
Also used : InlinePage(org.xwiki.test.ui.po.InlinePage) ViewPage(org.xwiki.test.ui.po.ViewPage) Test(org.junit.Test)

Aggregations

Test (org.junit.Test)7 InlinePage (org.xwiki.test.ui.po.InlinePage)7 ViewPage (org.xwiki.test.ui.po.ViewPage)5 ClassEditPage (org.xwiki.test.ui.po.editor.ClassEditPage)2 ClassSheetPage (org.xwiki.xclass.test.po.ClassSheetPage)2 WebElement (org.openqa.selenium.WebElement)1 UserClassFieldEditPane (org.xwiki.appwithinminutes.test.po.UserClassFieldEditPane)1 LocalDocumentReference (org.xwiki.model.reference.LocalDocumentReference)1 AbstractTest (org.xwiki.test.ui.AbstractTest)1 IgnoreBrowser (org.xwiki.test.ui.browser.IgnoreBrowser)1 ObjectEditPage (org.xwiki.test.ui.po.editor.ObjectEditPage)1 ObjectEditPane (org.xwiki.test.ui.po.editor.ObjectEditPane)1 PreviewEditPage (org.xwiki.test.ui.po.editor.PreviewEditPage)1 PreviewableEditPage (org.xwiki.test.ui.po.editor.PreviewableEditPage)1 UserPicker (org.xwiki.test.ui.po.editor.UserPicker)1 UserElement (org.xwiki.test.ui.po.editor.UserPicker.UserElement)1 DataTypesPage (org.xwiki.xclass.test.po.DataTypesPage)1