Skip to content

Commit de38b25

Browse files
Merge branch 'trunk' into devtools-json
2 parents be926e7 + b0ee450 commit de38b25

File tree

111 files changed

+1063
-748
lines changed

Some content is hidden

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

111 files changed

+1063
-748
lines changed

.github/PULL_REQUEST_TEMPLATE.md

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -4,12 +4,8 @@
44
Before submitting your PR, please check our [contributing](https://github.com/SeleniumHQ/selenium/blob/trunk/CONTRIBUTING.md) guidelines.
55
Avoid large PRs, help reviewers by making them as simple and short as possible.
66

7-
87
<!--- Provide a general summary of your changes in the Title above -->
98

10-
### Description
11-
<!--- Describe your changes in detail -->
12-
139
### Motivation and Context
1410
<!--- Why is this change required? What problem does it solve? -->
1511

.skipped-tests

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -56,4 +56,5 @@
5656
-//rb/spec/integration/selenium/webdriver:element-chrome
5757
-//rb/spec/integration/selenium/webdriver:element-chrome-bidi
5858
-//rb/spec/integration/selenium/webdriver:element-chrome-remote
59+
-//rb/spec/integration/selenium/webdriver:action_builder-firefox-beta-remote
5960
-//rust/tests/...

MODULE.bazel

Lines changed: 7 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,15 +1,15 @@
11
module(name = "selenium")
22

33
bazel_dep(name = "apple_rules_lint", version = "0.4.0")
4-
bazel_dep(name = "aspect_bazel_lib", version = "2.10.0")
4+
bazel_dep(name = "aspect_bazel_lib", version = "2.13.0")
55
bazel_dep(name = "aspect_rules_esbuild", version = "0.21.0")
6-
bazel_dep(name = "aspect_rules_js", version = "2.0.1")
7-
bazel_dep(name = "aspect_rules_ts", version = "3.1.0")
6+
bazel_dep(name = "aspect_rules_js", version = "2.1.3")
7+
bazel_dep(name = "aspect_rules_ts", version = "3.4.0")
88
bazel_dep(name = "bazel_features", version = "1.23.0")
99
bazel_dep(name = "bazel_skylib", version = "1.7.1")
1010
bazel_dep(name = "buildifier_prebuilt", version = "6.4.0")
1111
bazel_dep(name = "contrib_rules_jvm", version = "0.27.0")
12-
bazel_dep(name = "platforms", version = "0.0.10")
12+
bazel_dep(name = "platforms", version = "0.0.11")
1313

1414
# Required for the closure rules
1515
bazel_dep(name = "protobuf", version = "29.2", dev_dependency = True, repo_name = "com_google_protobuf")
@@ -116,6 +116,7 @@ python.toolchain(
116116
python.toolchain(python_version = "3.10")
117117
python.toolchain(python_version = "3.11")
118118
python.toolchain(python_version = "3.12")
119+
python.toolchain(python_version = "3.13")
119120
use_repo(python, "pythons_hub")
120121

121122
pip = use_extension("@rules_python//python/extensions:pip.bzl", "pip")
@@ -131,6 +132,7 @@ pip = use_extension("@rules_python//python/extensions:pip.bzl", "pip")
131132
"3.10",
132133
"3.11",
133134
"3.12",
135+
"3.13",
134136
]
135137
]
136138

@@ -180,7 +182,7 @@ maven.install(
180182
"com.google.googlejavaformat:google-java-format:jar:1.25.2",
181183
"com.graphql-java:graphql-java:22.3",
182184
"dev.failsafe:failsafe:3.3.2",
183-
"io.grpc:grpc-context:1.69.0",
185+
"io.grpc:grpc-context:1.69.1",
184186
"io.lettuce:lettuce-core:6.5.2.RELEASE",
185187
"io.netty:netty-buffer",
186188
"io.netty:netty-codec-http",

README.md

Lines changed: 30 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,25 @@
1-
# Selenium
2-
3-
[![CI](https://github.com/SeleniumHQ/selenium/actions/workflows/ci.yml/badge.svg?branch=trunk&event=schedule)](https://github.com/SeleniumHQ/selenium/actions/workflows/ci.yml)
4-
[![CI - RBE](https://github.com/SeleniumHQ/selenium/actions/workflows/ci-rbe.yml/badge.svg?branch=trunk&event=schedule)](https://github.com/SeleniumHQ/selenium/actions/workflows/ci-rbe.yml)
5-
[![Releases downloads](https://img.shields.io/github/downloads/SeleniumHQ/selenium/total.svg)](https://github.com/SeleniumHQ/selenium/releases)
6-
7-
<a href="https://selenium.dev"><img src="common/images/selenium_logo_mark_green.svg" width="180" alt="Selenium Logo"/></a>
1+
<h1 align="center">
2+
<br/>
3+
<a href="https://selenium.dev"><img src="common/images/selenium_logo_mark_green.svg" alt="Selenium" width="100"></a>
4+
<br/>
5+
Selenium
6+
<br/>
7+
</h1>
8+
9+
<h3 align="center">Automates browsers. That's it!</h3>
10+
11+
<p align="center">
12+
<a href="#contributing">Contributing</a> •
13+
<a href="#installing">Installing</a> •
14+
<a href="#building">Building</a> •
15+
<a href="#developing">Developing</a> •
16+
<a href="#testing">Testing</a> •
17+
<a href="#documenting">Documenting</a> •
18+
<a href="#releasing">Releasing</a> •
19+
<a href="#license">License</a>
20+
</p>
21+
22+
<br>
823

924
Selenium is an umbrella project encapsulating a variety of tools and
1025
libraries enabling web browser automation. Selenium specifically
@@ -15,13 +30,15 @@ major web browsers.
1530
The project is made possible by volunteer contributors who've
1631
generously donated thousands of hours in code development and upkeep.
1732

18-
Selenium's source code is made available under the [Apache 2.0 license](https://github.com/SeleniumHQ/selenium/blob/trunk/LICENSE).
19-
2033
This README is for developers interested in contributing to the project.
2134
For people looking to get started using Selenium, please check out
2235
our [User Manual](https://selenium.dev/documentation/) for detailed examples and descriptions, and if you
2336
get stuck, there are several ways to [Get Help](https://www.selenium.dev/support/).
2437

38+
[![CI](https://github.com/SeleniumHQ/selenium/actions/workflows/ci.yml/badge.svg)](https://github.com/SeleniumHQ/selenium/actions/workflows/ci.yml)
39+
[![CI - RBE](https://github.com/SeleniumHQ/selenium/actions/workflows/ci-rbe.yml/badge.svg)](https://github.com/SeleniumHQ/selenium/actions/workflows/ci-rbe.yml)
40+
[![Releases downloads](https://img.shields.io/github/downloads/SeleniumHQ/selenium/total.svg)](https://github.com/SeleniumHQ/selenium/releases)
41+
2542
## Contributing
2643

2744
Please read [CONTRIBUTING.md](https://github.com/SeleniumHQ/selenium/blob/trunk/CONTRIBUTING.md)
@@ -507,3 +524,7 @@ If you have access to the Selenium EngFlow repository, you can have the assets b
507524
```shell
508525
./go all:release['--config', 'release']
509526
```
527+
528+
## License
529+
530+
Selenium's source code is made available under the [Apache 2.0 license](https://github.com/SeleniumHQ/selenium/blob/trunk/LICENSE).

common/repositories.bzl

Lines changed: 25 additions & 25 deletions
Original file line numberDiff line numberDiff line change
@@ -11,8 +11,8 @@ def pin_browsers():
1111

1212
http_archive(
1313
name = "linux_firefox",
14-
url = "https://ftp.mozilla.org/pub/firefox/releases/134.0.1/linux-x86_64/en-US/firefox-134.0.1.tar.bz2",
15-
sha256 = "81951a7cbe64a63455640919aecced8eef9c7af0c3704aa75995981fa9a4ae7c",
14+
url = "https://ftp.mozilla.org/pub/firefox/releases/134.0.2/linux-x86_64/en-US/firefox-134.0.2.tar.bz2",
15+
sha256 = "980b8cdebd7abdbed30a560a1a564d429c4e832c9e24e407b4c8a9fec24e0109",
1616
build_file_content = """
1717
load("@aspect_rules_js//js:defs.bzl", "js_library")
1818
package(default_visibility = ["//visibility:public"])
@@ -33,8 +33,8 @@ js_library(
3333

3434
dmg_archive(
3535
name = "mac_firefox",
36-
url = "https://ftp.mozilla.org/pub/firefox/releases/134.0.1/mac/en-US/Firefox%20134.0.1.dmg",
37-
sha256 = "b3342c12bb44b7c78351fb32442a0775c15fb2ac809c24447fd8f8d1e2a42c62",
36+
url = "https://ftp.mozilla.org/pub/firefox/releases/134.0.2/mac/en-US/Firefox%20134.0.2.dmg",
37+
sha256 = "7832a8d1e1a13322dec1b52d32e1e64d2b6254de8348575f2d22af4975d56a85",
3838
build_file_content = """
3939
load("@aspect_rules_js//js:defs.bzl", "js_library")
4040
package(default_visibility = ["//visibility:public"])
@@ -50,8 +50,8 @@ js_library(
5050

5151
http_archive(
5252
name = "linux_beta_firefox",
53-
url = "https://ftp.mozilla.org/pub/firefox/releases/135.0b6/linux-x86_64/en-US/firefox-135.0b6.tar.xz",
54-
sha256 = "104ae2f77c52f428ca0e037b0167e147d508b822e77543b26530dbef6764a018",
53+
url = "https://ftp.mozilla.org/pub/firefox/releases/135.0b9/linux-x86_64/en-US/firefox-135.0b9.tar.xz",
54+
sha256 = "a5aa65623c3ad4b6884b7617db0f7635880e042d1ed02376f52d8065884be03f",
5555
build_file_content = """
5656
load("@aspect_rules_js//js:defs.bzl", "js_library")
5757
package(default_visibility = ["//visibility:public"])
@@ -72,8 +72,8 @@ js_library(
7272

7373
dmg_archive(
7474
name = "mac_beta_firefox",
75-
url = "https://ftp.mozilla.org/pub/firefox/releases/135.0b6/mac/en-US/Firefox%20135.0b6.dmg",
76-
sha256 = "13f82e6220312b602481ec5a0d33ffc7c826913efb73f0cf8fdbc8b0482cd9b0",
75+
url = "https://ftp.mozilla.org/pub/firefox/releases/135.0b9/mac/en-US/Firefox%20135.0b9.dmg",
76+
sha256 = "31d395ddc49b5f18863c2e060610d3a7089a4af46df12d73f1d56d5afe78baa3",
7777
build_file_content = """
7878
load("@aspect_rules_js//js:defs.bzl", "js_library")
7979
package(default_visibility = ["//visibility:public"])
@@ -123,10 +123,10 @@ js_library(
123123

124124
pkg_archive(
125125
name = "mac_edge",
126-
url = "https://msedge.sf.dl.delivery.mp.microsoft.com/filestreamingservice/files/a9f2bcf0-b4b2-447e-8dd6-bcdc4d130efb/MicrosoftEdge-132.0.2957.115.pkg",
127-
sha256 = "8575a36cf7ec619d08dd8c5c19378c461b3d4e56134d4c9c43b8611ecd2d4275",
126+
url = "https://msedge.sf.dl.delivery.mp.microsoft.com/filestreamingservice/files/32cc7c00-5d56-4296-81bc-798f79706d6c/MicrosoftEdge-132.0.2957.127.pkg",
127+
sha256 = "dc5d6fc311d0a93dc9a665051738c5f855c95e24ae49d5696c68148f14daa97e",
128128
move = {
129-
"MicrosoftEdge-132.0.2957.115.pkg/Payload/Microsoft Edge.app": "Edge.app",
129+
"MicrosoftEdge-132.0.2957.127.pkg/Payload/Microsoft Edge.app": "Edge.app",
130130
},
131131
build_file_content = """
132132
load("@aspect_rules_js//js:defs.bzl", "js_library")
@@ -143,8 +143,8 @@ js_library(
143143

144144
deb_archive(
145145
name = "linux_edge",
146-
url = "https://packages.microsoft.com/repos/edge/pool/main/m/microsoft-edge-stable/microsoft-edge-stable_132.0.2957.115-1_amd64.deb",
147-
sha256 = "a20395d9ebc61fee423fb37e3d59ba92e443883525f3c4dbff962af3fc691399",
146+
url = "https://packages.microsoft.com/repos/edge/pool/main/m/microsoft-edge-stable/microsoft-edge-stable_132.0.2957.127-1_amd64.deb",
147+
sha256 = "ba80bca3192b3168269146e09fb38fdb596911a74a6666f81de6f7db312f7631",
148148
build_file_content = """
149149
load("@aspect_rules_js//js:defs.bzl", "js_library")
150150
package(default_visibility = ["//visibility:public"])
@@ -165,8 +165,8 @@ js_library(
165165

166166
http_archive(
167167
name = "linux_edgedriver",
168-
url = "https://msedgedriver.azureedge.net/132.0.2957.115/edgedriver_linux64.zip",
169-
sha256 = "2daa2453c20525165f6e58d78837faa4c20427bd28070730c30990f37d4a9f09",
168+
url = "https://msedgedriver.azureedge.net/132.0.2957.127/edgedriver_linux64.zip",
169+
sha256 = "d5a40743779e52d81ca4f0073ff47965347f9e906cac75f35fda0222480b78dc",
170170
build_file_content = """
171171
load("@aspect_rules_js//js:defs.bzl", "js_library")
172172
package(default_visibility = ["//visibility:public"])
@@ -182,8 +182,8 @@ js_library(
182182

183183
http_archive(
184184
name = "mac_edgedriver",
185-
url = "https://msedgedriver.azureedge.net/132.0.2957.115/edgedriver_mac64.zip",
186-
sha256 = "e4e0615b5258dbae239b24f860000bef1d3b643b23b0b9a4cd2f9252a39b9c2b",
185+
url = "https://msedgedriver.azureedge.net/132.0.2957.127/edgedriver_mac64.zip",
186+
sha256 = "0f73b6612245fcf5b719f27bc964832b25e349bfc64173b56e4ed26ca040ac64",
187187
build_file_content = """
188188
load("@aspect_rules_js//js:defs.bzl", "js_library")
189189
package(default_visibility = ["//visibility:public"])
@@ -199,8 +199,8 @@ js_library(
199199

200200
http_archive(
201201
name = "linux_chrome",
202-
url = "https://storage.googleapis.com/chrome-for-testing-public/132.0.6834.83/linux64/chrome-linux64.zip",
203-
sha256 = "0d49da7cc88c8fe87ba6fada58a2bf9e9ff233601a1cbe99cb61e45c8c785072",
202+
url = "https://storage.googleapis.com/chrome-for-testing-public/132.0.6834.159/linux64/chrome-linux64.zip",
203+
sha256 = "955bbbe5bfc2c210eced0c8faf5bc4aca4640af63b33f7480a4c2fc0b449e6e6",
204204
build_file_content = """
205205
load("@aspect_rules_js//js:defs.bzl", "js_library")
206206
package(default_visibility = ["//visibility:public"])
@@ -221,8 +221,8 @@ js_library(
221221

222222
http_archive(
223223
name = "mac_chrome",
224-
url = "https://storage.googleapis.com/chrome-for-testing-public/132.0.6834.83/mac-x64/chrome-mac-x64.zip",
225-
sha256 = "07ff97f6a31b7b9af7d6b9d23dbe94815d579410594a79d6432242983b686a0d",
224+
url = "https://storage.googleapis.com/chrome-for-testing-public/132.0.6834.159/mac-x64/chrome-mac-x64.zip",
225+
sha256 = "f7ce763afa87bf90bbc834f9abd82a975519fc3e5b78d4caae88183fbd85736d",
226226
strip_prefix = "chrome-mac-x64",
227227
patch_cmds = [
228228
"mv 'Google Chrome for Testing.app' Chrome.app",
@@ -243,8 +243,8 @@ js_library(
243243

244244
http_archive(
245245
name = "linux_chromedriver",
246-
url = "https://storage.googleapis.com/chrome-for-testing-public/132.0.6834.83/linux64/chromedriver-linux64.zip",
247-
sha256 = "315a56d7216a052a4727fec67d3d72a02260c0e54dc11a16c0b94029324b7d3f",
246+
url = "https://storage.googleapis.com/chrome-for-testing-public/132.0.6834.159/linux64/chromedriver-linux64.zip",
247+
sha256 = "13930d2b5e5f69d15c206556bd66e623aa325d03edde091b169b7cc5f7880e3e",
248248
strip_prefix = "chromedriver-linux64",
249249
build_file_content = """
250250
load("@aspect_rules_js//js:defs.bzl", "js_library")
@@ -261,8 +261,8 @@ js_library(
261261

262262
http_archive(
263263
name = "mac_chromedriver",
264-
url = "https://storage.googleapis.com/chrome-for-testing-public/132.0.6834.83/mac-x64/chromedriver-mac-x64.zip",
265-
sha256 = "5a4a646a6a2b41ff0453a598a874cb26fe197e2544e7f35cfb2b2fe410098e2d",
264+
url = "https://storage.googleapis.com/chrome-for-testing-public/132.0.6834.159/mac-x64/chromedriver-mac-x64.zip",
265+
sha256 = "50639151eaff168e7a55325120e11ceaa4b0cdedb5bb6df65511319f064dac2f",
266266
strip_prefix = "chromedriver-mac-x64",
267267
build_file_content = """
268268
load("@aspect_rules_js//js:defs.bzl", "js_library")

dotnet/src/webdriver/BUILD.bazel

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -55,6 +55,7 @@ csharp_library(
5555
framework("nuget", "Microsoft.Bcl.AsyncInterfaces"),
5656
framework("nuget", "System.Threading.Tasks.Extensions"),
5757
framework("nuget", "System.Memory"),
58+
framework("nuget", "System.Runtime.CompilerServices.Unsafe"),
5859
framework("nuget", "System.Text.Encodings.Web"),
5960
framework("nuget", "System.Text.Json"),
6061
],
@@ -120,6 +121,7 @@ csharp_library(
120121
framework("nuget", "Microsoft.Bcl.AsyncInterfaces"),
121122
framework("nuget", "System.Threading.Tasks.Extensions"),
122123
framework("nuget", "System.Memory"),
124+
framework("nuget", "System.Runtime.CompilerServices.Unsafe"),
123125
framework("nuget", "System.Text.Encodings.Web"),
124126
framework("nuget", "System.Text.Json"),
125127
],

dotnet/src/webdriver/BiDi/Communication/Broker.cs

Lines changed: 18 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -17,6 +17,7 @@
1717
// under the License.
1818
// </copyright>
1919

20+
using OpenQA.Selenium.BiDi.Communication.Json;
2021
using OpenQA.Selenium.BiDi.Communication.Json.Converters;
2122
using OpenQA.Selenium.BiDi.Communication.Transport;
2223
using OpenQA.Selenium.Internal.Logging;
@@ -40,7 +41,7 @@ public class Broker : IAsyncDisposable
4041
private readonly BiDi _bidi;
4142
private readonly ITransport _transport;
4243

43-
private readonly ConcurrentDictionary<int, TaskCompletionSource<object>> _pendingCommands = new();
44+
private readonly ConcurrentDictionary<int, TaskCompletionSource<JsonElement>> _pendingCommands = new();
4445
private readonly BlockingCollection<MessageEvent> _pendingEvents = [];
4546

4647
private readonly ConcurrentDictionary<string, List<EventHandler>> _eventHandlers = new();
@@ -53,14 +54,14 @@ public class Broker : IAsyncDisposable
5354
private Task? _eventEmitterTask;
5455
private CancellationTokenSource? _receiveMessagesCancellationTokenSource;
5556

56-
private readonly JsonSerializerOptions _jsonSerializerOptions;
57+
private readonly BiDiJsonSerializerContext _jsonSerializerContext;
5758

5859
internal Broker(BiDi bidi, ITransport transport)
5960
{
6061
_bidi = bidi;
6162
_transport = transport;
6263

63-
_jsonSerializerOptions = new JsonSerializerOptions
64+
var jsonSerializerOptions = new JsonSerializerOptions
6465
{
6566
PropertyNameCaseInsensitive = true,
6667
PropertyNamingPolicy = JsonNamingPolicy.CamelCase,
@@ -99,6 +100,8 @@ internal Broker(BiDi bidi, ITransport transport)
99100
new Json.Converters.Enumerable.GetRealmsResultConverter(),
100101
}
101102
};
103+
104+
_jsonSerializerContext = new BiDiJsonSerializerContext(jsonSerializerOptions);
102105
}
103106

104107
public async Task ConnectAsync(CancellationToken cancellationToken)
@@ -114,7 +117,7 @@ private async Task ReceiveMessagesAsync(CancellationToken cancellationToken)
114117
{
115118
while (!cancellationToken.IsCancellationRequested)
116119
{
117-
var message = await _transport.ReceiveAsJsonAsync<Message>(_jsonSerializerOptions, cancellationToken);
120+
var message = await _transport.ReceiveAsJsonAsync<Message>(_jsonSerializerContext, cancellationToken);
118121

119122
switch (message)
120123
{
@@ -145,7 +148,7 @@ private async Task ProcessEventsAwaiterAsync()
145148
{
146149
foreach (var handler in eventHandlers.ToArray()) // copy handlers avoiding modified collection while iterating
147150
{
148-
var args = (EventArgs)result.Params.Deserialize(handler.EventArgsType, _jsonSerializerOptions)!;
151+
var args = (EventArgs)result.Params.Deserialize(handler.EventArgsType, _jsonSerializerContext)!;
149152

150153
args.BiDi = _bidi;
151154

@@ -173,23 +176,26 @@ private async Task ProcessEventsAwaiterAsync()
173176
}
174177
}
175178

176-
public async Task<TResult> ExecuteCommandAsync<TResult>(Command command, CommandOptions? options)
179+
public async Task<TResult> ExecuteCommandAsync<TCommand, TResult>(TCommand command, CommandOptions? options)
180+
where TCommand: Command
177181
{
178-
var result = await ExecuteCommandCoreAsync(command, options).ConfigureAwait(false);
182+
var jsonElement = await ExecuteCommandCoreAsync(command, options).ConfigureAwait(false);
179183

180-
return (TResult)((JsonElement)result).Deserialize(typeof(TResult), _jsonSerializerOptions)!;
184+
return (TResult)jsonElement.Deserialize(typeof(TResult), _jsonSerializerContext)!;
181185
}
182186

183-
public async Task ExecuteCommandAsync(Command command, CommandOptions? options)
187+
public async Task ExecuteCommandAsync<TCommand>(TCommand command, CommandOptions? options)
188+
where TCommand: Command
184189
{
185190
await ExecuteCommandCoreAsync(command, options).ConfigureAwait(false);
186191
}
187192

188-
private async Task<object> ExecuteCommandCoreAsync(Command command, CommandOptions? options)
193+
private async Task<JsonElement> ExecuteCommandCoreAsync<TCommand>(TCommand command, CommandOptions? options)
194+
where TCommand: Command
189195
{
190196
command.Id = Interlocked.Increment(ref _currentCommandId);
191197

192-
var tcs = new TaskCompletionSource<object>(TaskCreationOptions.RunContinuationsAsynchronously);
198+
var tcs = new TaskCompletionSource<JsonElement>(TaskCreationOptions.RunContinuationsAsynchronously);
193199

194200
var timeout = options?.Timeout ?? TimeSpan.FromSeconds(30);
195201

@@ -199,7 +205,7 @@ private async Task<object> ExecuteCommandCoreAsync(Command command, CommandOptio
199205

200206
_pendingCommands[command.Id] = tcs;
201207

202-
await _transport.SendAsJsonAsync(command, _jsonSerializerOptions, cts.Token).ConfigureAwait(false);
208+
await _transport.SendAsJsonAsync(command, _jsonSerializerContext, cts.Token).ConfigureAwait(false);
203209

204210
return await tcs.Task.ConfigureAwait(false);
205211
}

0 commit comments

Comments
 (0)