Search in sources :

Example 6 with EditPage

use of org.xwiki.test.ui.po.editor.EditPage in project xwiki-platform by xwiki.

the class ResourceTest method accessResources.

@Test
public void accessResources() throws Exception {
    // Verify that accessing /view/A/B goes to A.B.WebHome (Nested Documents URL shortcut feature)
    getUtil().gotoPage(getUtil().getURL("view", new String[] { "A", "B" }, null));
    // Edit the page and verify the URL
    // The wiki is empty and there's no WYSIWYG so clicking edit will go to the wiki editor
    new ViewPage().edit();
    EditPage ep = new EditPage();
    assertTrue(new URL(ep.getPageURL()).getPath().endsWith("A/B/WebHome"));
    // Verify that accessing /edit/A/B edits A.B (Nested Documents URL shortcut feature is only for view mode)
    getUtil().gotoPage(getUtil().getURL("edit", new String[] { "A", "B" }, null));
    ep = new EditPage();
    assertTrue(new URL(ep.getPageURL()).getPath().endsWith("A/B"));
    // Verify that the spaceRedirect=false query string parameter and value can be used to disable the automatic
    // space redirect
    getUtil().gotoPage(getUtil().getURL("view", new String[] { "A", "B" }, "spaceRedirect=false"));
    new ViewPage().edit();
    ep = new EditPage();
    assertTrue(new URL(ep.getPageURL()).getPath().endsWith("A/B"));
}
Also used : ViewPage(org.xwiki.test.ui.po.ViewPage) EditPage(org.xwiki.test.ui.po.editor.EditPage) URL(java.net.URL) AbstractTest(org.xwiki.test.ui.AbstractTest) Test(org.junit.Test)

Aggregations

Test (org.junit.Test)6 AbstractTest (org.xwiki.test.ui.AbstractTest)6 ViewPage (org.xwiki.test.ui.po.ViewPage)6 EditPage (org.xwiki.test.ui.po.editor.EditPage)6 CreatePagePage (org.xwiki.test.ui.po.CreatePagePage)5 DocumentReference (org.xwiki.model.reference.DocumentReference)2 EntityReference (org.xwiki.model.reference.EntityReference)2 SpaceReference (org.xwiki.model.reference.SpaceReference)2 IgnoreBrowsers (org.xwiki.test.ui.browser.IgnoreBrowsers)2 DocumentDoesNotExistPage (org.xwiki.test.ui.po.DocumentDoesNotExistPage)2 WikiEditPage (org.xwiki.test.ui.po.editor.WikiEditPage)2 URL (java.net.URL)1 ArrayList (java.util.ArrayList)1 WebElement (org.openqa.selenium.WebElement)1 TemplateProviderInlinePage (org.xwiki.administration.test.po.TemplateProviderInlinePage)1 WikiReference (org.xwiki.model.reference.WikiReference)1