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