diff --git a/testsuite/integration-arquillian/tests/base/src/main/java/org/keycloak/testsuite/arquillian/SuiteContext.java b/testsuite/integration-arquillian/tests/base/src/main/java/org/keycloak/testsuite/arquillian/SuiteContext.java index b99d6b3b45..589c316211 100644 --- a/testsuite/integration-arquillian/tests/base/src/main/java/org/keycloak/testsuite/arquillian/SuiteContext.java +++ b/testsuite/integration-arquillian/tests/base/src/main/java/org/keycloak/testsuite/arquillian/SuiteContext.java @@ -10,14 +10,24 @@ import static org.keycloak.testsuite.util.MailServerConfiguration.*; */ public final class SuiteContext { + private boolean adminPasswordUpdated; private final Map smtpServer = new HashMap<>(); public SuiteContext() { + this.adminPasswordUpdated = false; smtpServer.put("from", FROM); smtpServer.put("host", HOST); smtpServer.put("port", PORT); } + public boolean isAdminPasswordUpdated() { + return adminPasswordUpdated; + } + + public void setAdminPasswordUpdated(boolean adminPasswordUpdated) { + this.adminPasswordUpdated = adminPasswordUpdated; + } + public Map getSmtpServer() { return smtpServer; } diff --git a/testsuite/integration-arquillian/tests/base/src/test/java/org/keycloak/testsuite/AbstractKeycloakTest.java b/testsuite/integration-arquillian/tests/base/src/test/java/org/keycloak/testsuite/AbstractKeycloakTest.java index 9400f77adf..ba4572848d 100644 --- a/testsuite/integration-arquillian/tests/base/src/test/java/org/keycloak/testsuite/AbstractKeycloakTest.java +++ b/testsuite/integration-arquillian/tests/base/src/test/java/org/keycloak/testsuite/AbstractKeycloakTest.java @@ -89,6 +89,12 @@ public abstract class AbstractKeycloakTest { driverSettings(); + if (!suiteContext.isAdminPasswordUpdated()) { + log.debug("updating admin password"); + updateMasterAdminPassword(); + suiteContext.setAdminPasswordUpdated(true); + } + importTestRealms(); } @@ -99,6 +105,13 @@ public abstract class AbstractKeycloakTest { Timer.printStats(); } + private void updateMasterAdminPassword() { + welcomePage.navigateTo(); + if (!welcomePage.isPasswordSet()) { + welcomePage.setPassword("admin", "admin"); + } + } + public void deleteAllCookiesForMasterRealm() { masterRealmPage.navigateTo(); log.debug("deleting cookies in master realm");