Skip to content

Commit db452f1

Browse files
committed
Change Capybara setup to allow tests using JS
1 parent b32a865 commit db452f1

File tree

1 file changed

+7
-1
lines changed

1 file changed

+7
-1
lines changed

spec/support/capybara.rb

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,12 @@
66
Capybara::Selenium::Driver.new(app, browser: :chrome)
77
end
88

9+
Capybara.register_driver :selenium_chrome_headless do |app|
10+
options = Selenium::WebDriver::Chrome::Options.new(args: %w[headless disable-gpu window-size=1400,1400])
11+
12+
Capybara::Selenium::Driver.new(app, browser: :chrome, options: options)
13+
end
14+
915
module CapybaraPage
1016
def page
1117
Capybara.string(response.body)
@@ -14,7 +20,7 @@ def page
1420

1521
RSpec.configure do |config|
1622
config.before(:each, type: :system) do
17-
driven_by :rack_test
23+
driven_by :selenium_chrome_headless
1824
end
1925

2026
config.before(:each, :debug, type: :system) do

0 commit comments

Comments
 (0)