Class: SeleniumConnect::Configuration
- Inherits:
-
Object
- Object
- SeleniumConnect::Configuration
- Defined in:
- lib/selenium-connect/configuration.rb
Overview
Encapsulates the configuration
Instance Attribute Summary collapse
-
#background ⇒ Object
Selenium Server.
-
#browser ⇒ Object
Browsers.
-
#browser_path ⇒ Object
Browsers.
-
#browser_version ⇒ Object
SauceLabs.
-
#description ⇒ Object
SauceLabs.
-
#host ⇒ Object
Selenium Server.
-
#jar ⇒ Object
Selenium Server.
-
#log ⇒ Object
Selenium Server.
-
#os ⇒ Object
SauceLabs.
-
#port ⇒ Object
Selenium Server.
-
#profile_name ⇒ Object
Browsers.
-
#profile_path ⇒ Object
Browsers.
-
#sauce_api_key ⇒ Object
SauceLabs.
-
#sauce_username ⇒ Object
SauceLabs.
-
#version ⇒ Object
Selenium Server.
Instance Method Summary collapse
-
#initialize ⇒ Configuration
constructor
A new instance of Configuration.
- #populate_with_hash(hash) ⇒ Object
- #populate_with_yaml(file) ⇒ Object (also: #config_file=)
Constructor Details
#initialize ⇒ Configuration
21 22 23 24 25 |
# File 'lib/selenium-connect/configuration.rb', line 21 def initialize @host = 'localhost' @port = 4444 @browser = 'firefox' end |
Instance Attribute Details
#background ⇒ Object
Selenium Server
10 11 12 |
# File 'lib/selenium-connect/configuration.rb', line 10 def background @background end |
#browser ⇒ Object
Browsers
14 15 16 |
# File 'lib/selenium-connect/configuration.rb', line 14 def browser @browser end |
#browser_path ⇒ Object
Browsers
14 15 16 |
# File 'lib/selenium-connect/configuration.rb', line 14 def browser_path @browser_path end |
#browser_version ⇒ Object
SauceLabs
18 19 20 |
# File 'lib/selenium-connect/configuration.rb', line 18 def browser_version @browser_version end |
#description ⇒ Object
SauceLabs
18 19 20 |
# File 'lib/selenium-connect/configuration.rb', line 18 def description @description end |
#host ⇒ Object
Selenium Server
10 11 12 |
# File 'lib/selenium-connect/configuration.rb', line 10 def host @host end |
#jar ⇒ Object
Selenium Server
10 11 12 |
# File 'lib/selenium-connect/configuration.rb', line 10 def jar @jar end |
#log ⇒ Object
Selenium Server
10 11 12 |
# File 'lib/selenium-connect/configuration.rb', line 10 def log @log end |
#os ⇒ Object
SauceLabs
18 19 20 |
# File 'lib/selenium-connect/configuration.rb', line 18 def os @os end |
#port ⇒ Object
Selenium Server
10 11 12 |
# File 'lib/selenium-connect/configuration.rb', line 10 def port @port end |
#profile_name ⇒ Object
Browsers
14 15 16 |
# File 'lib/selenium-connect/configuration.rb', line 14 def profile_name @profile_name end |
#profile_path ⇒ Object
Browsers
14 15 16 |
# File 'lib/selenium-connect/configuration.rb', line 14 def profile_path @profile_path end |
#sauce_api_key ⇒ Object
SauceLabs
18 19 20 |
# File 'lib/selenium-connect/configuration.rb', line 18 def sauce_api_key @sauce_api_key end |
#sauce_username ⇒ Object
SauceLabs
18 19 20 |
# File 'lib/selenium-connect/configuration.rb', line 18 def sauce_username @sauce_username end |
#version ⇒ Object
Selenium Server
10 11 12 |
# File 'lib/selenium-connect/configuration.rb', line 10 def version @version end |
Instance Method Details
#populate_with_hash(hash) ⇒ Object
27 28 29 30 31 32 33 34 35 |
# File 'lib/selenium-connect/configuration.rb', line 27 def populate_with_hash(hash) hash.each do |key, value| begin self.send "#{key}=", value unless value.nil? rescue NoMethodError raise ArgumentError.new "The config key: \"#{key}\" is unknown!" end end end |
#populate_with_yaml(file) ⇒ Object Also known as: config_file=
37 38 39 |
# File 'lib/selenium-connect/configuration.rb', line 37 def populate_with_yaml(file) populate_with_hash YAML.load_file file end |