Package org.xwiki.test.ui.xe.elements

Examples of org.xwiki.test.ui.xe.elements.HomePage


     * we want when the delete is done.
     */
    @Test
    public void testDeletePageCanSkipConfirmationAndDoARedirect()
    {
        HomePage homePage = new HomePage();
        getUtil().gotoPage(SPACE_VALUE, PAGE_VALUE, DELETE_ACTION,
            "confirm=1&xredirect=" + homePage.getURL());
        Assert.assertTrue(homePage.isOnHomePage());
    }
View Full Code Here


        changePasswordPage.changePassword(newPassword, newPassword);
        changePasswordPage.submit();

        // Logout
        getUtil().forceGuestUser();
        HomePage home = new HomePage();
        home.gotoPage();
        Assert.assertFalse(home.isAuthenticated());

        // Login with the new password
        getDriver().get(getUtil().getURLToLoginAs(this.userName, newPassword));
        Assert.assertTrue(home.isAuthenticated());
        getUtil().recacheSecretToken();
    }
View Full Code Here

        // create a random space
        String space = this.getClass().getSimpleName() + ((int) (Math.random() * 1000));
        getUtil().deletePage(space, "WebHome");

        // start creating a space
        HomePage homePage = new HomePage();
        homePage.gotoPage();
        CreateSpacePage createSpace = homePage.createSpace();

        WYSIWYGEditPage editSpaceWebhomePage = createSpace.createSpace(space);
        // expect wysiwyg edit mode for the webhome of the space
        Assert.assertTrue(getUtil().isInWYSIWYGEditMode());
        Assert.assertEquals(space, editSpaceWebhomePage.getMetaDataValue("space"));
View Full Code Here

        getUtil().createPage(space, existingPageName, "Page that already exists", "Existing page");
        String existingSpace = this.getClass().getSimpleName() + ((int) (Math.random() * 1000));
        getUtil().createPage(existingSpace, "WebHome", "{{spaceindex /}}", "New random space");

        // 1/ create an empty page that already exists
        HomePage homePage = new HomePage();
        homePage.gotoPage();
        CreatePagePage createPage = homePage.createPage();
        createPage.setSpace(space);
        createPage.setPage(existingPageName);
        String currentURL = getDriver().getCurrentUrl();
        createPage.clickCreate();
        // make sure that we stay on the same page and that an error is displayed to the user. Maybe we should check the
        // error
        Assert.assertEquals(currentURL, getDriver().getCurrentUrl());
        createPage.waitForErrorMessage();

        // 2/ create a page from template that already exists
        // restart everything to make sure it's not the error before
        homePage.gotoPage();
        createPage = homePage.createPage();
        createPage.setSpace(space);
        createPage.setPage(existingPageName);
        createPage.setTemplate(space + "." + templateProviderName);
        currentURL = getDriver().getCurrentUrl();
        createPage.clickCreate();
        // make sure that we stay on the same page and that an error is displayed to the user. Maybe we should check the
        // error
        Assert.assertEquals(currentURL, getDriver().getCurrentUrl());
        createPage.waitForErrorMessage();

        // 3/ create a space that already exists
        homePage.gotoPage();
        CreateSpacePage createSpace = homePage.createSpace();
        currentURL = getDriver().getCurrentUrl();
        // strip the parameters out of this URL
        currentURL =
            currentURL.substring(0, currentURL.indexOf('?') > 0 ? currentURL.indexOf('?') : currentURL.length());
        createSpace.createSpace(existingSpace);
View Full Code Here

     * Verify that we can skip the default delete result page and instead redirect to any page we want.
     */
    @Test
    public void testDeletePageCanDoRedirect()
    {
        HomePage homePage = new HomePage();
        getUtil().gotoPage(SPACE_VALUE, PAGE_VALUE, DELETE_ACTION, "xredirect=" + homePage.getURL());
        WebElement yesButton = getDriver().findElement(By.xpath("//input[@value='yes']"));
        yesButton.click();
        Assert.assertTrue(homePage.isOnHomePage());
    }
View Full Code Here

        super.setUp();

        getUtil().deletePage("\u0219", "WebHome");
        getUtil().deletePage("Main", "\u0219");

        this.homePage = new HomePage();
        this.homePage.gotoPage();
    }
View Full Code Here

     * Tests if a new space can be created from the Space dashboard.
     */
    @Test
    public void testCreateSpace()
    {
        HomePage homePage = new HomePage();
        homePage.gotoPage();
        WYSIWYGEditPage editPage = homePage.getSpacesPane().createSpace(getTestClassName());

        // Verify that space creation uses the space name as the space home page's title
        Assert.assertEquals(getTestClassName(), editPage.getDocumentTitle());

        // Verify that the space created is correct by looking at the generate metadata in the HTML header
View Full Code Here

        editPage.switchToEdit(spaceName, "WebHome");
        editPage.setContent("Content");
        editPage.clickSaveAndView();

        // Navigate to the Home Page and click on the SpaceIndex.
        HomePage homePage = new HomePage();
        homePage.gotoPage();
        homePage.getSpacesPane().clickSpaceIndex(spaceName);

        // TODO: Improve the following test by asserting the content of the Livetable in the SpaceIndexPage
        Assert.assertEquals(getUtil().getURL("Main", "SpaceIndex", "view", "space=" + getUtil().escapeURL(spaceName)),
            getDriver().getCurrentUrl());
    }
View Full Code Here

TOP

Related Classes of org.xwiki.test.ui.xe.elements.HomePage

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.