Class: EasyAutomation::Config
- Inherits:
-
Object
- Object
- EasyAutomation::Config
- Defined in:
- lib/easy_automation/config.rb
Instance Attribute Summary collapse
-
#browsers ⇒ Object
Returns the value of attribute browsers.
-
#current_browser ⇒ Object
Returns the value of attribute current_browser.
-
#hooks ⇒ Object
readonly
Returns the value of attribute hooks.
-
#selenium_host ⇒ Object
Returns the value of attribute selenium_host.
-
#selenium_port ⇒ Object
Returns the value of attribute selenium_port.
-
#selenium_timeout ⇒ Object
Returns the value of attribute selenium_timeout.
-
#url ⇒ Object
Returns the value of attribute url.
Instance Method Summary collapse
- #add_browser(browser) ⇒ Object
- #after(hook, &block) ⇒ Object
- #before(hook, &block) ⇒ Object
- #browser=(browser) ⇒ Object
- #execute(type, hook_name) ⇒ Object
-
#initialize ⇒ Config
constructor
Default settings for selenium RC.
Constructor Details
#initialize ⇒ Config
Default settings for selenium RC
21 22 23 24 25 26 27 |
# File 'lib/easy_automation/config.rb', line 21 def initialize @browsers = [] @selenium_port = 4444 @selenium_timeout = 4000 @url = "http://www.google.com" @hooks = {:before => {}, :after =>{}} end |
Instance Attribute Details
#browsers ⇒ Object
Returns the value of attribute browsers.
14 15 16 |
# File 'lib/easy_automation/config.rb', line 14 def browsers @browsers end |
#current_browser ⇒ Object
Returns the value of attribute current_browser.
13 14 15 |
# File 'lib/easy_automation/config.rb', line 13 def current_browser @current_browser end |
#hooks ⇒ Object (readonly)
Returns the value of attribute hooks.
15 16 17 |
# File 'lib/easy_automation/config.rb', line 15 def hooks @hooks end |
#selenium_host ⇒ Object
Returns the value of attribute selenium_host.
11 12 13 |
# File 'lib/easy_automation/config.rb', line 11 def selenium_host @selenium_host end |
#selenium_port ⇒ Object
Returns the value of attribute selenium_port.
9 10 11 |
# File 'lib/easy_automation/config.rb', line 9 def selenium_port @selenium_port end |
#selenium_timeout ⇒ Object
Returns the value of attribute selenium_timeout.
10 11 12 |
# File 'lib/easy_automation/config.rb', line 10 def selenium_timeout @selenium_timeout end |
#url ⇒ Object
Returns the value of attribute url.
12 13 14 |
# File 'lib/easy_automation/config.rb', line 12 def url @url end |
Instance Method Details
#add_browser(browser) ⇒ Object
33 34 35 |
# File 'lib/easy_automation/config.rb', line 33 def add_browser browser @browsers << browser end |
#after(hook, &block) ⇒ Object
49 50 51 |
# File 'lib/easy_automation/config.rb', line 49 def after hook, &block @hooks[:after].merge!({hook.to_sym => block}) if block_given? end |
#before(hook, &block) ⇒ Object
45 46 47 |
# File 'lib/easy_automation/config.rb', line 45 def before hook, &block @hooks[:before].merge!({hook.to_sym => block}) if block_given? end |
#browser=(browser) ⇒ Object
29 30 31 |
# File 'lib/easy_automation/config.rb', line 29 def browser=(browser) @browsers = [browser] end |
#execute(type, hook_name) ⇒ Object
53 54 55 |
# File 'lib/easy_automation/config.rb', line 53 def execute type, hook_name @hooks[type.to_sym][hook_name.to_sym].call if @hooks[type.to_sym][hook_name.to_sym] end |