From 79dff1996867f15ca58365c311a5770096b02ba7 Mon Sep 17 00:00:00 2001 From: Damian Jansen Date: Tue, 24 Feb 2015 11:20:42 +1000 Subject: [PATCH] Fix security functional test error --- .../org/zanata/feature/security/SecurityTest.java | 11 ++++++----- 1 file changed, 6 insertions(+), 5 deletions(-) diff --git a/functional-test/src/test/java/org/zanata/feature/security/SecurityTest.java b/functional-test/src/test/java/org/zanata/feature/security/SecurityTest.java index 3b7ffc4cf4..e3583c8f86 100644 --- a/functional-test/src/test/java/org/zanata/feature/security/SecurityTest.java +++ b/functional-test/src/test/java/org/zanata/feature/security/SecurityTest.java @@ -141,12 +141,13 @@ public void invalidResetPasswordFieldEntries() { .contains("not a well-formed email address") .as("Invalid email error is displayed"); - String error = resetPasswordPage.getErrors().get(0); // Both are valid, but show seemingly at random - assertThat(error.equals("size must be between 3 and 20") || - error.equals("must match ^[a-z\\d_]{3,20}$")) - .isTrue() - .as("Invalid email error is displayed"); + assertThat(resetPasswordPage.getErrors().get(0)) + .isIn("Between 3 and 20 lowercase letters, numbers and " + + "underscores only", + "size must be between 3 and 20", + "must match ^[a-z\\d_]{3,20}$") + .as("Invalid username error is displayed"); } @Feature(summary = "The user must enter both an account name and email " +