Search in sources :

Example 1 with ReleaseHomePage

use of org.xwiki.release.test.po.ReleaseHomePage in project xwiki-platform by xwiki.

the class ReleaseTest method testRelease.

@Test
public void testRelease() {
    // Create a user and log in with it so that we test the application with a standard user
    // Note that using the superadmin user would also fail since the uservatar macro doesn't work with it.
    getUtil().createUserAndLogin(getTestClassName() + "User", "password");
    // Delete pages that we create in the test (we have to be logged in).
    getUtil().deletePage("Release", RELEASE_PAGE_NAME);
    // Navigate to the Release app by clicking in the Application Panel.
    // This verifies that the Release application is registered in the Applications Panel.
    // It also verifies that the Translation is registered properly.
    ApplicationsPanel applicationPanel = ApplicationsPanel.gotoPage();
    ViewPage vp = applicationPanel.clickApplication("Release");
    // Verify we're on the right page!
    Assert.assertEquals(ReleaseHomePage.getSpace(), vp.getMetaDataValue("space"));
    Assert.assertEquals(ReleaseHomePage.getPage(), vp.getMetaDataValue("page"));
    ReleaseHomePage homePage = new ReleaseHomePage();
    // Add new Release
    ReleaseEntryEditPage entryPage = homePage.addRelease(RELEASE_VERSION);
    vp = entryPage.waitUntilPageIsLoaded().clickSaveAndView();
    // Go back to the home page by clicking in the breadcrumb
    vp.clickBreadcrumbLink("Releases");
    homePage.waitUntilPageIsLoaded();
    // Assert Livetable:
    // - verify that the Translation has been applied by checking the Translated livetable column name
    // - verify that the Livetable contains our new Release entry
    LiveTableElement lt = homePage.getReleaseLiveTable();
    Assert.assertTrue(lt.hasRow("Version", RELEASE_VERSION));
}
Also used : LiveTableElement(org.xwiki.test.ui.po.LiveTableElement) ApplicationsPanel(org.xwiki.panels.test.po.ApplicationsPanel) ReleaseEntryEditPage(org.xwiki.release.test.po.ReleaseEntryEditPage) ViewPage(org.xwiki.test.ui.po.ViewPage) ReleaseHomePage(org.xwiki.release.test.po.ReleaseHomePage) AbstractTest(org.xwiki.test.ui.AbstractTest) Test(org.junit.Test)

Aggregations

Test (org.junit.Test)1 ApplicationsPanel (org.xwiki.panels.test.po.ApplicationsPanel)1 ReleaseEntryEditPage (org.xwiki.release.test.po.ReleaseEntryEditPage)1 ReleaseHomePage (org.xwiki.release.test.po.ReleaseHomePage)1 AbstractTest (org.xwiki.test.ui.AbstractTest)1 LiveTableElement (org.xwiki.test.ui.po.LiveTableElement)1 ViewPage (org.xwiki.test.ui.po.ViewPage)1