Search in sources :

Example 1 with ResubmissionPage

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

the class LoginTest method testDataIsPreservedAfterLogin.

@Test
@IgnoreBrowsers({ @IgnoreBrowser(value = "internet.*", version = "8\\.*", reason = "See https://jira.xwiki.org/browse/XE-1146"), @IgnoreBrowser(value = "internet.*", version = "9\\.*", reason = "See https://jira.xwiki.org/browse/XE-1177") })
public void testDataIsPreservedAfterLogin() {
    getUtil().gotoPage("Test", "TestData", "save", "content=this+should+not+be+saved");
    getUtil().gotoPage("Test", "TestData", "save", "content=this+should+be+saved+instead&parent=Main.WebHome");
    LoginPage loginPage = new LoginPage();
    loginPage.loginAsAdmin();
    // we switched to another user, CSRF protection (if enabled) will ask for confirmation
    ResubmissionPage resubmissionPage = new ResubmissionPage();
    if (resubmissionPage.isOnResubmissionPage()) {
        resubmissionPage.resubmit();
    }
    Assert.assertTrue(getDriver().getCurrentUrl().contains("/xwiki/bin/view/Test/TestData"));
    ViewPage viewPage = new ViewPage();
    Assert.assertEquals("this should be saved instead", viewPage.getContent());
}
Also used : ResubmissionPage(org.xwiki.test.ui.po.ResubmissionPage) ViewPage(org.xwiki.test.ui.po.ViewPage) LoginPage(org.xwiki.test.ui.po.LoginPage) IgnoreBrowsers(org.xwiki.test.ui.browser.IgnoreBrowsers) Test(org.junit.Test)

Aggregations

Test (org.junit.Test)1 IgnoreBrowsers (org.xwiki.test.ui.browser.IgnoreBrowsers)1 LoginPage (org.xwiki.test.ui.po.LoginPage)1 ResubmissionPage (org.xwiki.test.ui.po.ResubmissionPage)1 ViewPage (org.xwiki.test.ui.po.ViewPage)1