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"));
}
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());
}
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"));
}
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)));
}
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));
}
Aggregations