Skip to content
This repository has been archived by the owner on Nov 9, 2017. It is now read-only.

Commit

Permalink
test cater for randomly selected error message
Browse files Browse the repository at this point in the history
  • Loading branch information
Patrick Huang committed Sep 4, 2013
1 parent b370025 commit f9e65e7
Showing 1 changed file with 5 additions and 7 deletions.
Expand Up @@ -116,11 +116,6 @@ public void invalidResetPasswordFieldEntries()
@Test
public void emptyResetPasswordFieldEntries()
{
// Both are valid, but show seemingly at random
List<String> emptyUsernameErrors = new ArrayList<String>();
emptyUsernameErrors.add("size must be between 3 and 20");
emptyUsernameErrors.add("must match ^[a-z\\d_]{3,20}$");

SignInPage signInPage = new BasicWorkFlow().goToHome().clickSignInLink();
ResetPasswordPage resetPasswordPage = signInPage.gotToResetPassword();
resetPasswordPage = resetPasswordPage.clearFields();
Expand All @@ -129,8 +124,11 @@ public void emptyResetPasswordFieldEntries()
assertThat("Empty email error is displayed", resetPasswordPage.waitForErrors(),
hasItem("may not be empty"));


assertThat(resetPasswordPage.getErrors().get(0), equalTo("may not be empty"));
// All are valid, but may show at random
assertThat(resetPasswordPage.getErrors().get(0),
either(equalTo("size must be between 3 and 20"))
.or(equalTo("may not be empty"))
.or(equalTo("must match ^[a-z\\d_]{3,20}$")));

}

Expand Down

0 comments on commit f9e65e7

Please sign in to comment.