Class: ActionDispatch::SystemTesting::Browser
Do not use. This class is for internal use only.
Relationships & Source Files | |
Inherits: | Object |
Defined in: | actionpack/lib/action_dispatch/system_testing/browser.rb |
Class Method Summary
- .new(name) ⇒ Browser constructor
Instance Attribute Summary
- #name readonly
Instance Method Summary
- #configure {|options| ... }
- #options
-
#preload
driver_path is lazily initialized by default.
- #type
- #resolve_driver_path(namespace) private
- #set_default_options private
- #set_headless_chrome_browser_options private
- #set_headless_firefox_browser_options private
Constructor Details
.new(name) ⇒ Browser
Instance Attribute Details
#name (readonly)
[ GitHub ]# File 'actionpack/lib/action_dispatch/system_testing/browser.rb', line 6
attr_reader :name
Instance Method Details
#configure {|options| ... }
# File 'actionpack/lib/action_dispatch/system_testing/browser.rb', line 34
def configure yield if block_given? end
#options
[ GitHub ]#preload
driver_path is lazily initialized by default. Eagerly set it to avoid race conditions when using parallel tests.
# File 'actionpack/lib/action_dispatch/system_testing/browser.rb', line 40
def preload case type when :chrome resolve_driver_path(::Selenium::WebDriver::Chrome) when :firefox resolve_driver_path(::Selenium::WebDriver::Firefox) end end
#resolve_driver_path(namespace) (private)
[ GitHub ]# File 'actionpack/lib/action_dispatch/system_testing/browser.rb', line 72
def resolve_driver_path(namespace) namespace::Service.driver_path = ::Selenium::WebDriver::DriverFinder.path(, namespace::Service) end
#set_default_options (private)
[ GitHub ]# File 'actionpack/lib/action_dispatch/system_testing/browser.rb', line 50
def case name when :headless_chrome when :headless_firefox end end
#set_headless_chrome_browser_options (private)
[ GitHub ]# File 'actionpack/lib/action_dispatch/system_testing/browser.rb', line 59
def configure do |capabilities| capabilities.add_argument("--headless") capabilities.add_argument("--disable-gpu") if Gem.win_platform? end end
#set_headless_firefox_browser_options (private)
[ GitHub ]# File 'actionpack/lib/action_dispatch/system_testing/browser.rb', line 66
def configure do |capabilities| capabilities.add_argument("-headless") end end