Search in sources :

Example 76 with IgnoreBrowsers

use of org.xwiki.test.ui.browser.IgnoreBrowsers in project xwiki-platform by xwiki.

the class ClassEditorTest method testRenameField.

/**
 * Tests that class fields can be renamed.
 */
@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 testRenameField() {
    // Add a class field.
    editor.addField("Number").setDefaultValue("13");
    // Save and edit the class template.
    editor.clickSaveAndView();
    new ClassSheetPage().clickTemplateLink().edit();
    // Change the field value.
    EntryEditPage inlineEditor = new EntryEditPage();
    Assert.assertEquals("13", inlineEditor.getValue("number1"));
    inlineEditor.setValue("number1", "27");
    // Save and edit again the class.
    inlineEditor.clickSaveAndView();
    getUtil().gotoPage(getTestClassName(), getTestMethodName());
    new ViewPage().edit();
    // Rename the class field.
    ClassFieldEditPane field = new ClassFieldEditPane("number1");
    field.openConfigPanel();
    field.setName("age");
    // Save and edit again the class template.
    new ApplicationClassEditPage().clickSaveAndView();
    new ClassSheetPage().clickTemplateLink().edit();
    Assert.assertEquals("27", new EntryEditPage().getValue("age"));
}
Also used : EntryEditPage(org.xwiki.appwithinminutes.test.po.EntryEditPage) LongTextClassFieldEditPane(org.xwiki.appwithinminutes.test.po.LongTextClassFieldEditPane) ClassFieldEditPane(org.xwiki.appwithinminutes.test.po.ClassFieldEditPane) ClassSheetPage(org.xwiki.xclass.test.po.ClassSheetPage) ViewPage(org.xwiki.test.ui.po.ViewPage) ApplicationClassEditPage(org.xwiki.appwithinminutes.test.po.ApplicationClassEditPage) IgnoreBrowsers(org.xwiki.test.ui.browser.IgnoreBrowsers) Test(org.junit.Test)

Example 77 with IgnoreBrowsers

use of org.xwiki.test.ui.browser.IgnoreBrowsers in project xwiki-platform by xwiki.

the class AttachmentTest method testUploadDownloadTwoAttachmentsInParallel.

@Test
@Ignore("WebDriver doesn't support uploading multiple files in one input, see http://code.google.com/p/selenium/issues/detail?id=2239")
@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 testUploadDownloadTwoAttachmentsInParallel() {
    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.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());
}
Also used : AttachmentsPane(org.xwiki.test.ui.po.AttachmentsPane) ViewPage(org.xwiki.test.ui.po.ViewPage) Ignore(org.junit.Ignore) IgnoreBrowsers(org.xwiki.test.ui.browser.IgnoreBrowsers) Test(org.junit.Test)

Example 78 with IgnoreBrowsers

use of org.xwiki.test.ui.browser.IgnoreBrowsers in project xwiki-platform by xwiki.

the class AttachmentTest method testAttachAndViewGifImage.

/**
 * See XWIKI-5896: The image handling in the WYSIWYG-editor with GIF images is buggy.
 */
@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 testAttachAndViewGifImage() {
    // Prepare the page to display the GIF image. We explicitly set the width to a value greater than the actual
    // image width because we want the code that resizes the image on the server side to be executed (even if the
    // image is not actually resized).
    ViewPage viewPage = getUtil().createPage(getClass().getSimpleName(), getTestMethodName(), String.format("[[image:image.gif||width=%s]]", (20 + RandomUtils.nextInt(0, 200))), getTestClassName());
    // 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"));
}
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 79 with IgnoreBrowsers

use of org.xwiki.test.ui.browser.IgnoreBrowsers in project xwiki-platform by xwiki.

the class CommentAsGuestTest method testCannotEditCommentAsAnonymous.

@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 testCannotEditCommentAsAnonymous() {
    CommentsTab commentsTab = this.vp.openCommentsDocExtraPane();
    commentsTab.postCommentAsGuest(COMMENT_CONTENT, COMMENT_AUTHOR, true);
    Assert.assertFalse(commentsTab.hasEditButtonForCommentByID(commentsTab.getCommentID(COMMENT_CONTENT)));
}
Also used : CommentsTab(org.xwiki.test.ui.po.CommentsTab) IgnoreBrowsers(org.xwiki.test.ui.browser.IgnoreBrowsers) Test(org.junit.Test)

Example 80 with IgnoreBrowsers

use of org.xwiki.test.ui.browser.IgnoreBrowsers in project xwiki-platform by xwiki.

the class CommentAsGuestTest method testPostCommentAsGuest.

@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 testPostCommentAsGuest() {
    CommentsTab commentsTab = this.vp.openCommentsDocExtraPane();
    commentsTab.postCommentAsGuest(COMMENT_CONTENT, COMMENT_AUTHOR, true);
    Assert.assertEquals(COMMENT_CONTENT, commentsTab.getCommentContentByID(0));
    Assert.assertEquals(COMMENT_AUTHOR, commentsTab.getCommentAuthorByID(0));
}
Also used : CommentsTab(org.xwiki.test.ui.po.CommentsTab) IgnoreBrowsers(org.xwiki.test.ui.browser.IgnoreBrowsers) Test(org.junit.Test)

Aggregations

IgnoreBrowsers (org.xwiki.test.ui.browser.IgnoreBrowsers)80 Test (org.junit.Test)76 AbstractTest (org.xwiki.test.ui.AbstractTest)43 ViewPage (org.xwiki.test.ui.po.ViewPage)26 ClassFieldEditPane (org.xwiki.appwithinminutes.test.po.ClassFieldEditPane)12 LongTextClassFieldEditPane (org.xwiki.appwithinminutes.test.po.LongTextClassFieldEditPane)11 ApplicationClassEditPage (org.xwiki.appwithinminutes.test.po.ApplicationClassEditPage)10 WikiEditPage (org.xwiki.test.ui.po.editor.WikiEditPage)9 MimeMessage (javax.mail.internet.MimeMessage)7 TestUtils (org.xwiki.test.ui.TestUtils)6 HistoryPane (org.xwiki.test.ui.po.HistoryPane)6 LiveTableElement (org.xwiki.test.ui.po.LiveTableElement)6 LoginPage (org.xwiki.test.ui.po.LoginPage)6 PreferencesUserProfilePage (org.xwiki.user.test.po.PreferencesUserProfilePage)6 ApplicationHomePage (org.xwiki.appwithinminutes.test.po.ApplicationHomePage)5 EntryEditPage (org.xwiki.appwithinminutes.test.po.EntryEditPage)5 InvitationGuestActionsPage (org.xwiki.invitation.test.po.InvitationGuestActionsPage)5 ChangePasswordPage (org.xwiki.user.test.po.ChangePasswordPage)5 URL (java.net.URL)4 WebElement (org.openqa.selenium.WebElement)4