Skip to content

Commit e3a490d

Browse files
authored
Merge branch 'trunk' into development-sponsors
2 parents 5231251 + a514b63 commit e3a490d

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

59 files changed

+664
-359
lines changed

.github/workflows/dotnet-examples.yml

Lines changed: 32 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -26,6 +26,7 @@ jobs:
2626
fail-fast: false
2727
matrix:
2828
os: [ ubuntu-latest, windows-latest, macos-latest ]
29+
release: [ stable, nightly ]
2930
runs-on: ${{ matrix.os }}
3031
steps:
3132
- name: Checkout GitHub repo
@@ -43,17 +44,45 @@ jobs:
4344
- name: Start Xvfb
4445
if: matrix.os == 'ubuntu-latest'
4546
run: Xvfb :99 &
46-
- name: Set up .Net
47+
- name: Set up .Net Stable
48+
if: matrix.release == 'stable'
4749
uses: actions/setup-dotnet@v4
4850
with:
49-
dotnet-version: 6.0.x
51+
dotnet-version: 6.x
52+
- name: Set up .Net Nightly
53+
if: matrix.release == 'nightly'
54+
uses: actions/setup-dotnet@v4
55+
with:
56+
dotnet-version: 6.x
57+
source-url: https://nuget.pkg.github.com/seleniumhq/index.json
58+
env:
59+
NUGET_AUTH_TOKEN: ${{secrets.GITHUB_TOKEN}}
60+
- name: Update Nightly version non-Windows
61+
if: matrix.release == 'nightly' && matrix.os != 'windows-latest'
62+
run:
63+
|
64+
latest_nightly=$(./scripts/latest-nightly-version.sh nuget Selenium.WebDriver)
65+
dotnet add examples/dotnet/SeleniumDocs/SeleniumDocs.csproj package Selenium.WebDriver --version $latest_nightly
66+
dotnet add examples/dotnet/SeleniumDocs/SeleniumDocs.csproj package Selenium.Support --version $latest_nightly
67+
env:
68+
GH_TOKEN: ${{ secrets.GITHUB_TOKEN }}
69+
- name: Update Nightly version Windows
70+
if: matrix.release == 'nightly' && matrix.os == 'windows-latest'
71+
shell: pwsh
72+
run:
73+
|
74+
$latest_nightly = ./scripts/latest-nightly-version.ps1 nuget Selenium.WebDriver
75+
dotnet add examples/dotnet/SeleniumDocs/SeleniumDocs.csproj package Selenium.WebDriver --version $latest_nightly
76+
dotnet add examples/dotnet/SeleniumDocs/SeleniumDocs.csproj package Selenium.Support --version $latest_nightly
77+
env:
78+
GH_TOKEN: ${{ secrets.GITHUB_TOKEN }}
5079
- name: Set up Java
5180
uses: actions/setup-java@v4
5281
with:
5382
distribution: 'temurin'
5483
java-version: 11
5584
- name: Run tests
56-
uses: nick-invision/retry@v3.0.0
85+
uses: nick-fields/retry@v3.0.0
5786
with:
5887
timeout_minutes: 20
5988
max_attempts: 3

.github/workflows/java-examples.yml

Lines changed: 30 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -26,6 +26,7 @@ jobs:
2626
fail-fast: false
2727
matrix:
2828
os: [ ubuntu-latest, windows-latest, macos-latest ]
29+
release: [ stable, nightly ]
2930
runs-on: ${{ matrix.os }}
3031
steps:
3132
- name: Checkout GitHub repo
@@ -48,11 +49,39 @@ jobs:
4849
with:
4950
distribution: 'temurin'
5051
java-version: 11
51-
- name: Run Tests
52+
- name: Run Tests Stable
53+
if: matrix.release == 'stable'
5254
uses: nick-invision/retry@v3.0.0
5355
with:
5456
timeout_minutes: 20
5557
max_attempts: 3
5658
command: |
5759
cd examples/java
5860
mvn -B test
61+
- name: Run Tests Nightly Linux/macOS
62+
if: matrix.release == 'nightly' && matrix.os != 'windows-latest'
63+
uses: nick-invision/retry@v3.0.0
64+
with:
65+
timeout_minutes: 20
66+
max_attempts: 3
67+
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
72+
cd examples/java
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/retry@v3.0.0
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"

.github/workflows/js-examples.yml

Lines changed: 32 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -26,6 +26,7 @@ jobs:
2626
fail-fast: false
2727
matrix:
2828
os: [ ubuntu-latest, windows-latest, macos-latest ]
29+
release: [ stable, nightly ]
2930
runs-on: ${{ matrix.os }}
3031
steps:
3132
- name: Checkout GitHub repo
@@ -77,9 +78,40 @@ jobs:
7778
- name: Start Xvfb
7879
if: matrix.os == 'ubuntu-latest'
7980
run: Xvfb :99 &
81+
- name: Setup Node Stable
82+
if: matrix.release == 'stable'
83+
uses: actions/setup-node@v4
84+
with:
85+
node-version: '18.x'
86+
- name: Setup Node Nightly
87+
if: matrix.release == 'nightly'
88+
uses: actions/setup-node@v4
89+
with:
90+
node-version: '18.x'
91+
registry-url: 'https://npm.pkg.github.com'
92+
- name: Use Nightly package.json in Ubuntu/macOS
93+
if: matrix.release == 'nightly' && matrix.os != 'windows-latest'
94+
run:
95+
|
96+
latest_nightly=$(./scripts/latest-nightly-version.sh npm selenium-webdriver)
97+
npm install --prefix ./examples/javascript --save selenium-webdriver@npm:@seleniumhq/selenium-webdriver@$latest_nightly
98+
env:
99+
GH_TOKEN: ${{ secrets.GITHUB_TOKEN }}
100+
NODE_AUTH_TOKEN: ${{ secrets.GITHUB_TOKEN }}
101+
- name: Use Nightly package.json in Windows
102+
if: matrix.release == 'nightly' && matrix.os == 'windows-latest'
103+
run:
104+
|
105+
$latest_nightly = ./scripts/latest-nightly-version.ps1 npm selenium-webdriver
106+
npm install --prefix ./examples/javascript --save selenium-webdriver@npm:@seleniumhq/selenium-webdriver@$latest_nightly
107+
env:
108+
GH_TOKEN: ${{ secrets.GITHUB_TOKEN }}
109+
NODE_AUTH_TOKEN: ${{ secrets.GITHUB_TOKEN }}
80110
- name: Install Requirements
81111
working-directory: ./examples/javascript
82112
run: npm install
113+
env:
114+
NODE_AUTH_TOKEN: ${{ secrets.GITHUB_TOKEN }}
83115
- name: Run tests
84116
uses: nick-invision/retry@v3.0.0
85117
with:

.github/workflows/python-examples.yml

Lines changed: 10 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -26,6 +26,7 @@ jobs:
2626
fail-fast: false
2727
matrix:
2828
os: [ ubuntu-latest, windows-latest, macos-latest ]
29+
release: [ stable, nightly ]
2930
runs-on: ${{ matrix.os }}
3031
steps:
3132
- name: Checkout GitHub repo
@@ -47,7 +48,15 @@ jobs:
4748
uses: actions/setup-python@v5
4849
with:
4950
python-version: 3.8
50-
- name: Install dependencies
51+
- name: Install dependencies nightly
52+
if: matrix.release == 'nightly'
53+
working-directory: ./examples/python
54+
run: |
55+
python -m pip install --upgrade pip
56+
pip install -r requirements.txt
57+
pip install -i https://test.pypi.org/simple/ --extra-index-url https://pypi.org/simple --force-reinstall -v selenium
58+
- name: Install dependencies stable
59+
if: matrix.release == 'stable'
5160
working-directory: ./examples/python
5261
run: |
5362
python -m pip install --upgrade pip

.github/workflows/ruby-examples.yml

Lines changed: 25 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -26,6 +26,7 @@ jobs:
2626
fail-fast: false
2727
matrix:
2828
os: [ ubuntu-latest, windows-latest, macos-latest ]
29+
release: [ stable, nightly ]
2930
runs-on: ${{ matrix.os }}
3031
steps:
3132
- name: Checkout GitHub repo
@@ -48,7 +49,30 @@ jobs:
4849
with:
4950
ruby-version: 3.0
5051
bundler-cache: true
51-
- name: Install Gems
52+
- name: Install Gems Nightly non-Windows
53+
if: matrix.release == 'nightly' && matrix.os != 'windows-latest'
54+
run:
55+
|
56+
latest_nightly_webdriver=$(./scripts/latest-nightly-version.sh rubygems selenium-webdriver)
57+
cd examples/ruby
58+
bundle install
59+
bundle remove selenium-webdriver
60+
bundle add selenium-webdriver --version $latest_nightly_webdriver --source "https://token:${{secrets.GITHUB_TOKEN}}@rubygems.pkg.github.com/seleniumhq"
61+
env:
62+
GH_TOKEN: ${{ secrets.GITHUB_TOKEN }}
63+
- name: Install Gems Nightly Windows
64+
if: matrix.release == 'nightly' && matrix.os == 'windows-latest'
65+
run:
66+
|
67+
$latest_nightly_webdriver = ./scripts/latest-nightly-version.ps1 rubygems selenium-webdriver
68+
cd examples/ruby
69+
bundle install
70+
bundle remove selenium-webdriver
71+
bundle add selenium-webdriver --version $latest_nightly_webdriver --source "https://token:${{secrets.GITHUB_TOKEN}}@rubygems.pkg.github.com/seleniumhq"
72+
env:
73+
GH_TOKEN: ${{ secrets.GITHUB_TOKEN }}
74+
- name: Install Gems Stable
75+
if: matrix.release == 'stable'
5276
working-directory: ./examples/ruby
5377
run: bundle install
5478
- name: Set up Java

examples/dotnet/SeleniumDocs/Bidirectional/ChromeDevtools/CdpApiTest.cs

Lines changed: 9 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -5,8 +5,8 @@
55
using Microsoft.VisualStudio.TestTools.UnitTesting;
66
using OpenQA.Selenium;
77
using OpenQA.Selenium.DevTools;
8-
using OpenQA.Selenium.DevTools.V121.Network;
9-
using OpenQA.Selenium.DevTools.V121.Performance;
8+
using OpenQA.Selenium.DevTools.V124.Network;
9+
using OpenQA.Selenium.DevTools.V124.Performance;
1010

1111
namespace SeleniumDocs.Bidirectional.ChromeDevtools
1212
{
@@ -16,15 +16,15 @@ public class CdpApiTest : BaseTest
1616
[TestInitialize]
1717
public void Startup()
1818
{
19-
StartDriver("121");
19+
StartDriver("124");
2020
}
2121

2222
[TestMethod]
2323
public async Task SetCookie()
2424
{
2525
var session = ((IDevTools)driver).GetDevToolsSession();
26-
var domains = session.GetVersionSpecificDomains<OpenQA.Selenium.DevTools.V121.DevToolsSessionDomains>();
27-
await domains.Network.Enable(new OpenQA.Selenium.DevTools.V121.Network.EnableCommandSettings());
26+
var domains = session.GetVersionSpecificDomains<OpenQA.Selenium.DevTools.V124.DevToolsSessionDomains>();
27+
await domains.Network.Enable(new OpenQA.Selenium.DevTools.V124.Network.EnableCommandSettings());
2828

2929
var cookieCommandSettings = new SetCookieCommandSettings
3030
{
@@ -47,8 +47,8 @@ public async Task PerformanceMetrics()
4747
driver.Url = "https://www.selenium.dev/selenium/web/frameset.html";
4848

4949
var session = ((IDevTools)driver).GetDevToolsSession();
50-
var domains = session.GetVersionSpecificDomains<OpenQA.Selenium.DevTools.V121.DevToolsSessionDomains>();
51-
await domains.Performance.Enable(new OpenQA.Selenium.DevTools.V121.Performance.EnableCommandSettings());
50+
var domains = session.GetVersionSpecificDomains<OpenQA.Selenium.DevTools.V124.DevToolsSessionDomains>();
51+
await domains.Performance.Enable(new OpenQA.Selenium.DevTools.V124.Performance.EnableCommandSettings());
5252

5353
var metricsResponse =
5454
await session.SendCommand<GetMetricsCommandSettings, GetMetricsCommandResponse>(
@@ -68,8 +68,8 @@ await session.SendCommand<GetMetricsCommandSettings, GetMetricsCommandResponse>(
6868
public async Task BasicAuth()
6969
{
7070
var session = ((IDevTools)driver).GetDevToolsSession();
71-
var domains = session.GetVersionSpecificDomains<OpenQA.Selenium.DevTools.V121.DevToolsSessionDomains>();
72-
await domains.Network.Enable(new OpenQA.Selenium.DevTools.V121.Network.EnableCommandSettings());
71+
var domains = session.GetVersionSpecificDomains<OpenQA.Selenium.DevTools.V124.DevToolsSessionDomains>();
72+
await domains.Network.Enable(new OpenQA.Selenium.DevTools.V124.Network.EnableCommandSettings());
7373

7474
var encodedAuth = Convert.ToBase64String(Encoding.Default.GetBytes("admin:admin"));
7575
var headerSettings = new SetExtraHTTPHeadersCommandSettings

examples/dotnet/SeleniumDocs/Browsers/ChromeTest.cs

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -177,8 +177,7 @@ private static string GetChromeLocation()
177177
{
178178
BrowserVersion = "stable"
179179
};
180-
DriverFinder.FullPath(options);
181-
return options.BinaryLocation;
180+
return new DriverFinder(options).GetBrowserPath();
182181
}
183182
}
184183
}

examples/dotnet/SeleniumDocs/Browsers/EdgeTest.cs

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -177,8 +177,7 @@ private static string GetEdgeLocation()
177177
{
178178
BrowserVersion = "stable"
179179
};
180-
DriverFinder.FullPath(options);
181-
return options.BinaryLocation;
180+
return new DriverFinder(options).GetBrowserPath();
182181
}
183182
}
184183
}

examples/dotnet/SeleniumDocs/Browsers/FirefoxTest.cs

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -201,8 +201,7 @@ private static string GetFirefoxLocation()
201201
{
202202
BrowserVersion = "stable"
203203
};
204-
DriverFinder.FullPath(options);
205-
return options.BinaryLocation;
204+
return new DriverFinder(options).GetBrowserPath();
206205
}
207206
}
208207
}

examples/dotnet/SeleniumDocs/Drivers/ServiceTest.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -38,7 +38,7 @@ public void DriverPort()
3838

3939
private static string GetDriverLocation(ChromeOptions options)
4040
{
41-
return DriverFinder.FullPath(options);
41+
return new DriverFinder(options).GetDriverPath();
4242
}
4343

4444
private static ChromeOptions GetLatestChromeOptions()

0 commit comments

Comments
 (0)