mirror of
https://github.com/ariya/phantomjs.git
synced 2024-09-11 04:46:09 +03:00
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=792
This commit is contained in:
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
Block a user