From 68eed60eee5d2f06408bb315a531bb6e49e9aeeb Mon Sep 17 00:00:00 2001 From: Ryuta Kamizono Date: Wed, 30 Jan 2019 16:40:01 +0900 Subject: selenium-webdriver is not always required for system testing But `NameError: uninitialized constant ActionDispatch::SystemTesting::Browser::Selenium` is pretty confused. I've little improved missing constant error to `NameError: uninitialized constant Selenium`. --- actionpack/lib/action_dispatch/system_testing/browser.rb | 6 ++---- actionpack/test/dispatch/system_testing/screenshot_helper_test.rb | 1 + 2 files changed, 3 insertions(+), 4 deletions(-) diff --git a/actionpack/lib/action_dispatch/system_testing/browser.rb b/actionpack/lib/action_dispatch/system_testing/browser.rb index 2ffb5f67f6..c34907b6cb 100644 --- a/actionpack/lib/action_dispatch/system_testing/browser.rb +++ b/actionpack/lib/action_dispatch/system_testing/browser.rb @@ -1,7 +1,5 @@ # frozen_string_literal: true -require "selenium/webdriver" - module ActionDispatch module SystemTesting class Browser # :nodoc: @@ -35,9 +33,9 @@ module ActionDispatch @option ||= case type when :chrome - Selenium::WebDriver::Chrome::Options.new + ::Selenium::WebDriver::Chrome::Options.new when :firefox - Selenium::WebDriver::Firefox::Options.new + ::Selenium::WebDriver::Firefox::Options.new end end diff --git a/actionpack/test/dispatch/system_testing/screenshot_helper_test.rb b/actionpack/test/dispatch/system_testing/screenshot_helper_test.rb index 097ef8af29..b756b91379 100644 --- a/actionpack/test/dispatch/system_testing/screenshot_helper_test.rb +++ b/actionpack/test/dispatch/system_testing/screenshot_helper_test.rb @@ -3,6 +3,7 @@ require "abstract_unit" require "action_dispatch/system_testing/test_helpers/screenshot_helper" require "capybara/dsl" +require "selenium/webdriver" class ScreenshotHelperTest < ActiveSupport::TestCase test "image path is saved in tmp directory" do -- cgit v1.2.3