diff options
author | jakefeasel <jfeasel@gmail.com> | 2012-10-02 23:40:35 -0700 |
---|---|---|
committer | jakefeasel <jfeasel@gmail.com> | 2012-10-02 23:40:35 -0700 |
commit | 5a1aa534f28eb5f5dd74daae7300243dacbe93e3 (patch) | |
tree | 0472b39193147d052763c6020f312f9cc1c9788c | |
parent | 9ac18f73fa214fbad52cee71ea9b38b9f4b3583e (diff) | |
download | DDLBuilder-5a1aa534f28eb5f5dd74daae7300243dacbe93e3.zip DDLBuilder-5a1aa534f28eb5f5dd74daae7300243dacbe93e3.tar.gz DDLBuilder-5a1aa534f28eb5f5dd74daae7300243dacbe93e3.tar.bz2 |
Adding more detail to the output when the tests fail
-rw-r--r-- | run-qunit.js | 18 |
1 files changed, 17 insertions, 1 deletions
diff --git a/run-qunit.js b/run-qunit.js index d7df0c3..d713428 100644 --- a/run-qunit.js +++ b/run-qunit.js @@ -66,7 +66,23 @@ page.open(system.args[1], function(status){ var el = document.getElementById('qunit-testresult'); console.log(el.innerText); try { - return el.getElementsByClassName('failed')[0].innerHTML; + var tests = document.getElementById('qunit-tests').children; + for (var i = 0; i<tests.length; i++) + { + if (tests[i].className == "fail") + { + var specificTests = tests[i].getElementsByTagName("ol")[0].children; + for (var j=0;j<specificTests.length;j++) + { + if (specificTests[j].className == "fail") + { + console.log(tests[i].getElementsByClassName("test-name")[0].innerHTML +':' + specificTests[j].getElementsByClassName("test-message")[0].innerHTML + ' failed'); + } + } + } + } + + return el.getElementsByClassName('failed')[0].innerHTML; } catch (e) { } return 10000; }); |