Fix LoginForm.registerLink

(cherry picked from commit 6414232)
This commit is contained in:
Vaclav Muzikar 2016-02-08 13:51:14 +01:00
parent 97d0f39346
commit ec2cfba670
2 changed files with 6 additions and 7 deletions

View file

@ -42,7 +42,7 @@ public class LoginForm extends Form {
// @FindBy(name = "cancel")
// private WebElement cancelButton;
@FindBy(linkText = "Register")
@FindBy(xpath = "//div[@id='kc-registration']/span/a")
private WebElement registerLink;
@FindBy(linkText = "Forgot Password?")
private WebElement forgottenPassword;

View file

@ -70,8 +70,9 @@ public class RegistrationTest extends AbstractAccountManagementTest {
}
public void assertMessageAttributeMissing(String attributeName) {
assertTrue(testRealmRegistrationPage.getFeedbackText()
.contains("Please specify " + attributeName + "."));
String feedbackTest = testRealmRegistrationPage.getFeedbackText();
String contains = "Please specify " + attributeName + ".";
assertTrue("'" + contains + "' doesn't contain '" + feedbackTest + "'", feedbackTest.contains(contains));
}
@Test
@ -84,8 +85,7 @@ public class RegistrationTest extends AbstractAccountManagementTest {
public void invalidEmail() {
newUser.setEmail("invalid.email.value");
testRealmRegistrationPage.register(newUser);
assertTrue(testRealmRegistrationPage.getFeedbackText()
.equals("Invalid email address."));
assertEquals("Invalid email address.", testRealmRegistrationPage.getFeedbackText());
assertUserDoesntExistWithAdminClient(newUser);
}
@ -121,8 +121,7 @@ public class RegistrationTest extends AbstractAccountManagementTest {
public void notMatchingPasswords() {
testRealmRegistrationPage.setValues(newUser, "not-matching-password");
testRealmRegistrationPage.submit();
assertTrue(testRealmRegistrationPage.getFeedbackText()
.equals("Password confirmation doesn't match."));
assertEquals("Password confirmation doesn't match.", testRealmRegistrationPage.getFeedbackText());
testRealmRegistrationPage.register(newUser);
assertUserExistsWithAdminClient(newUser);