aboutsummaryrefslogtreecommitdiffstats
path: root/actionpack/lib/action_dispatch
diff options
context:
space:
mode:
authorRafael França <rafaelmfranca@gmail.com>2017-03-17 11:39:13 -0400
committerGitHub <noreply@github.com>2017-03-17 11:39:13 -0400
commit7413be0d31ec7eacc6f93e26546cb02ac6db73ca (patch)
treea824d9b88b89cf303fdb33e23768c4404f645416 /actionpack/lib/action_dispatch
parent3666962dd031b2d0e028f4fc6b52e0f19d573798 (diff)
parentec99107a2982236c726699cbbefc8839de278b93 (diff)
downloadrails-7413be0d31ec7eacc6f93e26546cb02ac6db73ca.tar.gz
rails-7413be0d31ec7eacc6f93e26546cb02ac6db73ca.tar.bz2
rails-7413be0d31ec7eacc6f93e26546cb02ac6db73ca.zip
Merge pull request #28341 from mtsmfm/pass-options-to-driven-by
Pass options to `driven_by`
Diffstat (limited to 'actionpack/lib/action_dispatch')
-rw-r--r--actionpack/lib/action_dispatch/system_test_case.rb4
-rw-r--r--actionpack/lib/action_dispatch/system_testing/driver.rb3
2 files changed, 4 insertions, 3 deletions
diff --git a/actionpack/lib/action_dispatch/system_test_case.rb b/actionpack/lib/action_dispatch/system_test_case.rb
index 903dac7a71..f908607e50 100644
--- a/actionpack/lib/action_dispatch/system_test_case.rb
+++ b/actionpack/lib/action_dispatch/system_test_case.rb
@@ -112,8 +112,8 @@ module ActionDispatch
# driven_by :selenium, using: :firefox
#
# driven_by :selenium, screen_size: [800, 800]
- def self.driven_by(driver, using: :chrome, screen_size: [1400, 1400])
- @driver = SystemTesting::Driver.new(driver, using: using, screen_size: screen_size)
+ def self.driven_by(driver, using: :chrome, screen_size: [1400, 1400], options: {})
+ @driver = SystemTesting::Driver.new(driver, using: using, screen_size: screen_size, options: options)
end
# Returns the driver object for the initialized system test
diff --git a/actionpack/lib/action_dispatch/system_testing/driver.rb b/actionpack/lib/action_dispatch/system_testing/driver.rb
index 72d132d64f..5cf17883f7 100644
--- a/actionpack/lib/action_dispatch/system_testing/driver.rb
+++ b/actionpack/lib/action_dispatch/system_testing/driver.rb
@@ -5,6 +5,7 @@ module ActionDispatch
@name = name
@browser = options[:using]
@screen_size = options[:screen_size]
+ @options = options[:options]
end
def use
@@ -19,7 +20,7 @@ module ActionDispatch
def register
Capybara.register_driver @name do |app|
- Capybara::Selenium::Driver.new(app, browser: @browser).tap do |driver|
+ Capybara::Selenium::Driver.new(app, { browser: @browser }.merge(@options)).tap do |driver|
driver.browser.manage.window.size = Selenium::WebDriver::Dimension.new(*@screen_size)
end
end