@Feature(summary = "The user's email address change is validated",
tcmsTestPlanIds = 5316, tcmsTestCaseIds = 86822)
@Test(timeout = ZanataTestCase.MAX_SHORT_TEST_DURATION)
public void emailValidationIsUsedOnProfileEdit() throws Exception {
DashboardAccountTab dashboardAccountTab = new LoginWorkFlow()
.signIn("translator", "translator")
.goToSettingsTab()
.gotoSettingsAccountTab()
.typeNewAccountEmailAddress("admin@example.com")
.clickUpdateEmailButton();
assertThat(dashboardAccountTab.expectError(
DashboardAccountTab.EMAIL_TAKEN_ERROR))
.contains(DashboardAccountTab.EMAIL_TAKEN_ERROR)
.as("The email is rejected, being already taken");
dashboardAccountTab = dashboardAccountTab
.goToMyDashboard()
.goToSettingsTab()
.gotoSettingsAccountTab()
.typeNewAccountEmailAddress("test @example.com")
.clickUpdateEmailButton();
assertThat(dashboardAccountTab.expectError(
RegisterPage.MALFORMED_EMAIL_ERROR))
.contains(RegisterPage.MALFORMED_EMAIL_ERROR)
.as("The email is rejected, being of invalid format");
}