Package org.xwiki.test.ui.po

Examples of org.xwiki.test.ui.po.CopyPage


        attachmentsPane.setFileToUpload(getClass().getResource("/image.gif").getPath());
        attachmentsPane.waitForUploadToFinish("image.gif");
        Assert.assertEquals("1.1", attachmentsPane.getLatestVersionOfAttachment("image.gif"));

        // Click on Copy from the Page top menu.
        CopyPage copyPage = viewPage.copy();

        // Check form content
        Assert.assertEquals(sourceSpaceName, copyPage.getSourceSpaceName());
        Assert.assertEquals(sourcePageName, copyPage.getSourcePageName());
        Assert.assertEquals(sourceSpaceName, copyPage.getTargetSpaceName());
        Assert.assertEquals(sourcePageName, copyPage.getTargetPageName());

        // Fill the target destination the page to be copied to.
        copyPage.setTargetSpaceName(targetSpaceName);
        copyPage.setTargetPageName(targetPageName);

        // Click copy button
        CopyConfirmationPage copyConfirmationPage = copyPage.clickCopyButton();

        // Check successful copy confirmation
        Assert.assertTrue(copyConfirmationPage.getInfoMessage().contains(COPY_SUCCESSFUL));
        viewPage = copyConfirmationPage.goToNewPage();
View Full Code Here


        // Create a new page that will be copied.
        ViewPage viewPage =
            getUtil().createPage(sourceSpaceName, sourcePageName, PAGE_CONTENT, sourcePageName);

        // Click on Copy from the Page top menu.
        CopyPage copyPage = viewPage.copy();

        // Fill the target destination the page to be copied to.
        copyPage.setTargetSpaceName(targetSpaceName);
        copyPage.setTargetPageName(targetPageName);

        // Click copy button
        CopyOverwritePromptPage copyOverwritePrompt = copyPage.clickCopyButtonExpectingOverwritePrompt();

        // Check overwrite warning
        Assert.assertEquals(OVERWRITE_PROMPT1 +  targetSpaceName + '.' + targetPageName + OVERWRITE_PROMPT2,
            copyOverwritePrompt.getWarningMessage());

        // Cancel the copy
        viewPage = copyOverwritePrompt.clickCancelButton();

        // Verify that we have been sent back to the original page
        Assert.assertEquals(sourcePageName, viewPage.getDocumentTitle());

        // Click on Copy from the Page top menu.
        copyPage = viewPage.copy();

        // Fill the target destination the page to be copied to.
        copyPage.setTargetSpaceName(targetSpaceName);
        copyPage.setTargetPageName(targetPageName);

        // Click copy button
        copyOverwritePrompt = copyPage.clickCopyButtonExpectingOverwritePrompt();

        // Click change target
        copyPage = copyOverwritePrompt.clickChangeTargetButton();

        // Check form content
        Assert.assertEquals(sourceSpaceName, copyPage.getSourceSpaceName());
        Assert.assertEquals(sourcePageName, copyPage.getSourcePageName());
        Assert.assertEquals(sourceSpaceName, copyPage.getTargetSpaceName());
        Assert.assertEquals(sourcePageName, copyPage.getTargetPageName());

        // Fill the target destination the page to be copied to.
        copyPage.setTargetSpaceName(targetSpaceName);
        copyPage.setTargetPageName(targetPageName);

        // Copy and confirm overwrite
        copyOverwritePrompt = copyPage.clickCopyButtonExpectingOverwritePrompt();
        CopyConfirmationPage copyConfirmationPage = copyOverwritePrompt.clickCopyButton();

        // Check successful copy confirmation
        Assert.assertTrue(copyConfirmationPage.getInfoMessage().contains(COPY_SUCCESSFUL));
        viewPage = copyConfirmationPage.goToNewPage();
View Full Code Here

TOP

Related Classes of org.xwiki.test.ui.po.CopyPage

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.