Class: EasyAutomation::Config
- Inherits:
-
Object
- Object
- EasyAutomation::Config
- Defined in:
- lib/easy_automation/config.rb
Instance Attribute Summary collapse
-
#browser ⇒ Object
Returns the value of attribute browser.
-
#hooks ⇒ Object
readonly
Returns the value of attribute hooks.
-
#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
- #after(hook, &block) ⇒ Object
- #before(hook, &block) ⇒ Object
- #execute(type, hook_name) ⇒ Object
-
#initialize ⇒ Config
constructor
Default settings for selenium RC.
- #load_files(pattern) ⇒ Object
Constructor Details
#initialize ⇒ Config
Default settings for selenium RC
18 19 20 21 22 23 24 |
# File 'lib/easy_automation/config.rb', line 18 def initialize @selenium_port = 4444 @selenium_timeout = 1000 @browser = "Firefox" @url = "http://www.google.com" @hooks = {:before => {}, :after =>{}} end |
Instance Attribute Details
#browser ⇒ Object
Returns the value of attribute browser.
11 12 13 |
# File 'lib/easy_automation/config.rb', line 11 def browser @browser end |
#hooks ⇒ Object (readonly)
Returns the value of attribute hooks.
13 14 15 |
# File 'lib/easy_automation/config.rb', line 13 def hooks @hooks 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
#after(hook, &block) ⇒ Object
30 31 32 |
# File 'lib/easy_automation/config.rb', line 30 def after hook, &block @hooks[:after].merge!({hook.to_sym => block}) if block_given? end |
#before(hook, &block) ⇒ Object
26 27 28 |
# File 'lib/easy_automation/config.rb', line 26 def before hook, &block @hooks[:before].merge!({hook.to_sym => block}) if block_given? end |
#execute(type, hook_name) ⇒ Object
34 35 36 |
# File 'lib/easy_automation/config.rb', line 34 def execute type, hook_name @hooks[type.to_sym][hook_name.to_sym].call if @hooks[type.to_sym][hook_name.to_sym] end |
#load_files(pattern) ⇒ Object
38 39 40 41 |
# File 'lib/easy_automation/config.rb', line 38 def load_files pattern puts '888888888888 ENTRE!!!' Dir[pattern].each { |f| require f } end |