mirror of https://github.com/vitalif/phantomjs
Non-zero exit code if any test fails.
In the callback function passed to `waitFor`, the call to `page.evaluate` returns a 1 or 0, and this is then passed to `phantom.exit` (with a 1 indicating at least one test failed, 0 indicating all tests passed). http://code.google.com/p/phantomjs/issues/detail?id=7921.8
parent
1dbd371540
commit
e85140e80f
|
@ -58,7 +58,7 @@ page.open(system.args[1], function(status){
|
|||
return document.body.querySelector('.symbolSummary .pending') === null
|
||||
});
|
||||
}, function(){
|
||||
page.evaluate(function(){
|
||||
var exitCode = page.evaluate(function(){
|
||||
console.log('');
|
||||
console.log(document.body.querySelector('.description').innerText);
|
||||
var list = document.body.querySelectorAll('.results > #details > .specDetail.failed');
|
||||
|
@ -74,11 +74,13 @@ page.open(system.args[1], function(status){
|
|||
console.log(msg.innerText);
|
||||
console.log('');
|
||||
}
|
||||
return 1;
|
||||
} else {
|
||||
console.log(document.body.querySelector('.alert > .passingAlert.bar').innerText);
|
||||
return 0;
|
||||
}
|
||||
});
|
||||
phantom.exit();
|
||||
phantom.exit(exitCode);
|
||||
});
|
||||
}
|
||||
});
|
||||
|
|
Loading…
Reference in New Issue