diff --git a/src/test/java/BasicTest.java b/src/test/java/BasicTest.java index adea696..1e53556 100644 --- a/src/test/java/BasicTest.java +++ b/src/test/java/BasicTest.java @@ -40,14 +40,21 @@ public class BasicTest { public void verifyLoginAsSystemUser() { driver.navigate().to(URL); System.out.println("Navigate to: " + URL); - String body = driver.getPageSource(); - System.out.println("HTML: " + body); - String scaleInfo = driver.findElement(By.xpath("/table[@class='loginall']/tr/td[0]/div")).getText(); - System.out.println("Scale: " + scaleInfo); + // String body = driver.getPageSource(); + // System.out.println("HTML: " + body); + + if (driver.findElements( By.id("privacy-cookie-statement") ).size() != 0) { + System.out.println("Cookies consent page is shown"); + WebElement consentButton = driver.findElement(By.id("opt-in-button-allow")); + consentButton.click(); + } // WebElement loginButton = wait.until(ExpectedConditions.elementToBeClickable(By.name("doLogin"))); WebElement loginButton = wait.until(ExpectedConditions.visibilityOf(driver.findElement(By.name("doLogin")))); + String scaleInfo = driver.findElement(By.xpath("/table[@class='loginall']/tr/td[0]/div")).getText(); + System.out.println("Scale: " + scaleInfo); + driver.findElement(By.name("login")).sendKeys("system"); driver.findElement(By.name("password")).sendKeys("system"); loginButton.click();