Skip to content

Commit

Permalink
- update
Browse files Browse the repository at this point in the history
  • Loading branch information
IvanAksionau committed Aug 17, 2023
1 parent dcece85 commit 7504adf
Show file tree
Hide file tree
Showing 4 changed files with 10 additions and 6 deletions.
6 changes: 6 additions & 0 deletions src/test/java/com/ea/springbasic/pages/ComingSoonPage.java
Original file line number Diff line number Diff line change
Expand Up @@ -17,11 +17,17 @@ public class ComingSoonPage extends BasePage {
@FindBy(id = "Password")
private WebElement passwordInput;

@FindBy(xpath = "//button[contains(text(),'Accept all')]")
private WebElement acceptCookiesButton;

public void clickActivatePasswordInput() {
enterUsingPasswordButton.click();
}

public void login(String password) {
fluentWait.until(ExpectedConditions.elementToBeClickable(acceptCookiesButton));
acceptCookiesButton.click();
enterUsingPasswordButton.click();
webDriverWait.until(ExpectedConditions.elementToBeClickable(passwordInput));
passwordInput.sendKeys(password);
passwordInput.sendKeys(Keys.ENTER);
Expand Down
5 changes: 0 additions & 5 deletions src/test/java/com/ea/springbasic/pages/HomePage.java
Original file line number Diff line number Diff line change
Expand Up @@ -17,9 +17,6 @@ public class HomePage extends BasePage {
@FindBy(xpath = "//a[@href='/collections/apparel']")
private WebElement shopNowButton;

@FindBy(xpath = "//button[contains(text(),'Accept all')]")
private WebElement acceptCookiesButton;

public void clickLoginAccountButton() {
loginAccountButton.click();
}
Expand All @@ -30,8 +27,6 @@ public void clickShopNowButton() {

@Override
public boolean isDisplayed() {
fluentWait.until(ExpectedConditions.elementToBeClickable(acceptCookiesButton));
acceptCookiesButton.click();
return fluentWait.until((d) -> defaultLogo.isEnabled());
}
}
4 changes: 4 additions & 0 deletions src/test/java/com/ea/springbasic/pages/LoginPage.java
Original file line number Diff line number Diff line change
Expand Up @@ -19,10 +19,14 @@ public class LoginPage extends BasePage {
@FindBy(xpath = "//button[@type='submit']")
private WebElement submitButton;

@FindBy(xpath = "//button//span[@class='show']")
private WebElement showButton;

public void login(String email, String password) {
customerEmailInput.sendKeys(email);
this.passwordInput.sendKeys(password);
fluentWait.until((d) -> submitButton.getAttribute("aria-disabled").equals("false"));
showButton.click();
submitButton.click();
}

Expand Down
1 change: 0 additions & 1 deletion src/test/java/com/ea/springbasic/steps/Hooks.java
Original file line number Diff line number Diff line change
Expand Up @@ -65,7 +65,6 @@ public void setup(Scenario scenario) {
webDriver.manage().window().maximize();

if (env.equals("dev")) {
comingSoonPage.clickActivatePasswordInput();
comingSoonPage.login(systemPassword);
}
}
Expand Down

0 comments on commit 7504adf

Please sign in to comment.