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 {
|
} else {
|
||||||
waitFor(function(){
|
waitFor(function(){
|
||||||
return page.evaluate(function(){
|
return page.evaluate(function(){
|
||||||
return (document.body.querySelector('.symbolSummary .pending') === null &&
|
return (document.body.querySelector('.jasmine-symbol-summary .jasmine-pending') === null &&
|
||||||
document.body.querySelector('.duration') !== null);
|
document.body.querySelector('.jasmine-duration') !== null);
|
||||||
});
|
});
|
||||||
}, function(){
|
}, function(){
|
||||||
var exitCode = page.evaluate(function(){
|
var exitCode = page.evaluate(function(){
|
||||||
console.log('');
|
console.log('');
|
||||||
|
|
||||||
var title = 'Jasmine';
|
var title = 'Jasmine';
|
||||||
var version = document.body.querySelector('.version').innerText;
|
var version = document.body.querySelector('.jasmine-version').innerText;
|
||||||
var duration = document.body.querySelector('.duration').innerText;
|
var duration = document.body.querySelector('.jasmine-duration').innerText;
|
||||||
var banner = title + ' ' + version + ' ' + duration;
|
var banner = title + ' ' + version + ' ' + duration;
|
||||||
console.log(banner);
|
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) {
|
if (list && list.length > 0) {
|
||||||
console.log('');
|
console.log('');
|
||||||
console.log(list.length + ' test(s) FAILED:');
|
console.log(list.length + ' test(s) FAILED:');
|
||||||
for (i = 0; i < list.length; ++i) {
|
for (i = 0; i < list.length; ++i) {
|
||||||
var el = list[i],
|
var el = list[i],
|
||||||
desc = el.querySelector('.description'),
|
desc = el.querySelector('.jasmine-description'),
|
||||||
msg = el.querySelector('.messages > .result-message');
|
msg = el.querySelector('.jasmine-messages > .jasmine-result-message');
|
||||||
console.log('');
|
console.log('');
|
||||||
console.log(desc.innerText);
|
console.log(desc.innerText);
|
||||||
console.log(msg.innerText);
|
console.log(msg.innerText);
|
||||||
console.log('');
|
console.log('');
|
||||||
}
|
}
|
||||||
return 1;
|
return 1;
|
||||||
} else {
|
} else {
|
||||||
console.log(document.body.querySelector('.alert > .bar.passed,.alert > .bar.skipped').innerText);
|
console.log(document.body.querySelector('.jasmine-alert > .jasmine-bar.jasmine-passed,.jasmine-alert > .jasmine-bar.jasmine-skipped').innerText);
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
phantom.exit(exitCode);
|
phantom.exit(exitCode);
|
||||||
|
Loading…
Reference in New Issue
Block a user