Skip to content

Commit 3ffe326

Browse files
authored
Merge branch 'trunk' into trunk
2 parents c698382 + 5d4cfc1 commit 3ffe326

File tree

13 files changed

+56
-34
lines changed

13 files changed

+56
-34
lines changed

.github/workflows/ci-ruby.yml

Lines changed: 0 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -87,11 +87,6 @@ jobs:
8787
os: ubuntu
8888
- browser: safari
8989
os: windows
90-
# TODO: Investigate why they are timing out
91-
- browser: chrome
92-
os: windows
93-
- browser: edge
94-
os: windows
9590
with:
9691
name: Local Tests (${{ matrix.browser }}, ${{ matrix.os }})
9792
browser: ${{ matrix.browser }}

MODULE.bazel

Lines changed: 0 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -124,16 +124,6 @@ use_repo(pip, "py_dev_requirements")
124124

125125
register_toolchains("@pythons_hub//:all")
126126

127-
# https://github.com/bazelbuild/rules_jvm_external/pull/1079
128-
archive_override(
129-
module_name = "rules_jvm_external",
130-
integrity = "sha256-yS8Qes1PLbYbe10b1WSgl0Auqn/1Wlxg8O3wSr7a/Sg=",
131-
patch_strip = 1,
132-
patches = ["//java:rules_jvm_external_javadoc.patch"],
133-
strip_prefix = "rules_jvm_external-f572a26116c7ef71d8842dd056c2605782f7be8d",
134-
urls = ["https://github.com/bazelbuild/rules_jvm_external/archive/f572a26116c7ef71d8842dd056c2605782f7be8d.tar.gz"],
135-
)
136-
137127
java_toolchains = use_extension("@rules_java//java:extensions.bzl", "toolchains")
138128
use_repo(
139129
java_toolchains,

README.md

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -370,7 +370,6 @@ Supported browsers:
370370
* `safari-preview`
371371

372372
In addition to the [Common Options Examples](#common-options-examples), here are some additional Ruby specific ones:
373-
* `--test_arg "-tfocus"` - test only [focused specs](https://relishapp.com/rspec/rspec-core/v/3-12/docs/filtering/inclusion-filters)
374373
* `--test_arg "-eTimeouts"` - test only specs which name include "Timeouts"
375374
* `--test_arg "<any other RSpec argument>"` - pass any extra RSpec arguments (see `bazel run @bundle//bin:rspec -- --help`)
376375

common/repositories.bzl

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -50,8 +50,8 @@ js_library(
5050

5151
http_archive(
5252
name = "linux_beta_firefox",
53-
url = "https://ftp.mozilla.org/pub/firefox/releases/126.0b7/linux-x86_64/en-US/firefox-126.0b7.tar.bz2",
54-
sha256 = "a7bd26d05857ffb08e46af9016973c74d16be806025a6329bb843dffde0672f9",
53+
url = "https://ftp.mozilla.org/pub/firefox/releases/126.0b8/linux-x86_64/en-US/firefox-126.0b8.tar.bz2",
54+
sha256 = "75198959b1eeedc81be229ad3066ee6d49ecde985ce5d5d11d61f0914e288517",
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/126.0b7/mac/en-US/Firefox%20126.0b7.dmg",
76-
sha256 = "f98f772c94addfb05f2c1abe851938b2f806794af0104c73d51445132fa0855c",
75+
url = "https://ftp.mozilla.org/pub/firefox/releases/126.0b8/mac/en-US/Firefox%20126.0b8.dmg",
76+
sha256 = "ca247dbfa1b092f36c75ab785acb0c54e608545b76dc06fbac9a9034df0daf8a",
7777
build_file_content = """
7878
load("@aspect_rules_js//js:defs.bzl", "js_library")
7979
package(default_visibility = ["//visibility:public"])

java/src/org/openqa/selenium/chromium/ChromiumDriver.java

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -347,13 +347,16 @@ public Optional<DevTools> maybeGetDevTools() {
347347
}
348348

349349
private Optional<BiDi> createBiDi(Optional<URI> biDiUri) {
350-
if (!biDiUri.isPresent()) {
350+
if (biDiUri.isEmpty()) {
351351
return Optional.empty();
352352
}
353353

354354
URI wsUri =
355355
biDiUri.orElseThrow(
356-
() -> new BiDiException("This version of Chromium driver does not support BiDi"));
356+
() ->
357+
new BiDiException(
358+
"Check if this browser version supports BiDi and if the 'webSocketUrl: true'"
359+
+ " capability is set."));
357360

358361
HttpClient.Factory clientFactory = HttpClient.Factory.createDefault();
359362
ClientConfig wsConfig = ClientConfig.defaultConfig().baseUri(wsUri);

java/src/org/openqa/selenium/firefox/FirefoxDriver.java

Lines changed: 8 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -354,14 +354,16 @@ public DevTools getDevTools() {
354354
}
355355

356356
private Optional<BiDi> createBiDi(Optional<URI> biDiUri) {
357-
if (!biDiUri.isPresent()) {
357+
if (biDiUri.isEmpty()) {
358358
return Optional.empty();
359359
}
360360

361361
URI wsUri =
362362
biDiUri.orElseThrow(
363363
() ->
364-
new BiDiException("This version of Firefox or geckodriver does not support BiDi"));
364+
new BiDiException(
365+
"Check if this browser version supports BiDi and if the 'webSocketUrl: true'"
366+
+ " capability is set."));
365367

366368
HttpClient.Factory clientFactory = HttpClient.Factory.createDefault();
367369
ClientConfig wsConfig = ClientConfig.defaultConfig().baseUri(wsUri);
@@ -380,8 +382,10 @@ public Optional<BiDi> maybeGetBiDi() {
380382

381383
@Override
382384
public BiDi getBiDi() {
383-
if (!biDiUri.isPresent()) {
384-
throw new BiDiException("This version of Firefox or geckodriver does not support Bidi");
385+
if (biDiUri.isEmpty()) {
386+
throw new BiDiException(
387+
"Check if this browser version supports BiDi and if the 'webSocketUrl: true' capability"
388+
+ " is set.");
385389
}
386390

387391
return maybeGetBiDi()

rb/lib/selenium/server.rb

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -183,6 +183,7 @@ def download_server(uri, destination)
183183
def initialize(jar, opts = {})
184184
raise Errno::ENOENT, jar unless File.exist?(jar)
185185

186+
@java = opts.fetch(:java, 'java')
186187
@jar = jar
187188
@host = '127.0.0.1'
188189
@role = opts.fetch(:role, 'standalone')
@@ -241,7 +242,7 @@ def process
241242
# extract any additional_args that start with -D as options
242243
properties = @additional_args.dup - @additional_args.delete_if { |arg| arg[/^-D/] }
243244
args = ['-jar', @jar, @role, '--port', @port.to_s]
244-
server_command = ['java'] + properties + args + @additional_args
245+
server_command = [@java] + properties + args + @additional_args
245246
cp = WebDriver::ChildProcess.build(*server_command)
246247

247248
if @log.is_a?(String)

rb/spec/BUILD.bazel

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -117,3 +117,12 @@ rb_library(
117117
"//rb/spec/unit/selenium/webdriver/support:select",
118118
],
119119
)
120+
121+
genrule(
122+
name = "java-location",
123+
srcs = [],
124+
outs = ["java-location.txt"],
125+
cmd = "echo $(JAVA) > $@",
126+
toolchains = ["@bazel_tools//tools/jdk:current_java_runtime"],
127+
visibility = ["//rb/spec:__subpackages__"],
128+
)

rb/spec/integration/selenium/webdriver/spec_helper.rb

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -45,7 +45,9 @@
4545
GlobalTestEnv.quit_driver
4646
end
4747

48-
c.filter_run focus: true if ENV['focus']
48+
c.filter_run_when_matching :focus
49+
c.run_all_when_everything_filtered = true
50+
c.default_formatter = c.files_to_run.count > 1 ? 'progress' : 'doc'
4951

5052
c.before do |example|
5153
guards = WebDriver::Support::Guards.new(example, bug_tracker: 'https://github.com/SeleniumHQ/selenium/issues')

rb/spec/integration/selenium/webdriver/spec_support/test_environment.rb

Lines changed: 9 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -87,6 +87,7 @@ def app_server
8787
def remote_server
8888
@remote_server ||= Selenium::Server.new(
8989
remote_server_jar,
90+
java: bazel_java,
9091
port: random_port,
9192
log_level: WebDriver.logger.debug? && 'FINE',
9293
background: true,
@@ -95,6 +96,12 @@ def remote_server
9596
)
9697
end
9798

99+
def bazel_java
100+
return unless ENV.key?('WD_BAZEL_JAVA_LOCATION')
101+
102+
File.expand_path(File.read(File.expand_path(ENV.fetch('WD_BAZEL_JAVA_LOCATION'))).chomp)
103+
end
104+
98105
def reset_remote_server
99106
@remote_server&.stop
100107
@remote_server = nil
@@ -243,15 +250,15 @@ def safari_preview_driver(**opts)
243250
def chrome_options(args: [], **opts)
244251
opts[:binary] ||= ENV['CHROME_BINARY'] if ENV.key?('CHROME_BINARY')
245252
args << '--headless=chrome' if ENV['HEADLESS']
246-
args << '--no-sandbox'
253+
args << '--no-sandbox' if ENV['NO_SANDBOX']
247254
args << '--disable-gpu'
248255
WebDriver::Options.chrome(browser_version: 'stable', args: args, **opts)
249256
end
250257

251258
def edge_options(args: [], **opts)
252259
opts[:binary] ||= ENV['EDGE_BINARY'] if ENV.key?('EDGE_BINARY')
253260
args << '--headless=chrome' if ENV['HEADLESS']
254-
args << '--no-sandbox'
261+
args << '--no-sandbox' if ENV['NO_SANDBOX']
255262
args << '--disable-gpu'
256263
WebDriver::Options.edge(browser_version: 'stable', args: args, **opts)
257264
end

0 commit comments

Comments
 (0)