@samitouri / QOS-React-2 / commits / d9b7e47824

sped up the webdriver tests

Thomas Aylott committed Nov 11, 2013 at 15:11 UTC d9b7e478241a029fbb2cd09ad2c373f8c5504050
2 files changed +6 -6
grunt/config/webdriver-jasmine.js
+2 -2
@@ -6,8 +6,8 @@ exports.local = {
6 remote: { protocol: 'http:', hostname: '127.0.0.1', port: 9515, path: '/' }
7 },
8 url: "http://127.0.0.1:9999/test/index.html",
9 - onComplete: function(report){
10 - if (!report.passed){
9 + onComplete: function(passed){
10 + if (!passed){
11 grunt.fatal("tests failed");
12 }
13 },
grunt/tasks/webdriver-jasmine.js
+4 -4
@@ -23,7 +23,7 @@ module.exports = function(){
23 grunt.verbose.writeln(' > ' + meth, path, data || '');
24 });
25
26 - var report = null;
26 + var results = null;
27
28 // browser._debugPromise();
29 browser
@@ -32,7 +32,7 @@ module.exports = function(){
32 .get(config.url)
33 .then(function(){return browser;})
34 .then(getJSReport)
35 - .then(function(data){ report = data; })
35 + .then(function(data){ results = data; })
36 .fail(function(error){
37 grunt.log.error(error);
38 return browser
@@ -48,7 +48,7 @@ module.exports = function(){
48 })
49 .done(
50 function(){
51 - if (config.onComplete) config.onComplete(report);
51 + if (config.onComplete) config.onComplete(results);
52 taskSucceeded(true);
53 },
54 function(error){
@@ -67,6 +67,6 @@ function getJSReport(browser){
67 })
68 .waitForCondition("typeof window.jasmine.getJSReport != 'undefined'", 10e3)
69 .waitForCondition("window.postDataToURL.running <= 0", 30e3)
70 - .eval("jasmine.getJSReport()")
70 + .eval("jasmine.getJSReport().passed")
71 ;
72 }