Class: QUnit::Selenium::TestRunner
- Inherits:
-
Object
- Object
- QUnit::Selenium::TestRunner
- Defined in:
- lib/qunit/selenium/test_runner.rb
Instance Method Summary collapse
-
#initialize(driver = nil) ⇒ TestRunner
constructor
A new instance of TestRunner.
- #open(url, options = {}) ⇒ Object
Constructor Details
#initialize(driver = nil) ⇒ TestRunner
Returns a new instance of TestRunner.
7 8 9 |
# File 'lib/qunit/selenium/test_runner.rb', line 7 def initialize(driver = nil) @driver = driver || ::Selenium::WebDriver.for(:firefox) end |
Instance Method Details
#open(url, options = {}) ⇒ Object
11 12 13 14 15 16 17 18 19 20 21 22 23 |
# File 'lib/qunit/selenium/test_runner.rb', line 11 def open(url, = {}) timeout = [:timeout] || 10 force_refresh = [:force_refresh] || false @driver.get url @driver.navigate.refresh if force_refresh TestRun.new(@driver).tap do |run| ::Selenium::WebDriver::Wait.new(timeout: timeout).until do run.completed? end end.result end |