use of org.xwiki.test.ui.browser.IgnoreBrowser in project xwiki-platform by xwiki.
the class InvitationTest method testPreviewMessage.
@Test
@IgnoreBrowser(value = "internet.*", version = "8\\.*", reason = "See https://jira.xwiki.org/browse/XE-1146")
public void testPreviewMessage() {
InvitationMessageDisplayElement preview = getSenderPage().preview();
Assert.assertTrue(preview.getSubjectLine().contains("has invited you to join"));
Assert.assertTrue(preview.getMessageBody().contains("If this message looks like abuse of our system"));
Assert.assertTrue(preview.getValidRecipients().get(0).getText().contains("user@localhost.localdomain"));
}
use of org.xwiki.test.ui.browser.IgnoreBrowser 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));
}
use of org.xwiki.test.ui.browser.IgnoreBrowser in project xwiki-platform by xwiki.
the class EditObjectsTest method testChangeListMultipleSelect.
/**
* Prove that a list can be changed from relational storage to plain storage and back without database corruption.
* XWIKI-299 test
*/
@Test
@IgnoreBrowser(value = "internet.*", version = "8\\.*", reason = "See https://jira.xwiki.org/browse/XE-1146")
public void testChangeListMultipleSelect() {
// Create class page
WikiEditPage wep = WikiEditPage.gotoPage("Test", "EditObjectsTestClass");
wep.setContent("this is the content");
ViewPage vp = wep.clickSaveAndView();
// Add class
ClassEditPage cep = vp.editClass();
cep.addProperty("prop", "StaticList");
StaticListClassEditElement slcee = cep.getStaticListClassEditElement("prop");
slcee.setMultiSelect(false);
slcee.setValues("choice 1|choice 2|choice 3|choice 4|choice 5");
vp = cep.clickSaveAndView();
Assert.assertEquals("this is the content", vp.getContent());
// Create object page
wep = WikiEditPage.gotoPage("Test", "EditObjectsTestObject");
wep.setContent("this is the content: {{velocity}}$doc.display('prop'){{/velocity}}");
vp = wep.clickSaveAndView();
// Add object
ObjectEditPage oep = vp.editObjects();
FormElement objectForm = oep.addObject("Test.EditObjectsTestClass");
objectForm.setFieldValue(By.id("Test.EditObjectsTestClass_0_prop"), "choice 3");
vp = oep.clickSaveAndView();
Assert.assertEquals("this is the content: choice 3", vp.getContent());
// Change list to a multiple select.
cep = ClassEditPage.gotoPage("Test", "EditObjectsTestClass");
cep.getStaticListClassEditElement("prop").setMultiSelect(true);
vp = cep.clickSaveAndView();
Assert.assertEquals("this is the content", vp.getContent());
// Verify conversion
oep = ObjectEditPage.gotoPage("Test", "EditObjectsTestObject");
oep.getObjectsOfClass("Test.EditObjectsTestClass").get(0).setFieldValue(By.id("Test.EditObjectsTestClass_0_prop"), "choice 3");
oep.getObjectsOfClass("Test.EditObjectsTestClass").get(0).setFieldValue(By.id("Test.EditObjectsTestClass_0_prop"), "choice 4");
vp = oep.clickSaveAndView();
Assert.assertEquals("this is the content: choice 3 choice 4", vp.getContent());
}
use of org.xwiki.test.ui.browser.IgnoreBrowser in project xwiki-platform by xwiki.
the class EditObjectsTest method testChangeListTypeRelationalStorage.
/**
* Prove that a list can be changed from relational storage to plain storage and back without database corruption.
* XWIKI-1621: Changing parameters of list properties fails
*/
@Test
@IgnoreBrowser(value = "internet.*", version = "8\\.*", reason = "See https://jira.xwiki.org/browse/XE-1146")
public void testChangeListTypeRelationalStorage() {
// Create class page
WikiEditPage wep = WikiEditPage.gotoPage("Test", "EditObjectsTestClass");
wep.setContent("this is the content");
ViewPage vp = wep.clickSaveAndView();
// Add class
ClassEditPage cep = vp.editClass();
cep.addProperty("prop", "StaticList");
StaticListClassEditElement slcee = cep.getStaticListClassEditElement("prop");
slcee.setMultiSelect(true);
slcee.setDisplayType(StaticListClassEditElement.DisplayType.INPUT);
vp = cep.clickSaveAndView();
Assert.assertEquals("this is the content", vp.getContent());
// Create object page
wep = WikiEditPage.gotoPage("Test", "EditObjectsTestObject");
wep.setContent("this is the content: {{velocity}}$doc.display('prop'){{/velocity}}");
vp = wep.clickSaveAndView();
// Add object
ObjectEditPage oep = vp.editObjects();
FormElement objectForm = oep.addObject("Test.EditObjectsTestClass");
objectForm.setFieldValue(By.id("Test.EditObjectsTestClass_0_prop"), "this|that|other");
vp = oep.clickSaveAndView();
Assert.assertEquals("this is the content: this that other", vp.getContent());
// Change list to relational storage.
cep = ClassEditPage.gotoPage("Test", "EditObjectsTestClass");
cep.getStaticListClassEditElement("prop").setRelationalStorage(true);
vp = cep.clickSaveAndView();
Assert.assertEquals("this is the content", vp.getContent());
// Make sure we can still edit the object.
oep = ObjectEditPage.gotoPage("Test", "EditObjectsTestObject");
oep.getObjectsOfClass("Test.EditObjectsTestClass").get(0).setFieldValue(By.id("Test.EditObjectsTestClass_0_prop"), "this|other");
vp = oep.clickSaveAndView();
Assert.assertEquals("this is the content: this other", vp.getContent());
// Change list to non-relational storage.
cep = ClassEditPage.gotoPage("Test", "EditObjectsTestClass");
cep.getStaticListClassEditElement("prop").setRelationalStorage(false);
vp = cep.clickSaveAndView();
Assert.assertEquals("this is the content", vp.getContent());
// Make sure we can still edit the object.
oep = ObjectEditPage.gotoPage("Test", "EditObjectsTestObject");
oep.getObjectsOfClass("Test.EditObjectsTestClass").get(0).setFieldValue(By.id("Test.EditObjectsTestClass_0_prop"), "that|other");
vp = oep.clickSaveAndView();
Assert.assertEquals("this is the content: that other", vp.getContent());
}
use of org.xwiki.test.ui.browser.IgnoreBrowser in project xwiki-platform by xwiki.
the class LanguageTest method testChangeLanguageInMonolingualModeUsingTheAdministrationPreference.
@Test
@IgnoreBrowser(value = "internet.*", version = "8\\.*", reason = "See https://jira.xwiki.org/browse/XE-1146")
public void testChangeLanguageInMonolingualModeUsingTheAdministrationPreference() {
WikiEditPage edit = WikiEditPage.gotoPage("Test", "LanguageTest");
edit.setContent("{{velocity}}context = ($xcontext.language), doc = ($doc.language), " + "default = ($doc.defaultLanguage), tdoc = ($tdoc.language), " + "tdocdefault = ($tdoc.defaultLanguage){{/velocity}}");
ViewPage vp = edit.clickSaveAndView();
// Current language must be "en"
Assert.assertEquals("Invalid content", vp.getContent(), "context = (en), doc = (), default = (en), tdoc = (), tdocdefault = (en)");
// Change default language to "fr"
AdministrationPage adminPage = AdministrationPage.gotoPage();
LocalizationAdministrationSectionPage sectionPage = adminPage.clickLocalizationSection();
sectionPage.setDefaultLanguage("fr");
sectionPage.clickSave();
// Now language must be "fr"
vp = getUtil().gotoPage("Test", "LanguageTest");
Assert.assertTrue("Page not in French!", isPageInFrench());
Assert.assertEquals("Invalid content", vp.getContent(), "context = (fr), doc = (), default = (en), tdoc = (), tdocdefault = (en)");
}
Aggregations