Update login flow in OCP social login

This commit is contained in:
wojnarfilip 2023-09-18 12:59:36 +02:00 committed by Bruno Oliveira da Silva
parent b3e6208eec
commit f9386bd62b
2 changed files with 14 additions and 1 deletions

View file

@ -17,6 +17,7 @@
package org.keycloak.testsuite.pages.social; package org.keycloak.testsuite.pages.social;
import org.keycloak.testsuite.util.WaitUtils;
import org.openqa.selenium.By; import org.openqa.selenium.By;
import org.openqa.selenium.Keys; import org.openqa.selenium.Keys;
import org.openqa.selenium.NoSuchElementException; import org.openqa.selenium.NoSuchElementException;
@ -35,6 +36,9 @@ public class OpenShiftLoginPage extends AbstractSocialLoginPage {
@FindBy(name = "password") @FindBy(name = "password")
private WebElement passwordInput; private WebElement passwordInput;
@FindBy(name = "approve")
private WebElement authorizeButton;
private String userLoginLinkTitle; private String userLoginLinkTitle;
private WebElement userLoginLink; private WebElement userLoginLink;
@ -48,9 +52,18 @@ public class OpenShiftLoginPage extends AbstractSocialLoginPage {
} }
} }
WaitUtils.pause(3000);
usernameInput.sendKeys(user); usernameInput.sendKeys(user);
passwordInput.sendKeys(password); passwordInput.sendKeys(password);
passwordInput.sendKeys(Keys.RETURN); 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) { public void setUserLoginLinkTitle(String title) {

View file

@ -250,7 +250,7 @@ public class SocialLoginTest extends AbstractKeycloakTest {
public void openshiftLogin() { public void openshiftLogin() {
setTestProvider(OPENSHIFT); setTestProvider(OPENSHIFT);
performLogin(); performLogin();
assertUpdateProfile(false, false, true); assertUpdateProfile(true, true, true);
appPage.assertCurrent(); appPage.assertCurrent();
testTokenExchange(); testTokenExchange();
} }