parent
217a09ce46
commit
5603ee7b46
1 changed files with 21 additions and 0 deletions
|
@ -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");
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
Loading…
Reference in a new issue