Test failure CSS selectors changed.

Changed the CSS selectors used to identify failed tests.

The old selector was `div.jasmine_reporter > div.suite.failed`,
but this no longer seems to match any elements.

The new selector is `.results > #details > .specDetails.failed`. For each
failing test the `.description` and `.resultMessage.fail` elements are
used to output the failures to the console.

http://code.google.com/p/phantomjs/issues/detail?id=792
1.8
Ian Oxley 2012-09-11 14:04:42 +01:00 committed by Ariya Hidayat
parent 2662d5875b
commit be767ee983
1 changed files with 14 additions and 8 deletions

View File

@ -59,15 +59,21 @@ page.open(system.args[1], function(status){
});
}, function(){
page.evaluate(function(){
console.log('');
console.log(document.body.querySelector('.description').innerText);
list = document.body.querySelectorAll('div.jasmine_reporter > div.suite.failed');
for (i = 0; i < list.length; ++i) {
el = list[i];
desc = el.querySelectorAll('.description');
console.log('');
for (j = 0; j < desc.length; ++j) {
console.log(desc[j].innerText);
}
var list = document.body.querySelectorAll('.results > #details > .specDetail.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('.resultMessage.fail');
console.log('');
console.log(desc.innerText);
console.log(msg.innerText);
console.log('');
}
}
});
phantom.exit();