Class: SeleniumConnect::Configuration

Inherits:
Object
  • Object
show all
Defined in:
lib/selenium-connect/configuration.rb

Overview

Encapsulates the configuration

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initializeConfiguration



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

#backgroundObject

Selenium Server



10
11
12
# File 'lib/selenium-connect/configuration.rb', line 10

def background
  @background
end

#browserObject

Browsers



14
15
16
# File 'lib/selenium-connect/configuration.rb', line 14

def browser
  @browser
end

#browser_pathObject

Browsers



14
15
16
# File 'lib/selenium-connect/configuration.rb', line 14

def browser_path
  @browser_path
end

#browser_versionObject

SauceLabs



18
19
20
# File 'lib/selenium-connect/configuration.rb', line 18

def browser_version
  @browser_version
end

#descriptionObject

SauceLabs



18
19
20
# File 'lib/selenium-connect/configuration.rb', line 18

def description
  @description
end

#hostObject

Selenium Server



10
11
12
# File 'lib/selenium-connect/configuration.rb', line 10

def host
  @host
end

#jarObject

Selenium Server



10
11
12
# File 'lib/selenium-connect/configuration.rb', line 10

def jar
  @jar
end

#logObject

Selenium Server



10
11
12
# File 'lib/selenium-connect/configuration.rb', line 10

def log
  @log
end

#osObject

SauceLabs



18
19
20
# File 'lib/selenium-connect/configuration.rb', line 18

def os
  @os
end

#portObject

Selenium Server



10
11
12
# File 'lib/selenium-connect/configuration.rb', line 10

def port
  @port
end

#profile_nameObject

Browsers



14
15
16
# File 'lib/selenium-connect/configuration.rb', line 14

def profile_name
  @profile_name
end

#profile_pathObject

Browsers



14
15
16
# File 'lib/selenium-connect/configuration.rb', line 14

def profile_path
  @profile_path
end

#sauce_api_keyObject

SauceLabs



18
19
20
# File 'lib/selenium-connect/configuration.rb', line 18

def sauce_api_key
  @sauce_api_key
end

#sauce_usernameObject

SauceLabs



18
19
20
# File 'lib/selenium-connect/configuration.rb', line 18

def sauce_username
  @sauce_username
end

#versionObject

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