KEYCLOAK-3381 Fix and stabilize some Console UI tests

This commit is contained in:
Vaclav Muzikar 2016-08-01 15:10:18 +02:00
parent a9ccabdce5
commit 0147fbe489
2 changed files with 10 additions and 10 deletions

View file

@ -77,10 +77,10 @@ public class PasswordPolicy extends Authentication {
public enum Type { public enum Type {
HASH_ITERATIONS("HashIterations"), LENGTH("Length"), DIGITS("Digits"), LOWER_CASE("LowerCase"), HASH_ITERATIONS("Hashing Iterations"), LENGTH("Minimum Length"), DIGITS("Digits"), LOWER_CASE("Lowercase Characters"),
UPPER_CASE("UpperCase"), SPECIAL_CHARS("SpecialChars"), NOT_USERNAME("NotUsername"), UPPER_CASE("Uppercase Characters"), SPECIAL_CHARS("Special Characters"), NOT_USERNAME("Not Username"),
REGEX_PATTERN("RegexPattern"), PASSWORD_HISTORY("PasswordHistory"), REGEX_PATTERN("Regular Expression"), PASSWORD_HISTORY("Not Recently Used"),
FORCE_EXPIRED_PASSWORD_CHANGE("ForceExpiredPasswordChange"); FORCE_EXPIRED_PASSWORD_CHANGE("Expire Password"), HASH_ALGORITHM("Hashing Algorithm");
private String name; private String name;

View file

@ -73,7 +73,7 @@ public class SecurityDefensesTest extends AbstractRealmTest {
@Test @Test
public void maxLoginFailuresTest() throws InterruptedException { public void maxLoginFailuresTest() throws InterruptedException {
final short secondsToWait = 3; final short secondsToWait = 10; // For slower browsers/webdrivers (like IE) we need higher value
final short maxLoginFailures = 2; final short maxLoginFailures = 2;
bruteForceDetectionPage.form().setProtectionEnabled(true); bruteForceDetectionPage.form().setProtectionEnabled(true);
@ -89,7 +89,7 @@ public class SecurityDefensesTest extends AbstractRealmTest {
@Test @Test
public void quickLoginCheck() throws InterruptedException { public void quickLoginCheck() throws InterruptedException {
final short secondsToWait = 3; final short secondsToWait = 10;
bruteForceDetectionPage.form().setProtectionEnabled(true); bruteForceDetectionPage.form().setProtectionEnabled(true);
bruteForceDetectionPage.form().setMaxLoginFailures("100"); bruteForceDetectionPage.form().setMaxLoginFailures("100");
@ -104,7 +104,7 @@ public class SecurityDefensesTest extends AbstractRealmTest {
@Test @Test
public void maxWaitLoginFailures() throws InterruptedException { public void maxWaitLoginFailures() throws InterruptedException {
final short secondsToWait = 5; final short secondsToWait = 15;
bruteForceDetectionPage.form().setProtectionEnabled(true); bruteForceDetectionPage.form().setProtectionEnabled(true);
bruteForceDetectionPage.form().setMaxLoginFailures("1"); bruteForceDetectionPage.form().setMaxLoginFailures("1");
@ -120,7 +120,7 @@ public class SecurityDefensesTest extends AbstractRealmTest {
@Test @Test
public void failureResetTime() throws InterruptedException { public void failureResetTime() throws InterruptedException {
final short failureResetTime = 3; final short failureResetTime = 3;
final short waitIncrement = 3; final short waitIncrement = 5;
bruteForceDetectionPage.form().setProtectionEnabled(true); bruteForceDetectionPage.form().setProtectionEnabled(true);
bruteForceDetectionPage.form().setMaxLoginFailures("1"); bruteForceDetectionPage.form().setMaxLoginFailures("1");
@ -199,8 +199,8 @@ public class SecurityDefensesTest extends AbstractRealmTest {
wait *= 1000; wait *= 1000;
log.debug("Wait: " + wait); log.info("Wait: " + wait);
Thread.sleep(wait); pause(wait);
if (finalLogin) { if (finalLogin) {
testRealmLoginPage.form().login(testUser); testRealmLoginPage.form().login(testUser);