Class: Sauce::Jasmine::SeleniumDriver
- Inherits:
-
Jasmine::SeleniumDriver
- Object
- Jasmine::SeleniumDriver
- Sauce::Jasmine::SeleniumDriver
- Defined in:
- lib/sauce/jasmine/selenium_driver.rb
Instance Method Summary collapse
-
#initialize(os, browser, browser_version, domain) ⇒ SeleniumDriver
constructor
A new instance of SeleniumDriver.
- #job_id ⇒ Object
- #test_results ⇒ Object
- #test_suites ⇒ Object
- #tests_have_finished? ⇒ Boolean
Constructor Details
#initialize(os, browser, browser_version, domain) ⇒ SeleniumDriver
Returns a new instance of SeleniumDriver.
6 7 8 9 10 11 12 13 14 |
# File 'lib/sauce/jasmine/selenium_driver.rb', line 6 def initialize(os, browser, browser_version, domain) host = host[7..-1] if host =~ /^http:\/\// base_url = "http://#{domain}" @driver = Sauce::Selenium.new(:browser => browser, :os => os, :browser_version => browser_version, :browser_url => base_url, :job_name => "Jasmine") end |
Instance Method Details
#job_id ⇒ Object
28 29 30 |
# File 'lib/sauce/jasmine/selenium_driver.rb', line 28 def job_id @driver.session_id end |
#test_results ⇒ Object
24 25 26 |
# File 'lib/sauce/jasmine/selenium_driver.rb', line 24 def test_results eval_js("var result = jsApiReporter.results(); if (window.Prototype && Object.toJSON) { Object.toJSON(result) } else { JSON.stringify(result) }") end |
#test_suites ⇒ Object
20 21 22 |
# File 'lib/sauce/jasmine/selenium_driver.rb', line 20 def test_suites eval_js("var result = jsApiReporter.suites(); if (window.Prototype && Object.toJSON) { Object.toJSON(result) } else { JSON.stringify(result) }") end |
#tests_have_finished? ⇒ Boolean
16 17 18 |
# File 'lib/sauce/jasmine/selenium_driver.rb', line 16 def tests_have_finished? eval_js("jsApiReporter && jsApiReporter.finished") end |