Class: Capybara::SessionConfig

Inherits:
Object
  • Object
show all
Defined in:
lib/capybara/session/config.rb

Constant Summary collapse

OPTIONS =
%i[always_include_port run_server default_selector default_max_wait_time ignore_hidden_elements
automatic_reload match exact exact_text raise_server_errors visible_text_only
automatic_label_click enable_aria_label save_path asset_host default_host app_host
server_host server_port server_errors default_set_options disable_animation test_id
predicates_wait default_normalize_ws w3c_click_offset enable_aria_role].freeze

Instance Method Summary collapse

Instance Method Details

#always_include_portObject


67
# File 'lib/capybara/session/config.rb', line 67

remove_method :server_host

#app_hostObject


67
# File 'lib/capybara/session/config.rb', line 67

remove_method :server_host

#app_host=(url) ⇒ Object


83
84
85
86
87
88
89
# File 'lib/capybara/session/config.rb', line 83

def app_host=(url)
  unless url.nil? || url.match?(URI::DEFAULT_PARSER.make_regexp)
    raise ArgumentError, "Capybara.app_host should be set to a url (http://www.example.com). Attempted to set #{url.inspect}."
  end

  @app_host = url
end

#asset_hostObject


67
# File 'lib/capybara/session/config.rb', line 67

remove_method :server_host

#automatic_label_clickObject


67
# File 'lib/capybara/session/config.rb', line 67

remove_method :server_host

#automatic_reloadObject


67
# File 'lib/capybara/session/config.rb', line 67

remove_method :server_host

#default_hostObject


67
# File 'lib/capybara/session/config.rb', line 67

remove_method :server_host

#default_host=(url) ⇒ Object


92
93
94
95
96
97
98
# File 'lib/capybara/session/config.rb', line 92

def default_host=(url)
  unless url.nil? || url.match?(URI::DEFAULT_PARSER.make_regexp)
    raise ArgumentError, "Capybara.default_host should be set to a url (http://www.example.com). Attempted to set #{url.inspect}."
  end

  @default_host = url
end

#default_max_wait_timeObject


67
# File 'lib/capybara/session/config.rb', line 67

remove_method :server_host

#default_normalize_wsObject


67
# File 'lib/capybara/session/config.rb', line 67

remove_method :server_host

#default_selectorObject


67
# File 'lib/capybara/session/config.rb', line 67

remove_method :server_host

#default_set_optionsObject


67
# File 'lib/capybara/session/config.rb', line 67

remove_method :server_host

#disable_animationObject


67
# File 'lib/capybara/session/config.rb', line 67

remove_method :server_host

#enable_aria_labelObject


67
# File 'lib/capybara/session/config.rb', line 67

remove_method :server_host

#enable_aria_roleObject


67
# File 'lib/capybara/session/config.rb', line 67

remove_method :server_host

#exactObject


67
# File 'lib/capybara/session/config.rb', line 67

remove_method :server_host

#ignore_hidden_elementsObject


67
# File 'lib/capybara/session/config.rb', line 67

remove_method :server_host

#initialize_copy(other) ⇒ Object


113
114
115
116
# File 'lib/capybara/session/config.rb', line 113

def initialize_copy(other)
  super
  @server_errors = @server_errors.dup
end

#matchObject


67
# File 'lib/capybara/session/config.rb', line 67

remove_method :server_host

#raise_server_errorsObject


67
# File 'lib/capybara/session/config.rb', line 67

remove_method :server_host

#run_serverObject


67
# File 'lib/capybara/session/config.rb', line 67

remove_method :server_host

#save_pathObject


67
# File 'lib/capybara/session/config.rb', line 67

remove_method :server_host

#server_errorsObject


67
# File 'lib/capybara/session/config.rb', line 67

remove_method :server_host

#server_errors=(errors) ⇒ Object


78
79
80
# File 'lib/capybara/session/config.rb', line 78

def server_errors=(errors)
  (@server_errors ||= []).replace(errors.dup)
end

#server_hostString

Returns The IP address bound by default server.

Returns:

  • (String)

    The IP address bound by default server


67
# File 'lib/capybara/session/config.rb', line 67

remove_method :server_host

#server_portObject


67
# File 'lib/capybara/session/config.rb', line 67

remove_method :server_host

#test_idObject


67
# File 'lib/capybara/session/config.rb', line 67

remove_method :server_host

#test_id=(id) ⇒ Object

Set an attribue to be optionally matched against the locator for builtin selector types. This attribute will be checked by builtin selector types whenever id would normally be checked. If nil then it will be ignored.

Parameters:

  • id (String, Symbol, nil)

    Name of the attribute to use as the test id


109
110
111
# File 'lib/capybara/session/config.rb', line 109

def test_id=(id)
  @test_id = id&.to_sym
end

#visible_text_onlyObject


67
# File 'lib/capybara/session/config.rb', line 67

remove_method :server_host

#w3c_click_offsetObject


67
# File 'lib/capybara/session/config.rb', line 67

remove_method :server_host