@IgnoreBrowser(value = "internet.*", version = "8\\.*", reason="See http://jira.xwiki.org/browse/XE-1146"),
@IgnoreBrowser(value = "internet.*", version = "9\\.*", reason="See http://jira.xwiki.org/browse/XE-1177")
})
public void testEmptyAppNameWithEnter()
{
ApplicationCreatePage appCreatePage = ApplicationCreatePage.gotoPage();
Assert.assertFalse(appCreatePage.getContent().contains(EMPTY_APP_NAME_ERROR_MESSAGE));
// Press Enter key without typing the application name.
appCreatePage.getApplicationNameInput().sendKeys(Keys.RETURN);
appCreatePage.waitForApplicationNameError();
Assert.assertTrue(appCreatePage.getContent().contains(EMPTY_APP_NAME_ERROR_MESSAGE));
// Type the application name.
appCreatePage.setApplicationName("B");
appCreatePage.waitForApplicationNamePreview();
Assert.assertFalse(appCreatePage.getContent().contains(EMPTY_APP_NAME_ERROR_MESSAGE));
// Clear the application name using the Backspace key.
appCreatePage.getApplicationNameInput().sendKeys(Keys.BACK_SPACE);
appCreatePage.waitForApplicationNameError();
Assert.assertTrue(appCreatePage.getContent().contains(EMPTY_APP_NAME_ERROR_MESSAGE));
// Try to create the application even if the error message is displayed.
appCreatePage.getApplicationNameInput().sendKeys(Keys.RETURN);
Assert.assertTrue(appCreatePage.getContent().contains(EMPTY_APP_NAME_ERROR_MESSAGE));
// Fix the application name and move to the next step using the Enter key.
appCreatePage.setApplicationName(getTestMethodName());
appCreatePage.waitForApplicationNamePreview();
appCreatePage.getApplicationNameInput().sendKeys(Keys.RETURN);
Assert.assertEquals("Class: " + getTestMethodName(), new ViewPage().getDocumentTitle());
}