Skip to content

Commit fd7abd4

Browse files
committed
1 parent 7d0ac5d commit fd7abd4

File tree

2 files changed

+15
-2
lines changed

2 files changed

+15
-2
lines changed

Gemfile.lock

+1-1
Original file line numberDiff line numberDiff line change
@@ -287,7 +287,7 @@ GEM
287287
rubocop-ast (>= 0.4.0)
288288
ruby-progressbar (1.13.0)
289289
rubyzip (2.3.2)
290-
selenium-webdriver (4.8.6)
290+
selenium-webdriver (4.9.0)
291291
rexml (~> 3.2, >= 3.2.5)
292292
rubyzip (>= 1.2.2, < 3.0)
293293
websocket (~> 1.0)

test/application_system_test_case.rb

+14-1
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,18 @@
11
require "test_helper"
22

33
class ApplicationSystemTestCase < ActionDispatch::SystemTestCase
4-
driven_by :selenium, using: :chrome, screen_size: [1400, 1400]
4+
# removes noisy logs when launching tests
5+
Capybara.server = :puma, {Silent: true}
6+
7+
Capybara.register_driver :headless_chrome do |app|
8+
options = Selenium::WebDriver::Chrome::Options.new(args: %w[headless window-size=1400,1000])
9+
Capybara::Selenium::Driver.new(app, browser: :chrome, options: options)
10+
end
11+
12+
Capybara.register_driver(:chrome) do |app|
13+
options = Selenium::WebDriver::Chrome::Options.new(args: %w[window-size=1400,1000])
14+
Capybara::Selenium::Driver.new(app, browser: :chrome, options: options)
15+
end
16+
17+
ENV["HEADLESS"] ? driven_by(:headless_chrome) : driven_by(:chrome)
518
end

0 commit comments

Comments
 (0)