Class: Capybara::Config
Relationships & Source Files | |
Super Chains via Extension / Inclusion / Inheritance | |
Class Chain:
self,
Forwardable
|
|
Inherits: | Object |
Defined in: | lib/capybara/config.rb |
Constant Summary
-
OPTIONS =
# File 'lib/capybara/config.rb', line 10%i[ app reuse_server threadsafe server default_driver javascript_driver use_html5_parsing allow_gumbo ].freeze
Class Method Summary
- .new ⇒ Config constructor
Instance Attribute Summary
- #allow_gumbo rw
- #allow_gumbo=(val) rw
- #app rw
- #default_driver ⇒ Symbol rw
- #default_driver=(value) rw
- #javascript_driver ⇒ Symbol rw
- #javascript_driver=(value) rw
- #reuse_server rw
- #reuse_server=(value) rw
-
#server
rw
Return the proc that
::Capybara
will call to run the Rack application. -
#server=(name)
rw
Set the server to use.
- #session_options readonly
- #threadsafe rw
- #threadsafe=(bool) rw
- #use_html5_parsing rw
Instance Method Summary
Constructor Details
.new ⇒ Config
# File 'lib/capybara/config.rb', line 22
def initialize @session_options = Capybara::SessionConfig.new @javascript_driver = nil end
Instance Attribute Details
#allow_gumbo (rw)
[ GitHub ]# File 'lib/capybara/config.rb', line 99
def allow_gumbo deprecate('allow_gumbo', 'use_html5_parsing') use_html5_parsing end
#allow_gumbo=(val) (rw)
[ GitHub ]# File 'lib/capybara/config.rb', line 94
def allow_gumbo=(val) deprecate('allow_gumbo=', 'use_html5_parsing=') self.use_html5_parsing = val end
#app (rw)
[ GitHub ]# File 'lib/capybara/config.rb', line 14
attr_accessor :app, :use_html5_parsing
#default_driver ⇒ Symbol
(rw)
# File 'lib/capybara/config.rb', line 74
def default_driver @default_driver || :rack_test end
#default_driver=(value) (rw)
[ GitHub ]# File 'lib/capybara/config.rb', line 16
attr_writer :default_driver, :javascript_driver
#javascript_driver ⇒ Symbol
(rw)
# File 'lib/capybara/config.rb', line 82
def javascript_driver @javascript_driver || :selenium end
#javascript_driver=(value) (rw)
[ GitHub ]# File 'lib/capybara/config.rb', line 16
attr_writer :default_driver, :javascript_driver
#reuse_server (rw)
[ GitHub ]# File 'lib/capybara/config.rb', line 15
attr_reader :reuse_server, :threadsafe, : # rubocop:disable Style/BisectedAttrAccessor
#reuse_server=(value) (rw)
[ GitHub ]# File 'lib/capybara/config.rb', line 27
attr_writer :reuse_server # rubocop:disable Style/BisectedAttrAccessor
#server (rw)
Return the proc that ::Capybara
will call to run the Rack application. The block returned receives a rack app, port, and host/ip and should run a Rack handler By default, ::Capybara
will try to use puma.
# File 'lib/capybara/config.rb', line 43
attr_reader :server
#server=(name) (rw)
#server=([name, options])
[ GitHub ]
#session_options (readonly)
[ GitHub ]# File 'lib/capybara/config.rb', line 15
attr_reader :reuse_server, :threadsafe, : # rubocop:disable Style/BisectedAttrAccessor
#threadsafe (rw)
[ GitHub ]# File 'lib/capybara/config.rb', line 15
attr_reader :reuse_server, :threadsafe, : # rubocop:disable Style/BisectedAttrAccessor
#threadsafe=(bool) (rw)
[ GitHub ]# File 'lib/capybara/config.rb', line 29
def threadsafe=(bool) if (bool != threadsafe) && Session.instance_created? raise 'Threadsafe setting cannot be changed once a session is created' end @threadsafe = bool end
#use_html5_parsing (rw)
[ GitHub ]# File 'lib/capybara/config.rb', line 14
attr_accessor :app, :use_html5_parsing
Instance Method Details
#deprecate(method, alternate_method, once: false)
[ GitHub ]# File 'lib/capybara/config.rb', line 86
def deprecate(method, alternate_method, once: false) @deprecation_notified ||= {} unless once && @deprecation_notified[method] Capybara::Helpers.warn "DEPRECATED: ##{method} is deprecated, please use ##{alternate_method} instead: #{Capybara::Helpers.filter_backtrace(caller)}" end @deprecation_notified[method] = true end