Fix issue with overlapping WebElements in SocialLoginTest#PaypalLogin
Closes #23960
This commit is contained in:
parent
427cd4b290
commit
b5ec155b64
1 changed files with 10 additions and 6 deletions
|
@ -17,12 +17,12 @@
|
||||||
|
|
||||||
package org.keycloak.testsuite.pages.social;
|
package org.keycloak.testsuite.pages.social;
|
||||||
|
|
||||||
|
import org.keycloak.testsuite.util.WaitUtils;
|
||||||
|
import org.openqa.selenium.JavascriptExecutor;
|
||||||
import org.openqa.selenium.NoSuchElementException;
|
import org.openqa.selenium.NoSuchElementException;
|
||||||
import org.openqa.selenium.WebElement;
|
import org.openqa.selenium.WebElement;
|
||||||
import org.openqa.selenium.support.FindBy;
|
import org.openqa.selenium.support.FindBy;
|
||||||
|
|
||||||
import static org.keycloak.testsuite.util.UIUtils.clickLink;
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @author Petter Lysne (petterlysne at hotmail dot com)
|
* @author Petter Lysne (petterlysne at hotmail dot com)
|
||||||
*/
|
*/
|
||||||
|
@ -44,12 +44,14 @@ public class PayPalLoginPage extends AbstractSocialLoginPage {
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public void login(String user, String password) {
|
public void login(String user, String password) {
|
||||||
|
JavascriptExecutor executor = (JavascriptExecutor) driver;
|
||||||
try {
|
try {
|
||||||
usernameInput.clear(); // to remove pre-filled email
|
usernameInput.clear(); // to remove pre-filled email
|
||||||
usernameInput.sendKeys(user);
|
usernameInput.sendKeys(user);
|
||||||
|
|
||||||
|
WaitUtils.pause(3000);
|
||||||
try {
|
try {
|
||||||
clickLink(nextButton); // sometimes the login process is just a one step,
|
executor.executeScript("arguments[0].click();", nextButton); // sometimes the login process is just a one step,
|
||||||
// sometimes it's two steps so we need to click the 'Next' button
|
// sometimes it's two steps so we need to click the 'Next' button
|
||||||
}
|
}
|
||||||
catch (NoSuchElementException e) {
|
catch (NoSuchElementException e) {
|
||||||
|
@ -57,10 +59,12 @@ public class PayPalLoginPage extends AbstractSocialLoginPage {
|
||||||
}
|
}
|
||||||
|
|
||||||
passwordInput.sendKeys(password);
|
passwordInput.sendKeys(password);
|
||||||
clickLink(loginButton);
|
WaitUtils.pause(3000);
|
||||||
|
executor.executeScript("arguments[0].click();", loginButton);
|
||||||
}
|
}
|
||||||
catch (NoSuchElementException e) {
|
catch (NoSuchElementException e) {
|
||||||
clickLink(continueLoginButton); // already logged in, just need to confirm it
|
WaitUtils.pause(3000);
|
||||||
|
executor.executeScript("arguments[0].click();", continueLoginButton); // already logged in, just need to confirm it
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in a new issue