Use new headless setup method

This commit is contained in:
Aurora Lahtela 2024-01-27 09:31:03 +02:00
parent 39265157fd
commit 2e98f12f0c

View File

@ -49,7 +49,7 @@ public class SeleniumExtension implements ParameterResolver, BeforeAllCallback,
public static void waitForPageLoadForSeconds(int i, ChromeDriver driver) {
Awaitility.await("waitForPageLoadForSeconds")
.atMost(5, TimeUnit.SECONDS)
.atMost(i, TimeUnit.SECONDS)
.until(() -> "complete".equals(driver.executeScript("return document.readyState")));
}
@ -92,7 +92,7 @@ public class SeleniumExtension implements ParameterResolver, BeforeAllCallback,
// Using environment variable assumes linux
if (System.getenv(CIProperties.CHROME_DRIVER) != null) {
chromeOptions.setBinary("/usr/bin/google-chrome-stable");
chromeOptions.setHeadless(true);
chromeOptions.addArguments("--headless=new");
}
return new ChromeDriver(chromeOptions);