]> git.ipfire.org Git - thirdparty/openembedded/openembedded-core-contrib.git/commitdiff
bitbake: 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>
Wed, 15 Jun 2016 07:35:03 +0000 (08:35 +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.

(Bitbake rev: 81798ab046b0717614e28e0a339172f3803e451b)

Signed-off-by: Michael Wood <michael.g.wood@intel.com>
Signed-off-by: Elliot Smith <elliot.smith@intel.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
bitbake/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 = {