Class: SeleniumDSL::SeleniumWebdriver::DSL
- Inherits:
-
Object
- Object
- SeleniumDSL::SeleniumWebdriver::DSL
- Includes:
- SeleniumHelper
- Defined in:
- lib/selenium_dsl/selenium_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(selenium_host, selenium_port, browser, capabilities = {}) ⇒ DSL
constructor
A new instance of DSL.
- #selenium_webdriver(&block) ⇒ Object
- #start ⇒ Object
- #stop ⇒ Object
Methods included from SeleniumHelper
Constructor Details
#initialize(selenium_host, selenium_port, browser, capabilities = {}) ⇒ DSL
Returns a new instance of DSL.
14 15 16 17 18 19 20 21 |
# File 'lib/selenium_dsl/selenium_webdriver/dsl.rb', line 14 def initialize(selenium_host, selenium_port, browser, capabilities={}) @driver = Selenium::WebDriver.for(:remote, :url => construct_selenium_url(selenium_host, selenium_port), :desired_capabilities => browser.to_sym) @driver.capabilities.merge(capabilities) unless capabilities.empty? @script = SeleniumDSL::SeleniumWebdriver::Script.new @driver end |
Instance Attribute Details
#driver ⇒ Object (readonly)
Returns the value of attribute driver.
10 11 12 |
# File 'lib/selenium_dsl/selenium_webdriver/dsl.rb', line 10 def driver @driver end |
#script ⇒ Object (readonly)
Returns the value of attribute script.
10 11 12 |
# File 'lib/selenium_dsl/selenium_webdriver/dsl.rb', line 10 def script @script end |
#timeout_in_seconds=(timeout_in_seconds) ⇒ Object (writeonly)
Sets the attribute timeout_in_seconds
12 13 14 |
# File 'lib/selenium_dsl/selenium_webdriver/dsl.rb', line 12 def timeout_in_seconds=(value) @timeout_in_seconds = value end |
Instance Method Details
#selenium_webdriver(&block) ⇒ Object
35 36 37 38 39 |
# File 'lib/selenium_dsl/selenium_webdriver/dsl.rb', line 35 def selenium_webdriver(&block) @script.instance_eval(&block) @script end |
#start ⇒ Object
28 29 |
# File 'lib/selenium_dsl/selenium_webdriver/dsl.rb', line 28 def start end |
#stop ⇒ Object
31 32 33 |
# File 'lib/selenium_dsl/selenium_webdriver/dsl.rb', line 31 def stop @driver.quit end |