Skip to content

Commit

Permalink
Updated to Selenium 4.13.0
Browse files Browse the repository at this point in the history
  • Loading branch information
wakaleo committed Sep 26, 2023
1 parent 937c9f5 commit ac8e34c
Show file tree
Hide file tree
Showing 14 changed files with 16 additions and 36 deletions.
2 changes: 1 addition & 1 deletion pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -62,7 +62,7 @@
<commons.net.version>3.9.0</commons.net.version>
<commons.codec.version>1.16.0</commons.codec.version>
<freemarker.version>2.3.32</freemarker.version>
<selenium.version>4.12.1</selenium.version>
<selenium.version>4.13.0</selenium.version>
<htmlunit.driver.version>4.10.0</htmlunit.driver.version>
<jsonassert.version>1.5.1</jsonassert.version>
<jsoup.version>1.15.4</jsoup.version>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,6 @@ public static FirefoxOptionsEnhancer enhanceOptions(FirefoxOptions options) {
}

public void using(EnvironmentVariables environmentVariables) {
options.setHeadless(HEADLESS_MODE.booleanFrom(environmentVariables,false));
options.setAcceptInsecureCerts(InsecureCertConfig.acceptInsecureCertsDefinedIn(environmentVariables).orElse(false));
FirefoxDriverLogLevel logLevel = FirefoxDriverLogLevel.fromString(FIREFOX_LOG_LEVEL.from(environmentVariables,"ERROR"));
options.setLogLevel(logLevel);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -95,13 +95,6 @@ public FirefoxOptions getOptions() {
firefoxOptions.addArguments(argValues);
registeredArguments.addAll(argValues);

//
// Special case for the headless mode
//
if(registeredArguments.contains("headless")) {
firefoxOptions.setHeadless(true);
}

firefoxCapabilities.forEach(
(key, value) -> {
if (!key.startsWith("preferences.")) {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -43,7 +43,7 @@ protected ChromeDriverService newDriverService() {
.withVerbose(verbose);

if (!whitelist.isEmpty()) {
builder.withWhitelistedIps(whitelist);
builder.withAllowedListIps(whitelist);
}
if (!logLevel.isEmpty()) {
builder.withLogLevel(ChromiumDriverLogLevel.fromString(logLevel));
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3,11 +3,14 @@
import java.io.File;
import java.io.IOException;
import java.net.URL;
import java.time.Duration;
import java.util.ArrayList;
import java.util.HashMap;

public class DisabledGeckoDriverService extends org.openqa.selenium.firefox.GeckoDriverService {

public DisabledGeckoDriverService() throws IOException {
super(new File(""), 0, null, null);
super(new File(""), 0, Duration.ofMillis(0), new ArrayList<>(), new HashMap<>());
}

public static DisabledGeckoDriverService build() {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,9 @@
import java.io.File;
import java.io.IOException;
import java.net.URL;
import java.time.Duration;
import java.util.ArrayList;
import java.util.HashMap;
import java.util.Optional;

/**
Expand All @@ -19,7 +22,7 @@ public class ThreadsafeGeckoDriverService extends GeckoDriverService {
private final EnvironmentVariables environmentVariables;

public ThreadsafeGeckoDriverService(EnvironmentVariables environmentVariables) throws IOException {
super(new File(""), 0, null, null);
super(new File(""), 0, Duration.ofMillis(0), new ArrayList<>(), new HashMap<>());
this.environmentVariables = environmentVariables;
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -48,9 +48,6 @@ public static ChromiumOptions<?> fromDesiredCapabilities(DesiredCapabilities cap
if (!args.isEmpty()) {
chromiumOptions.addArguments(args);
}
if (args.contains("headless") || args.contains("--headless")) {
chromiumOptions.setHeadless(true);
}
break;
// Extensions
case "extensions":
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -42,9 +42,6 @@ public static FirefoxOptions fromDesiredCapabilities(DesiredCapabilities capabil
if (options.get("args") instanceof List) {
List<String> args = ListOfValues.from(options).forProperty("args");
firefoxOptions.getBinary().addCommandLineOptions(args.toArray(new String[]{}));
if (args.contains("headless") || args.contains("-headless")) {
firefoxOptions.setHeadless(true);
}
}
break;

Expand Down

This file was deleted.

Original file line number Diff line number Diff line change
Expand Up @@ -122,7 +122,7 @@ public String getCsvContent() {
@Before
public void openLocalStaticSite() {
ChromeOptions options = new ChromeOptions();
options.setHeadless(true);
options.addArguments("--headless");
driver = new ChromeDriver(options);

openStaticTestSite();
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@ public class CheckingFieldContentWithTheFluentElementAPI {
@BeforeClass
public static void openStaticPage() {
ChromeOptions options = new ChromeOptions();
options.setHeadless(true);
options.addArguments("--headless");
localDriver = new ChromeDriver(options);
page = new StaticSitePage(localDriver);
page.open();
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@ public class CheckingShadowDomContentWithTheFluentElementAPI {
@BeforeClass
public static void openStaticPage() {
ChromeOptions options = new ChromeOptions();
options.setHeadless(true);
options.addArguments("--headless");
localDriver = new ChromeDriver(options);
page = new ShadowDomSitePage(localDriver);
page.open();
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -1141,7 +1141,7 @@ public enum ThucydidesSystemProperty {
DELETE_HISTORY_DIRECTORY,

/**
* Generate a CSV report for each test result (true by default)
* Generate a CSV report for each test result (false by default)
*/
SERENITY_GENERATE_CSV_REPORTS,

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -6,8 +6,8 @@
import net.serenitybdd.screenplay.webtests.integration.ScreenplayInteractionTestBase;
import org.junit.Test;
import org.junit.runner.RunWith;
import org.openqa.selenium.devtools.v114.performance.Performance;
import org.openqa.selenium.devtools.v114.performance.model.Metric;
import org.openqa.selenium.devtools.v117.performance.Performance;
import org.openqa.selenium.devtools.v117.performance.model.Metric;

import java.util.ArrayList;
import java.util.List;
Expand Down

0 comments on commit ac8e34c

Please sign in to comment.