mirror of
https://github.com/ariya/phantomjs.git
synced 2024-09-11 04:46:09 +03:00
Upgrade example to run with Jasmine 2.4.1
https://github.com/ariya/phantomjs/issues/14280
This commit is contained in:
parent
d77b8dde0a
commit
7079696db6
@ -56,36 +56,36 @@ page.open(system.args[1], function(status){
|
||||
} else {
|
||||
waitFor(function(){
|
||||
return page.evaluate(function(){
|
||||
return (document.body.querySelector('.symbolSummary .pending') === null &&
|
||||
document.body.querySelector('.duration') !== null);
|
||||
return (document.body.querySelector('.jasmine-symbol-summary .jasmine-pending') === null &&
|
||||
document.body.querySelector('.jasmine-duration') !== null);
|
||||
});
|
||||
}, function(){
|
||||
var exitCode = page.evaluate(function(){
|
||||
console.log('');
|
||||
|
||||
var title = 'Jasmine';
|
||||
var version = document.body.querySelector('.version').innerText;
|
||||
var duration = document.body.querySelector('.duration').innerText;
|
||||
var version = document.body.querySelector('.jasmine-version').innerText;
|
||||
var duration = document.body.querySelector('.jasmine-duration').innerText;
|
||||
var banner = title + ' ' + version + ' ' + duration;
|
||||
console.log(banner);
|
||||
|
||||
var list = document.body.querySelectorAll('.results > .failures > .spec-detail.failed');
|
||||
var list = document.body.querySelectorAll('.jasmine-results > .jasmine-failures > .jasmine-spec-detail.jasmine-failed');
|
||||
if (list && list.length > 0) {
|
||||
console.log('');
|
||||
console.log(list.length + ' test(s) FAILED:');
|
||||
for (i = 0; i < list.length; ++i) {
|
||||
var el = list[i],
|
||||
desc = el.querySelector('.description'),
|
||||
msg = el.querySelector('.messages > .result-message');
|
||||
console.log('');
|
||||
console.log(desc.innerText);
|
||||
console.log(msg.innerText);
|
||||
console.log('');
|
||||
}
|
||||
return 1;
|
||||
console.log('');
|
||||
console.log(list.length + ' test(s) FAILED:');
|
||||
for (i = 0; i < list.length; ++i) {
|
||||
var el = list[i],
|
||||
desc = el.querySelector('.jasmine-description'),
|
||||
msg = el.querySelector('.jasmine-messages > .jasmine-result-message');
|
||||
console.log('');
|
||||
console.log(desc.innerText);
|
||||
console.log(msg.innerText);
|
||||
console.log('');
|
||||
}
|
||||
return 1;
|
||||
} else {
|
||||
console.log(document.body.querySelector('.alert > .bar.passed,.alert > .bar.skipped').innerText);
|
||||
return 0;
|
||||
console.log(document.body.querySelector('.jasmine-alert > .jasmine-bar.jasmine-passed,.jasmine-alert > .jasmine-bar.jasmine-skipped').innerText);
|
||||
return 0;
|
||||
}
|
||||
});
|
||||
phantom.exit(exitCode);
|
||||
|
Loading…
Reference in New Issue
Block a user