use of org.xwiki.test.ui.po.ViewPage in project xwiki-platform by xwiki.
the class AttachmentTest method testUploadDownloadTwoAttachmentsInSequence.
@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 testUploadDownloadTwoAttachmentsInSequence() {
ViewPage vp = getUtil().createPage(getTestClassName(), getTestMethodName(), null, getTestClassName() + "#" + getTestMethodName());
// 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());
}
use of org.xwiki.test.ui.po.ViewPage in project xwiki-platform by xwiki.
the class BacklinksTest method testBacklinksCreation.
private void testBacklinksCreation(String syntaxId, String backlinkListCode, String backlinkLink) throws Exception {
getUtil().rest().deletePage("Test", "BacklinkTargetTest");
getUtil().rest().deletePage("Test", "BacklinkSourceTest");
// Create page listing backlinks leading to it.
ViewPage vp = getUtil().createPage("Test", "BacklinkTargetTest", backlinkListCode, null, syntaxId);
// No backlinks at this stage
Assert.assertEquals("", vp.getContent());
// Create page pointing to the page listing the backlinks.
getUtil().createPage("Test", "BacklinkSourceTest", backlinkLink, null, syntaxId);
vp = getUtil().gotoPage("Test", "BacklinkTargetTest");
Assert.assertEquals("Test.BacklinkSourceTest", vp.getContent());
}
use of org.xwiki.test.ui.po.ViewPage in project xwiki-platform by xwiki.
the class CommentAsAdminTest method setUp.
@Before
public void setUp() throws Exception {
getUtil().rest().deletePage(getTestClassName(), getTestMethodName());
ViewPage vp = getUtil().createPage(getTestClassName(), getTestMethodName(), CONTENT, TITLE);
this.commentsTab = vp.openCommentsDocExtraPane();
}
use of org.xwiki.test.ui.po.ViewPage in project xwiki-platform by xwiki.
the class CommentAsAdminTest method testPostCommentAsAdminNoJs.
@Test
public void testPostCommentAsAdminNoJs() {
// In this test class, the only user who logs in is admin.
getUtil().gotoPage(getTestClassName(), getTestMethodName(), "view", "xpage=xpart&vm=commentsinline.vm");
this.commentsTab.postComment(COMMENT_CONTENT, false);
ViewPage vp = new ViewPage();
// This opens with ?viewer=comments, don't explicitly load the comments tab
vp.waitUntilPageIsLoaded();
Assert.assertEquals(COMMENT_CONTENT, this.commentsTab.getCommentContentByID(this.commentsTab.getCommentID(COMMENT_CONTENT)));
Assert.assertEquals(ADMIN, this.commentsTab.getCommentAuthorByID(this.commentsTab.getCommentID(COMMENT_CONTENT)));
}
use of org.xwiki.test.ui.po.ViewPage in project xwiki-platform by xwiki.
the class CommentAsGuestTest method testPostCommentAsGuestNoJs.
@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 testPostCommentAsGuestNoJs() {
getUtil().gotoPage(getTestClassName(), getTestMethodName(), "view", "xpage=xpart&vm=commentsinline.vm");
CommentsTab commentsTab = new CommentsTab();
commentsTab.postComment(COMMENT_CONTENT, false);
// This opens with ?viewer=comments, don't explicitly load the comments tab
new ViewPage().waitUntilPageIsLoaded();
Assert.assertEquals(COMMENT_CONTENT, commentsTab.getCommentContentByID(commentsTab.getCommentID(COMMENT_CONTENT)));
Assert.assertEquals(COMMENT_AUTHOR, commentsTab.getCommentAuthorByID(commentsTab.getCommentID(COMMENT_CONTENT)));
}
Aggregations