Search in sources :

Example 6 with AddTagsPane

use of org.xwiki.tag.test.po.AddTagsPane in project xwiki-platform by xwiki.

the class AddRemoveTagsTest method testAddExistingTag.

/**
 * Tests that a tag can't be added twice to the same page.
 */
@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 testAddExistingTag() {
    String tag = RandomStringUtils.randomAlphanumeric(4);
    Assert.assertFalse(taggablePage.hasTag(tag));
    AddTagsPane addTagsPane = taggablePage.addTags();
    addTagsPane.setTags(tag);
    Assert.assertTrue(addTagsPane.add());
    Assert.assertTrue(taggablePage.hasTag(tag));
    addTagsPane = taggablePage.addTags();
    addTagsPane.setTags(tag);
    Assert.assertFalse(addTagsPane.add());
    addTagsPane.cancel();
}
Also used : AddTagsPane(org.xwiki.tag.test.po.AddTagsPane) IgnoreBrowsers(org.xwiki.test.ui.browser.IgnoreBrowsers) AbstractTest(org.xwiki.test.ui.AbstractTest) Test(org.junit.Test)

Example 7 with AddTagsPane

use of org.xwiki.tag.test.po.AddTagsPane in project xwiki-platform by xwiki.

the class AddRemoveTagsTest method addAndRenameTagFromTagPage.

@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 addAndRenameTagFromTagPage() {
    String tag = "MyTag";
    AddTagsPane addTagsPane = taggablePage.addTags();
    addTagsPane.setTags(tag);
    Assert.assertTrue(addTagsPane.add());
    Assert.assertTrue(taggablePage.hasTag(tag));
    tagPage = taggablePage.clickOnTag(tag);
    tagPage.clickRenameButton();
    tagPage.setNewTagName("MyTagRenamed");
    tagPage.clickConfirmRenameTagButton();
    Assert.assertTrue(tagPage.hasTagHighlight("MyTagRenamed"));
}
Also used : AddTagsPane(org.xwiki.tag.test.po.AddTagsPane) IgnoreBrowsers(org.xwiki.test.ui.browser.IgnoreBrowsers) AbstractTest(org.xwiki.test.ui.AbstractTest) Test(org.junit.Test)

Example 8 with AddTagsPane

use of org.xwiki.tag.test.po.AddTagsPane in project xwiki-platform by xwiki.

the class AddRemoveTagsTest method testAddRemoveTag.

/**
 * Adds and removes a tag.
 */
@Test
@IgnoreBrowser(value = "internet.*", version = "9\\.*", reason = "See https://jira.xwiki.org/browse/XE-1177")
public void testAddRemoveTag() {
    String tag = RandomStringUtils.randomAlphanumeric(4);
    Assert.assertFalse(taggablePage.hasTag(tag));
    AddTagsPane addTagsPane = taggablePage.addTags();
    addTagsPane.setTags(tag);
    Assert.assertTrue(addTagsPane.add());
    Assert.assertTrue(taggablePage.hasTag(tag));
    taggablePage.removeTag(tag);
    Assert.assertFalse(taggablePage.hasTag(tag));
}
Also used : AddTagsPane(org.xwiki.tag.test.po.AddTagsPane) AbstractTest(org.xwiki.test.ui.AbstractTest) Test(org.junit.Test) IgnoreBrowser(org.xwiki.test.ui.browser.IgnoreBrowser)

Example 9 with AddTagsPane

use of org.xwiki.tag.test.po.AddTagsPane in project xwiki-platform by xwiki.

the class AddRemoveTagsTest method addAndDeleteTagFromTagPage.

@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 addAndDeleteTagFromTagPage() {
    String tag = "MyTagToBeDeleted";
    AddTagsPane addTagsPane = taggablePage.addTags();
    addTagsPane.setTags(tag);
    Assert.assertTrue(addTagsPane.add());
    Assert.assertTrue(taggablePage.hasTag(tag));
    tagPage = taggablePage.clickOnTag(tag);
    tagPage.clickDeleteButton();
    tagPage.clickConfirmDeleteTag();
    Assert.assertTrue(tagPage.hasConfirmationMessage(tag));
}
Also used : AddTagsPane(org.xwiki.tag.test.po.AddTagsPane) IgnoreBrowsers(org.xwiki.test.ui.browser.IgnoreBrowsers) AbstractTest(org.xwiki.test.ui.AbstractTest) Test(org.junit.Test)

Example 10 with AddTagsPane

use of org.xwiki.tag.test.po.AddTagsPane in project xwiki-platform by xwiki.

the class AddRemoveTagsTest method testCancelAddTag.

/**
 * Open the add tag panel, cancel then open again the add tag panel and add a new tag.
 */
@Test
@IgnoreBrowser(value = "internet.*", version = "9\\.*", reason = "See https://jira.xwiki.org/browse/XE-1177")
public void testCancelAddTag() {
    String firstTag = RandomStringUtils.randomAlphanumeric(4);
    Assert.assertFalse(taggablePage.hasTag(firstTag));
    AddTagsPane addTagsPane = taggablePage.addTags();
    addTagsPane.setTags(firstTag);
    addTagsPane.cancel();
    String secondTag = RandomStringUtils.randomAlphanumeric(4);
    Assert.assertFalse(taggablePage.hasTag(secondTag));
    addTagsPane = taggablePage.addTags();
    addTagsPane.setTags(secondTag);
    Assert.assertTrue(addTagsPane.add());
    Assert.assertTrue(taggablePage.hasTag(secondTag));
    Assert.assertFalse(taggablePage.hasTag(firstTag));
}
Also used : AddTagsPane(org.xwiki.tag.test.po.AddTagsPane) AbstractTest(org.xwiki.test.ui.AbstractTest) Test(org.junit.Test) IgnoreBrowser(org.xwiki.test.ui.browser.IgnoreBrowser)

Aggregations

AddTagsPane (org.xwiki.tag.test.po.AddTagsPane)10 Test (org.junit.Test)9 AbstractTest (org.xwiki.test.ui.AbstractTest)9 IgnoreBrowser (org.xwiki.test.ui.browser.IgnoreBrowser)5 IgnoreBrowsers (org.xwiki.test.ui.browser.IgnoreBrowsers)4 TaggablePage (org.xwiki.tag.test.po.TaggablePage)2 HashMap (java.util.HashMap)1 Before (org.junit.Before)1 AttachmentsPane (org.xwiki.test.ui.po.AttachmentsPane)1 CommentsTab (org.xwiki.test.ui.po.CommentsTab)1 FormElement (org.xwiki.test.ui.po.FormElement)1 ClassEditPage (org.xwiki.test.ui.po.editor.ClassEditPage)1 ObjectEditPage (org.xwiki.test.ui.po.editor.ObjectEditPage)1 WikiEditPage (org.xwiki.test.ui.po.editor.WikiEditPage)1