mirror of
https://github.com/keycloak/keycloak.git
synced 2026-02-20 14:19:13 -06:00
Fixes login flow in Microsoft social login test
Closes #22657
(cherry picked from commit 5603ee7b46)
This commit is contained in:
committed by
Alexander Schwartz
parent
932ca6e02c
commit
e5e010aa29
@@ -35,6 +35,9 @@ public class MicrosoftLoginPage extends AbstractSocialLoginPage {
|
||||
@FindBy(id = "idSIButton9")
|
||||
private WebElement submitButton;
|
||||
|
||||
@FindBy(xpath = "//input[contains(@class,'btn-primary')]")
|
||||
private WebElement appAccessButton;
|
||||
|
||||
@Override
|
||||
public void login(String user, String password) {
|
||||
WaitUtils.pause(5000); // we need to take it a bit slower
|
||||
@@ -50,5 +53,23 @@ public class MicrosoftLoginPage extends AbstractSocialLoginPage {
|
||||
catch (NoSuchElementException e) {
|
||||
log.info("Already logged in to Microsoft IdP, no need to enter password");
|
||||
}
|
||||
|
||||
// While logging into the app for the first time user is asked if he wants to stay signed in
|
||||
try {
|
||||
WaitUtils.pause(3000);
|
||||
submitButton.click();
|
||||
}
|
||||
catch (NoSuchElementException e) {
|
||||
log.info("User already allowed in the app");
|
||||
}
|
||||
|
||||
// The app requires user consent for access to their information
|
||||
try {
|
||||
WaitUtils.pause(3000);
|
||||
appAccessButton.click();
|
||||
}
|
||||
catch (NoSuchElementException e) {
|
||||
log.info("App already has access to user information");
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user