Search in sources :

Example 11 with ViewPage

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());
}
Also used : AttachmentsPane(org.xwiki.test.ui.po.AttachmentsPane) ViewPage(org.xwiki.test.ui.po.ViewPage) IgnoreBrowsers(org.xwiki.test.ui.browser.IgnoreBrowsers) Test(org.junit.Test)

Example 12 with ViewPage

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());
}
Also used : ViewPage(org.xwiki.test.ui.po.ViewPage)

Example 13 with ViewPage

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();
}
Also used : ViewPage(org.xwiki.test.ui.po.ViewPage) Before(org.junit.Before)

Example 14 with ViewPage

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)));
}
Also used : ViewPage(org.xwiki.test.ui.po.ViewPage) Test(org.junit.Test)

Example 15 with ViewPage

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)));
}
Also used : CommentsTab(org.xwiki.test.ui.po.CommentsTab) ViewPage(org.xwiki.test.ui.po.ViewPage) IgnoreBrowsers(org.xwiki.test.ui.browser.IgnoreBrowsers) Test(org.junit.Test)

Aggregations

ViewPage (org.xwiki.test.ui.po.ViewPage)93 Test (org.junit.Test)75 AbstractTest (org.xwiki.test.ui.AbstractTest)41 IgnoreBrowsers (org.xwiki.test.ui.browser.IgnoreBrowsers)26 WikiEditPage (org.xwiki.test.ui.po.editor.WikiEditPage)18 ObjectEditPage (org.xwiki.test.ui.po.editor.ObjectEditPage)11 IgnoreBrowser (org.xwiki.test.ui.browser.IgnoreBrowser)10 DocumentReference (org.xwiki.model.reference.DocumentReference)8 CreatePagePage (org.xwiki.test.ui.po.CreatePagePage)8 FormElement (org.xwiki.test.ui.po.FormElement)7 HistoryPane (org.xwiki.test.ui.po.HistoryPane)7 ClassEditPage (org.xwiki.test.ui.po.editor.ClassEditPage)7 WebElement (org.openqa.selenium.WebElement)6 LocalDocumentReference (org.xwiki.model.reference.LocalDocumentReference)6 AttachmentsPane (org.xwiki.test.ui.po.AttachmentsPane)6 URL (java.net.URL)5 ApplicationClassEditPage (org.xwiki.appwithinminutes.test.po.ApplicationClassEditPage)5 ClassFieldEditPane (org.xwiki.appwithinminutes.test.po.ClassFieldEditPane)5 ExtensionId (org.xwiki.extension.ExtensionId)5 ExtensionAdministrationPage (org.xwiki.extension.test.po.ExtensionAdministrationPage)5