Class: SeleniumDSL::WatirWebdriver::DSL
- Inherits:
-
Object
- Object
- SeleniumDSL::WatirWebdriver::DSL
- Defined in:
- lib/selenium_dsl/watir_webdriver/dsl.rb
Instance Attribute Summary collapse
-
#driver ⇒ Object
readonly
Returns the value of attribute driver.
-
#script ⇒ Object
readonly
Returns the value of attribute script.
-
#timeout_in_seconds ⇒ Object
writeonly
Sets the attribute timeout_in_seconds.
Instance Method Summary collapse
-
#initialize(browser, capabilities = {}) ⇒ DSL
constructor
A new instance of DSL.
- #start ⇒ Object
- #stop ⇒ Object
- #watir_webdriver(&block) ⇒ Object
Constructor Details
#initialize(browser, capabilities = {}) ⇒ DSL
Returns a new instance of DSL.
11 12 13 14 15 16 17 |
# File 'lib/selenium_dsl/watir_webdriver/dsl.rb', line 11 def initialize(browser, capabilities={}) @driver = Watir::Browser.new browser.to_sym @driver.capabilities.merge(capabilities) unless capabilities.empty? @script = SeleniumDSL::WatirWebdriver::Script.new @driver end |
Instance Attribute Details
#driver ⇒ Object (readonly)
Returns the value of attribute driver.
7 8 9 |
# File 'lib/selenium_dsl/watir_webdriver/dsl.rb', line 7 def driver @driver end |
#script ⇒ Object (readonly)
Returns the value of attribute script.
7 8 9 |
# File 'lib/selenium_dsl/watir_webdriver/dsl.rb', line 7 def script @script end |
#timeout_in_seconds=(timeout_in_seconds) ⇒ Object (writeonly)
Sets the attribute timeout_in_seconds
9 10 11 |
# File 'lib/selenium_dsl/watir_webdriver/dsl.rb', line 9 def timeout_in_seconds=(value) @timeout_in_seconds = value end |
Instance Method Details
#start ⇒ Object
23 24 |
# File 'lib/selenium_dsl/watir_webdriver/dsl.rb', line 23 def start end |
#stop ⇒ Object
26 27 28 |
# File 'lib/selenium_dsl/watir_webdriver/dsl.rb', line 26 def stop @driver.close end |
#watir_webdriver(&block) ⇒ Object
30 31 32 33 34 |
# File 'lib/selenium_dsl/watir_webdriver/dsl.rb', line 30 def watir_webdriver(&block) @script.instance_eval(&block) @script end |