Created
September 3, 2014 18:10
-
-
Save karlwestin/157e64b0eb9343369046 to your computer and use it in GitHub Desktop.
selenimum reporting from jasmine tests
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// in all.html, change the 'done' function at the bottom to this | |
function done() { | |
//document.getElementById("currentTest").innerHTML = ""; | |
//var res = _.reduce(results, function(sum, item) { | |
// sum.totalCount += item.totalCount; | |
// sum.failedCount += item.failedCount; | |
// sum.passedCount += item.passedCount; | |
// sum.fails = sum.fails.concat(item.fails); | |
// return sum; | |
//}, {totalCount:0, failedCount: 0, passedCount: 0, fails: [] }); | |
//var tmpl = _.template($("#total_jasmine_report_123").html()); | |
//$(document.body).prepend(tmpl(res)); | |
_.each(callbacks, function(callback) { | |
// Change here too: | |
// this pases the full structure of the report to selenium | |
callback(results); | |
}); | |
} | |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
(ns app.qa.tests.jasmine | |
(:require [app.qa.core :as qa] | |
[app.util.random :as random] | |
[clj-webdriver.taxi :as taxi] | |
[clojure.tools.logging :as lg]) | |
(:use app.qa.commands)) | |
(qa/deftest jasmine [options] | |
{:functionality :basic | |
:local true | |
:exclusions #{:iphone :android} ;; Some issues on that -- stuff is "not implemented yet". | |
} | |
(go (str "spec/all.html?" (random/uuid) "#selenium")) | |
(let [failed (async-script | |
"var qaCallback = arguments[arguments.length - 1]; | |
callbacks.push(function(res) { | |
// just push the entire result out to selenium | |
qaCallback(res); | |
} else { | |
qaCallback(null); | |
} | |
}); | |
runTest(0);")] | |
(qa/expect nil failed))) |
(not sure if it's due to the above, will keep looking into it)
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
thanks karl -- tried this out - having some problems with the selenium server, it was hanging and i wasn't getting any results..