]> git.ipfire.org Git - thirdparty/openembedded/openembedded-core-contrib.git/commitdiff
toaster: testsjs Add call back to append elements on completion of tests
authorMichael Wood <michael.g.wood@intel.com>
Mon, 4 Apr 2016 10:49:37 +0000 (11:49 +0100)
committerRichard Purdie <richard.purdie@linuxfoundation.org>
Mon, 13 Jun 2016 21:04:29 +0000 (22:04 +0100)
When the tests are complete add some marker elements to the test page
DOM which can then looked at for a selenium browser test.

Signed-off-by: Michael Wood <michael.g.wood@intel.com>
Signed-off-by: Elliot Smith <elliot.smith@intel.com>
lib/toaster/toastergui/static/js/tests/test.js

index aac0ba60a21675bde664862ee67c381e238ffef6..2b62118d01b9278d2e9c06fae5a5bccf9a18b041 100644 (file)
@@ -2,6 +2,13 @@
 /* Unit tests for Toaster's JS */
 
 /* libtoaster tests */
+QUnit.done(function(details){
+    /* Selenium test will look for these elements to get the results */
+  var body = $('body');
+  body.append("<span id='tests-failed'>"+details.failed+"</span>");
+  body.append("<span id='tests-passed'>"+details.passed+"</span>");
+  body.append("<span id='tests-total'>"+details.total+"</span>");
+});
 
 QUnit.test("Layer alert notification", function(assert) {
   var layer = {