Skip to content

Commit e506048

Browse files
committed
WIP: workaround for working with separate preferences with remote Selenium
1 parent 916aebc commit e506048

File tree

3 files changed

+30
-3
lines changed

3 files changed

+30
-3
lines changed

.devcontainer/compose.yaml

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -20,12 +20,22 @@ services:
2020
# (Adding the "ports" property to this file will not forward from a Codespace.)
2121
depends_on:
2222
- selenium
23+
- seleniumde
24+
- seleniumnolang
2325
- postgres
2426

2527
selenium:
2628
image: selenium/standalone-firefox
2729
restart: unless-stopped
2830

31+
seleniumde:
32+
image: selenium/standalone-firefox
33+
restart: unless-stopped
34+
35+
seleniumnolang:
36+
image: selenium/standalone-firefox
37+
restart: unless-stopped
38+
2939
postgres:
3040
image: postgres:16.1
3141
restart: unless-stopped

test/system/embed_test.rb

Lines changed: 19 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,15 @@ class EmbedTest < ApplicationSystemTestCase
1010
end
1111

1212
class GermanEmbedTest < ApplicationSystemTestCase
13-
driven_by :selenium, :using => :headless_firefox, :options => { :name => :selenium_de } do |options|
13+
driven_by(
14+
:selenium,
15+
:using => :headless_firefox,
16+
:options => {
17+
:url => "http://seleniumde:4444",
18+
:browser => :remote,
19+
:name => :selenium_de
20+
}
21+
) do |options|
1422
options.add_preference("intl.accept_languages", "de")
1523
end
1624

@@ -21,8 +29,17 @@ class GermanEmbedTest < ApplicationSystemTestCase
2129
end
2230

2331
class UnknownLanguageEmbedTest < ApplicationSystemTestCase
24-
driven_by :selenium, :using => :headless_firefox, :options => { :name => :selenium_unknown_language } do |options|
32+
driven_by(
33+
:selenium,
34+
:using => :headless_firefox,
35+
:options => {
36+
:url => "http://seleniumnolang:4444",
37+
:browser => :remote,
38+
:name => :selenium_unknown_language
39+
}
40+
) do |options|
2541
options.add_preference("intl.accept_languages", "unknown-language")
42+
options.binary = Settings.system_test_firefox_binary if Settings.system_test_firefox_binary
2643
end
2744

2845
test "shows report link in fallback language" do

test/test_helper.rb

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -36,7 +36,7 @@ def self.branch_coverage?
3636
require "webmock/minitest"
3737
require "minitest/focus" unless ENV["CI"]
3838

39-
WebMock.disable_net_connect!(:allow_localhost => true, :allow => %w[selenium rails-app])
39+
WebMock.disable_net_connect!(:allow_localhost => true, :allow => %w[selenium seleniumde seleniumnolang rails-app])
4040

4141
module ActiveSupport
4242
class TestCase

0 commit comments

Comments
 (0)