Search in sources :

Example 91 with ViewPage

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

Example 92 with ViewPage

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

Example 93 with ViewPage

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

Aggregations

ViewPage (org.xwiki.test.ui.po.ViewPage)93 Test (org.junit.Test)75 AbstractTest (org.xwiki.test.ui.AbstractTest)41 IgnoreBrowsers (org.xwiki.test.ui.browser.IgnoreBrowsers)26 WikiEditPage (org.xwiki.test.ui.po.editor.WikiEditPage)18 ObjectEditPage (org.xwiki.test.ui.po.editor.ObjectEditPage)11 IgnoreBrowser (org.xwiki.test.ui.browser.IgnoreBrowser)10 DocumentReference (org.xwiki.model.reference.DocumentReference)8 CreatePagePage (org.xwiki.test.ui.po.CreatePagePage)8 FormElement (org.xwiki.test.ui.po.FormElement)7 HistoryPane (org.xwiki.test.ui.po.HistoryPane)7 ClassEditPage (org.xwiki.test.ui.po.editor.ClassEditPage)7 WebElement (org.openqa.selenium.WebElement)6 LocalDocumentReference (org.xwiki.model.reference.LocalDocumentReference)6 AttachmentsPane (org.xwiki.test.ui.po.AttachmentsPane)6 URL (java.net.URL)5 ApplicationClassEditPage (org.xwiki.appwithinminutes.test.po.ApplicationClassEditPage)5 ClassFieldEditPane (org.xwiki.appwithinminutes.test.po.ClassFieldEditPane)5 ExtensionId (org.xwiki.extension.ExtensionId)5 ExtensionAdministrationPage (org.xwiki.extension.test.po.ExtensionAdministrationPage)5