jejacks0n / teaspoon

Teaspoon: Javascript test runner for Rails. Use Selenium, BrowserStack, or PhantomJS.
1.43k stars 243 forks source link

test results from Teaspoon global #284

Closed brewster1134 closed 9 years ago

brewster1134 commented 9 years ago

I am trying to integrate teaspoon into Sauce Labs, however I need to access teaspoon test result data, but am unable to find where (if at all) it is stored.

e.g. After all my tests run, i need to populate a specific global object (as documented here)

_spechelper.coffee

after ->
  window.global_test_results =
    passed: 1
    failed: 3
    total: 4
    duration: 4321
    tests: [
      name: 'foo test'
      result: false
      message: 'sumthin bad'
      duration: 4000
    ,
      name: 'bar test'
      result: false
      message: 'failure'
      duration: 300
    ,
      name: 'baz test'
      result: true
      message: 'passed'
      duration: 20
    ,
      name: 'qux test'
      result: false
      message: 'test bad'
      duration: 1
    ]
jejacks0n commented 9 years ago

Test results aren't stored for memory reasons, they're dumped to STDOUT and cleaned up.. I'm not opposed to this idea though, so let me know what you find. Sorry I've been MIA on work stuff.

jejacks0n commented 9 years ago

Would accept a PR for integration with sauce labs, but have not needed it thus far. Seems like an interesting challenge though.