Class: ActionDispatch::SystemTesting::Driver

Inherits:
Object
  • Object
show all
Defined in:
lib/action_dispatch/system_testing/driver.rb

Overview

:nodoc:

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(driver_type, **options, &capabilities) ⇒ Driver

Returns a new instance of Driver.



8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
# File 'lib/action_dispatch/system_testing/driver.rb', line 8

def initialize(driver_type, **options, &capabilities)
  @driver_type = driver_type
  @screen_size = options[:screen_size]
  @options = options[:options] || {}
  @name = @options.delete(:name) || driver_type
  @capabilities = capabilities

  if [:poltergeist, :webkit].include?(driver_type)
    ActiveSupport::Deprecation.warn "      Poltergeist and capybara-webkit are not maintained already.\n      Driver registration of :poltergeist or :webkit is deprecated and will be removed in Rails 7.1.\n      You can still use :selenium, and also :cuprite is available for alternative to Poltergeist.\n    MSG\n  end\n\n  if driver_type == :selenium\n    gem \"selenium-webdriver\", \">= 4.0.0\"\n    require \"selenium/webdriver\"\n    @browser = Browser.new(options[:using])\n    @browser.preload\n  else\n    @browser = nil\n  end\nend\n".squish

Instance Attribute Details

#nameObject (readonly)

Returns the value of attribute name.



6
7
8
# File 'lib/action_dispatch/system_testing/driver.rb', line 6

def name
  @name
end

Instance Method Details

#useObject



33
34
35
36
37
# File 'lib/action_dispatch/system_testing/driver.rb', line 33

def use
  register if registerable?

  setup
end