aboutsummaryrefslogtreecommitdiffstats
path: root/actionpack/lib/action_dispatch/system_test_case.rb
diff options
context:
space:
mode:
Diffstat (limited to 'actionpack/lib/action_dispatch/system_test_case.rb')
-rw-r--r--actionpack/lib/action_dispatch/system_test_case.rb11
1 files changed, 9 insertions, 2 deletions
diff --git a/actionpack/lib/action_dispatch/system_test_case.rb b/actionpack/lib/action_dispatch/system_test_case.rb
index 70a5b75781..d6388d8fb7 100644
--- a/actionpack/lib/action_dispatch/system_test_case.rb
+++ b/actionpack/lib/action_dispatch/system_test_case.rb
@@ -105,9 +105,16 @@ module ActionDispatch
#
# driven_by :selenium, screen_size: [800, 800]
def self.driven_by(driver, using: :chrome, screen_size: [1400, 1400])
- SystemTesting::Driver.new(driver).run
+ driver = if selenium?(driver)
+ SystemTesting::Browser.new(using, screen_size)
+ else
+ SystemTesting::Driver.new(driver)
+ end
+
+ setup { driver.use }
+ teardown { driver.reset }
+
SystemTesting::Server.new.run
- SystemTesting::Browser.new(using, screen_size).run if selenium?(driver)
end
def self.selenium?(driver) # :nodoc: