Class: Sauce::Jasmine::SeleniumDriver

Inherits:
Jasmine::SeleniumDriver
  • Object
show all
Defined in:
lib/sauce/jasmine/selenium_driver.rb

Instance Method Summary collapse

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_idObject



28
29
30
# File 'lib/sauce/jasmine/selenium_driver.rb', line 28

def job_id
  @driver.session_id
end

#test_resultsObject



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_suitesObject



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

Returns:

  • (Boolean)


16
17
18
# File 'lib/sauce/jasmine/selenium_driver.rb', line 16

def tests_have_finished?
  eval_js("jsApiReporter && jsApiReporter.finished")
end