diff --git a/testsuite/integration-arquillian/tests/base/src/main/java/org/keycloak/testsuite/pages/social/OpenShiftLoginPage.java b/testsuite/integration-arquillian/tests/base/src/main/java/org/keycloak/testsuite/pages/social/OpenShiftLoginPage.java index 055bf8e2f3..a883994697 100644 --- a/testsuite/integration-arquillian/tests/base/src/main/java/org/keycloak/testsuite/pages/social/OpenShiftLoginPage.java +++ b/testsuite/integration-arquillian/tests/base/src/main/java/org/keycloak/testsuite/pages/social/OpenShiftLoginPage.java @@ -17,6 +17,7 @@ package org.keycloak.testsuite.pages.social; +import org.keycloak.testsuite.util.WaitUtils; import org.openqa.selenium.By; import org.openqa.selenium.Keys; import org.openqa.selenium.NoSuchElementException; @@ -35,6 +36,9 @@ public class OpenShiftLoginPage extends AbstractSocialLoginPage { @FindBy(name = "password") private WebElement passwordInput; + @FindBy(name = "approve") + private WebElement authorizeButton; + private String userLoginLinkTitle; private WebElement userLoginLink; @@ -48,9 +52,18 @@ public class OpenShiftLoginPage extends AbstractSocialLoginPage { } } + WaitUtils.pause(3000); usernameInput.sendKeys(user); passwordInput.sendKeys(password); passwordInput.sendKeys(Keys.RETURN); + + try { + WaitUtils.pause(3000); + authorizeButton.click(); + } + catch (NoSuchElementException e) { + log.info("User already allowed in the app"); + } } public void setUserLoginLinkTitle(String title) { diff --git a/testsuite/integration-arquillian/tests/base/src/test/java/org/keycloak/testsuite/broker/SocialLoginTest.java b/testsuite/integration-arquillian/tests/base/src/test/java/org/keycloak/testsuite/broker/SocialLoginTest.java index 539c20da2c..85f8ebe4e1 100644 --- a/testsuite/integration-arquillian/tests/base/src/test/java/org/keycloak/testsuite/broker/SocialLoginTest.java +++ b/testsuite/integration-arquillian/tests/base/src/test/java/org/keycloak/testsuite/broker/SocialLoginTest.java @@ -250,7 +250,7 @@ public class SocialLoginTest extends AbstractKeycloakTest { public void openshiftLogin() { setTestProvider(OPENSHIFT); performLogin(); - assertUpdateProfile(false, false, true); + assertUpdateProfile(true, true, true); appPage.assertCurrent(); testTokenExchange(); }