Skip to content

Commit c80ea48

Browse files
Update dependency org.seleniumhq.selenium:selenium-java to v4.20.0 (#1689)
* Update dependency org.seleniumhq.selenium:selenium-java to v4.20.0 ------ Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com> Co-authored-by: Diego Molina <[email protected]> Co-authored-by: Diego Molina <[email protected]>
1 parent 3f85858 commit c80ea48

File tree

8 files changed

+39
-29
lines changed

8 files changed

+39
-29
lines changed

.github/workflows/java-examples.yml

+21-3
Original file line numberDiff line numberDiff line change
@@ -58,12 +58,30 @@ jobs:
5858
command: |
5959
cd examples/java
6060
mvn -B test
61-
- name: Run Tests Nightly
62-
if: matrix.release == 'nightly'
61+
- name: Run Tests Nightly Linux/macOS
62+
if: matrix.release == 'nightly' && matrix.os != 'windows-latest'
6363
uses: nick-invision/[email protected]
6464
with:
6565
timeout_minutes: 20
6666
max_attempts: 3
6767
command: |
68+
pip install yq
69+
xml_content=$(curl -sf https://oss.sonatype.org/service/local/repositories/snapshots/content/org/seleniumhq/selenium/selenium-java/)
70+
latest_snapshot=$(echo $xml_content | xq '.content.data."content-item"' | jq -r 'sort_by(.lastModified) | reverse | .[0] | .text')
71+
echo $latest_snapshot
6872
cd examples/java
69-
mvn -B -U test -Dselenium.version=4.20.0-SNAPSHOT
73+
mvn -B -U test -Dselenium.version="$latest_snapshot"
74+
75+
- name: Run Tests Nightly Windows
76+
if: matrix.release == 'nightly' && matrix.os == 'windows-latest'
77+
uses: nick-invision/[email protected]
78+
with:
79+
timeout_minutes: 20
80+
max_attempts: 3
81+
command: |
82+
pip install yq
83+
$xml_content = Invoke-WebRequest -Uri "https://oss.sonatype.org/service/local/repositories/snapshots/content/org/seleniumhq/selenium/selenium-java/"
84+
$latest_snapshot = $xml_content.Content | xq '.content.data.\"content-item\"' | jq -r 'sort_by(.lastModified) | reverse | .[0] | .text'
85+
Write-Output $latest_snapshot
86+
cd examples/java
87+
mvn -B -U test "-Dselenium.version=$latest_snapshot"

examples/java/build.gradle

+1-1
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@ repositories {
1010
}
1111

1212
dependencies {
13-
testImplementation 'org.seleniumhq.selenium:selenium-java:4.19.1'
13+
testImplementation 'org.seleniumhq.selenium:selenium-java:4.20.0'
1414
testImplementation 'org.junit.jupiter:junit-jupiter-engine:5.10.2'
1515
}
1616

examples/java/pom.xml

+1-1
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,7 @@
1313
<maven.compiler.source>11</maven.compiler.source>
1414
<maven.compiler.target>11</maven.compiler.target>
1515
<project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
16-
<selenium.version>4.19.1</selenium.version>
16+
<selenium.version>4.20.0</selenium.version>
1717
</properties>
1818

1919
<repositories>

examples/java/src/test/java/dev/selenium/bidirectional/chrome_devtools/CdpApiTest.java

+7-7
Original file line numberDiff line numberDiff line change
@@ -23,12 +23,12 @@
2323
import org.openqa.selenium.chrome.ChromeOptions;
2424
import org.openqa.selenium.devtools.DevTools;
2525
import org.openqa.selenium.devtools.HasDevTools;
26-
import org.openqa.selenium.devtools.v121.browser.Browser;
27-
import org.openqa.selenium.devtools.v121.network.Network;
28-
import org.openqa.selenium.devtools.v121.network.model.Headers;
29-
import org.openqa.selenium.devtools.v121.performance.Performance;
30-
import org.openqa.selenium.devtools.v121.performance.model.Metric;
31-
import org.openqa.selenium.devtools.v121.runtime.Runtime;
26+
import org.openqa.selenium.devtools.v124.browser.Browser;
27+
import org.openqa.selenium.devtools.v124.network.Network;
28+
import org.openqa.selenium.devtools.v124.network.model.Headers;
29+
import org.openqa.selenium.devtools.v124.performance.Performance;
30+
import org.openqa.selenium.devtools.v124.performance.model.Metric;
31+
import org.openqa.selenium.devtools.v124.runtime.Runtime;
3232
import org.openqa.selenium.support.ui.WebDriverWait;
3333

3434
public class CdpApiTest extends BaseTest {
@@ -37,7 +37,7 @@ public class CdpApiTest extends BaseTest {
3737
@BeforeEach
3838
public void createSession() {
3939
ChromeOptions options = new ChromeOptions();
40-
options.setBrowserVersion("121");
40+
options.setBrowserVersion("124");
4141
driver = new ChromeDriver(options);
4242
wait = new WebDriverWait(driver, Duration.ofSeconds(10));
4343
}

examples/java/src/test/java/dev/selenium/browsers/ChromeTest.java

+2-4
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,6 @@
2222
import org.openqa.selenium.logging.LogEntries;
2323
import org.openqa.selenium.logging.LogType;
2424
import org.openqa.selenium.logging.LoggingPreferences;
25-
import org.openqa.selenium.manager.SeleniumManagerOutput;
2625
import org.openqa.selenium.remote.service.DriverFinder;
2726

2827
public class ChromeTest extends BaseTest {
@@ -177,8 +176,7 @@ public void disableBuildChecks() throws IOException {
177176
private File getChromeLocation() {
178177
ChromeOptions options = new ChromeOptions();
179178
options.setBrowserVersion("stable");
180-
SeleniumManagerOutput.Result output =
181-
DriverFinder.getPath(ChromeDriverService.createDefaultService(), options);
182-
return new File(output.getBrowserPath());
179+
DriverFinder finder = new DriverFinder(ChromeDriverService.createDefaultService(), options);
180+
return new File(finder.getBrowserPath());
183181
}
184182
}

examples/java/src/test/java/dev/selenium/browsers/EdgeTest.java

+2-4
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,6 @@
2222
import org.openqa.selenium.logging.LogEntries;
2323
import org.openqa.selenium.logging.LogType;
2424
import org.openqa.selenium.logging.LoggingPreferences;
25-
import org.openqa.selenium.manager.SeleniumManagerOutput;
2625
import org.openqa.selenium.remote.service.DriverFinder;
2726

2827
public class EdgeTest extends BaseTest {
@@ -171,8 +170,7 @@ public void disableBuildChecks() throws IOException {
171170
private File getEdgeLocation() {
172171
EdgeOptions options = new EdgeOptions();
173172
options.setBrowserVersion("stable");
174-
SeleniumManagerOutput.Result output =
175-
DriverFinder.getPath(EdgeDriverService.createDefaultService(), options);
176-
return new File(output.getBrowserPath());
173+
DriverFinder finder = new DriverFinder(EdgeDriverService.createDefaultService(), options);
174+
return new File(finder.getBrowserPath());
177175
}
178176
}

examples/java/src/test/java/dev/selenium/browsers/FirefoxTest.java

+2-4
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,6 @@
1919
import org.openqa.selenium.firefox.FirefoxDriverService;
2020
import org.openqa.selenium.firefox.FirefoxOptions;
2121
import org.openqa.selenium.firefox.GeckoDriverService;
22-
import org.openqa.selenium.manager.SeleniumManagerOutput;
2322
import org.openqa.selenium.remote.service.DriverFinder;
2423

2524
public class FirefoxTest extends BaseTest {
@@ -165,8 +164,7 @@ public void installUnsignedAddonPath() {
165164
private Path getFirefoxLocation() {
166165
FirefoxOptions options = new FirefoxOptions();
167166
options.setBrowserVersion("stable");
168-
SeleniumManagerOutput.Result output =
169-
DriverFinder.getPath(GeckoDriverService.createDefaultService(), options);
170-
return Path.of(output.getBrowserPath());
167+
DriverFinder finder = new DriverFinder(GeckoDriverService.createDefaultService(), options);
168+
return Path.of(finder.getBrowserPath());
171169
}
172170
}

examples/java/src/test/java/dev/selenium/drivers/ServiceTest.java

+3-5
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,6 @@
66
import org.openqa.selenium.chrome.ChromeDriver;
77
import org.openqa.selenium.chrome.ChromeDriverService;
88
import org.openqa.selenium.chrome.ChromeOptions;
9-
import org.openqa.selenium.manager.SeleniumManagerOutput;
109
import org.openqa.selenium.remote.service.DriverFinder;
1110

1211
public class ServiceTest extends BaseTest {
@@ -38,9 +37,8 @@ public void setPort() {
3837
private void setBinaryPaths() {
3938
ChromeOptions options = new ChromeOptions();
4039
options.setBrowserVersion("stable");
41-
SeleniumManagerOutput.Result location =
42-
DriverFinder.getPath(ChromeDriverService.createDefaultService(), options);
43-
driverPath = new File(location.getDriverPath());
44-
browserPath = new File(location.getBrowserPath());
40+
DriverFinder finder = new DriverFinder(ChromeDriverService.createDefaultService(), options);
41+
driverPath = new File(finder.getDriverPath());
42+
browserPath = new File(finder.getBrowserPath());
4543
}
4644
}

0 commit comments

Comments
 (0)