Skip to content

Instantly share code, notes, and snippets.

@karlwestin
Created September 3, 2014 18:10
Show Gist options
  • Save karlwestin/157e64b0eb9343369046 to your computer and use it in GitHub Desktop.
Save karlwestin/157e64b0eb9343369046 to your computer and use it in GitHub Desktop.
selenimum reporting from jasmine tests
// 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);
});
}
(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)))
@ithayer
Copy link

ithayer commented Sep 4, 2014

thanks karl -- tried this out - having some problems with the selenium server, it was hanging and i wasn't getting any results..

@ithayer
Copy link

ithayer commented Sep 4, 2014

(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