Package org.xwiki.test.ui.po

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


        HistoryPane historyPane = page.openHistoryDocExtraPane();
        assertEquals("3.1", historyPane.getCurrentVersion());
        assertEquals("Restored from recycle bin", historyPane.getCurrentVersionComment());

        // Check the attachment.
        AttachmentsPane attachmentsPane = page.openAttachmentsDocExtraPane();
        assertEquals(1, attachmentsPane.getNumberOfAttachments());
        assertEquals("1.1", attachmentsPane.getLatestVersionOfAttachment("SmallAttachment.txt"));

        // Check the attachment content.
        attachmentsPane.getAttachmentLink("SmallAttachment.txt").click();
        Assert.assertEquals("This is a small attachment.", getDriver().findElement(By.tagName("html")).getText());
    }
View Full Code Here


        // TODO: Remove when XWIKI-6688 (Possible race condition when clicking on a tab at the bottom of a page in
        // view mode) is fixed.
        vp.waitForDocExtraPaneActive("comments");

        AttachmentsPane ap = vp.openAttachmentsDocExtraPane();
        ap.setFileToUpload(this.getClass().getResource("/" + this.testAttachment).getPath());
        ap.addAnotherFile();
        ap.setFileToUpload(this.getClass().getResource("/" + this.testAttachment2).getPath());
        ap.clickAttachFiles();

        Assert.assertEquals("1.1", ap.getLatestVersionOfAttachment(this.testAttachment));
        Assert.assertEquals("1.1", ap.getLatestVersionOfAttachment(this.testAttachment2));

        // Verify attachment contents

        ap.getAttachmentLink(this.testAttachment).click();

        Assert.assertEquals("This is a small attachment.", getDriver().findElement(By.tagName("html")).getText());
        getDriver().navigate().back();
        vp.waitForDocExtraPaneActive("attachments");
        ap.getAttachmentLink(this.testAttachment2).click();
        Assert.assertEquals("This is another small attachment.", getDriver().findElement(By.tagName("html")).getText());
    }
View Full Code Here

        // TODO: Remove when XWIKI-6688 (Possible race condition when clicking on a tab at the bottom of a page in
        // view mode) is fixed.
        vp.waitForDocExtraPaneActive("comments");

        AttachmentsPane ap = vp.openAttachmentsDocExtraPane();
        ap.setFileToUpload(this.getClass().getResource("/" + this.testAttachment).getPath());
        ap.waitForUploadToFinish(this.testAttachment);
        ap.clickHideProgress();
        ap.setFileToUpload(this.getClass().getResource("/" + this.testAttachment2).getPath());
        ap.waitForUploadToFinish(this.testAttachment2);

        Assert.assertEquals("1.1", ap.getLatestVersionOfAttachment(this.testAttachment));
        Assert.assertEquals("1.1", ap.getLatestVersionOfAttachment(this.testAttachment2));

        // Verify attachment contents

        ap.getAttachmentLink(this.testAttachment).click();

        Assert.assertEquals("This is a small attachment.", getDriver().findElement(By.tagName("html")).getText());
        getDriver().navigate().back();
        vp.waitForDocExtraPaneActive("attachments");
        ap.getAttachmentLink(this.testAttachment2).click();
        Assert.assertEquals("This is another small attachment.", getDriver().findElement(By.tagName("html")).getText());
    }
View Full Code Here

        // TODO: Remove when XWIKI-6688 (Possible race condition when clicking on a tab at the bottom of a page in
        // view mode) is fixed.
        viewPage.waitForDocExtraPaneActive("comments");

        // Attach the GIF image.
        AttachmentsPane attachmentsPane = viewPage.openAttachmentsDocExtraPane();
        attachmentsPane.setFileToUpload(getClass().getResource("/image.gif").getPath());
        attachmentsPane.waitForUploadToFinish("image.gif");
        Assert.assertTrue(attachmentsPane.attachmentExistsByFileName("image.gif"));
    }
View Full Code Here

            getUtil().createPage(sourceSpaceName, sourcePageName, PAGE_CONTENT, sourcePageName);

        // Add an attachment to verify that it's version is not incremented in the target document (XWIKI-8157).
        // FIXME: Remove the following wait when XWIKI-6688 is fixed.
        viewPage.waitForDocExtraPaneActive("comments");
        AttachmentsPane attachmentsPane = viewPage.openAttachmentsDocExtraPane();
        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();

        // Verify that the copied title is modified to be the new page name since it was set to be the page name
        // originally.
        Assert.assertEquals(targetPageName, viewPage.getDocumentTitle());
        Assert.assertEquals(PAGE_CONTENT, viewPage.getContent());

        // Verify the attachment version is the same (XWIKI-8157).
        // FIXME: Remove the following wait when XWIKI-6688 is fixed.
        viewPage.waitForDocExtraPaneActive("comments");
        attachmentsPane = viewPage.openAttachmentsDocExtraPane();
        Assert.assertEquals("1.1", attachmentsPane.getLatestVersionOfAttachment("image.gif"));
    }
View Full Code Here

        addTagsPane.setTags("foo,bar");
        addTagsPane.add();
        taggablePage.removeTag("foo");

        // Attach files.
        AttachmentsPane attachmentsPane = testPage.openAttachmentsDocExtraPane();
        // TODO: Update this code when we (re)add support for uploading multiple files at once.
        for (String fileName : new String[] {"SmallAttachment.txt", "SmallAttachment2.txt", "SmallAttachment.txt"}) {
            attachmentsPane.setFileToUpload(this.getClass().getResource('/' + fileName).getPath());
            attachmentsPane.waitForUploadToFinish(fileName);
            attachmentsPane.clickHideProgress();
        }
        attachmentsPane.deleteAttachmentByFileByName("SmallAttachment2.txt");

        // Add comments.
        getUtil().createUserAndLogin("Alice", "ecila");
        testPage = getUtil().gotoPage(getTestClassName(), pageName);
        CommentsTab commentsTab = testPage.openCommentsDocExtraPane();
View Full Code Here

TOP

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

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.