use of org.xwiki.test.ui.browser.IgnoreBrowsers in project xwiki-platform by xwiki.
the class ClassEditorTest method testDuplicateFieldName.
/**
* Tests that two class fields can't have the same name.
*/
@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 testDuplicateFieldName() {
ClassFieldEditPane field = editor.addField("Short Text");
field.setPrettyName("Alice");
field.openConfigPanel();
field.setName("carol");
field = editor.addField("Short Text");
field.setPrettyName("Bob");
field.openConfigPanel();
field.setName("carol");
// Save the page and expect the error.
editor.getSaveAndViewButton().click();
waitForPageSourceContains("The class has two fields with the same name: carol");
}
use of org.xwiki.test.ui.browser.IgnoreBrowsers in project xwiki-platform by xwiki.
the class ClassEditorTest method testFieldNameAutoGeneration.
/**
* Tests that fields names are auto-generated properly.
*/
@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 testFieldNameAutoGeneration() {
// Add a class field and set its name to an auto-generated field name for a different type.
ClassFieldEditPane field = editor.addField("Short Text");
field.openConfigPanel();
field.setName("number1");
editor.clickSaveAndContinue();
// Add a new field of the type implied by the name set to the previous field.
field = editor.addField("Number");
field.openConfigPanel();
Assert.assertEquals("number2", field.getName());
// Save and assert both fields have been added.
ViewPage viewer = editor.clickSaveAndView();
Assert.assertTrue(viewer.getContent().contains("Short Text (number1: String)"));
Assert.assertTrue(viewer.getContent().contains("Number (number2: Number)"));
}
use of org.xwiki.test.ui.browser.IgnoreBrowsers in project xwiki-platform by xwiki.
the class ClassEditorTest method testApplyConfigurationChanges.
/**
* Tests that the field display is updated when the configuration panel is closed.
*/
@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 testApplyConfigurationChanges() {
LongTextClassFieldEditPane longTextField = new LongTextClassFieldEditPane(editor.addField("Long Text").getName());
longTextField.openConfigPanel();
longTextField.setRows(3);
longTextField.setEditor("Text");
longTextField.closeConfigPanel();
Assert.assertEquals(3, longTextField.getPreviewRows());
}
use of org.xwiki.test.ui.browser.IgnoreBrowsers in project xwiki-platform by xwiki.
the class ClassEditorTest method testReorderFields.
/**
* Tests that class fields can be reordered.
*/
@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 testReorderFields() {
// Add two class fields.
editor.addField("Date").setPrettyName("Start Date");
editor.addField("Date").setPrettyName("End Date");
// Save and edit the class template in in-line edit mode.
editor.clickSaveAndView();
new ClassSheetPage().clickTemplateLink().edit();
// Assert the order of the form fields.
List<String> fieldNames = new EntryEditPage().getFieldNames();
Assert.assertEquals("date1", fieldNames.get(0));
Assert.assertEquals("date2", fieldNames.get(1));
// Go back to the class editor.
getDriver().navigate().back();
getDriver().navigate().back();
new ViewPage().edit();
editor = new ApplicationClassEditPage();
// Change the order of the class fields.
editor.moveFieldBefore("date2", "date1");
// Save and edit the class template again.
editor.clickSaveAndView();
new ClassSheetPage().clickTemplateLink().edit();
// Assert the order of the form fields.
fieldNames = new EntryEditPage().getFieldNames();
Assert.assertEquals("date2", fieldNames.get(0));
Assert.assertEquals("date1", fieldNames.get(1));
}
use of org.xwiki.test.ui.browser.IgnoreBrowsers in project xwiki-platform by xwiki.
the class LoginTest method testLoginWithInvalidUsername.
@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 testLoginWithInvalidUsername() {
LoginPage loginPage = this.vp.login();
loginPage.loginAs("non existent user", "admin");
Assert.assertTrue(loginPage.hasInvalidCredentialsErrorMessage());
}
Aggregations