Launcher for ECMA-262 test suite (test262.ecmascript.org).

https://github.com/ariya/phantomjs/issues/12439
2.0
Ariya Hidayat 2014-08-16 20:45:59 -07:00
parent 25ddf566e7
commit fbe8eefc29
1 changed files with 36 additions and 0 deletions

View File

@ -0,0 +1,36 @@
// Launch the official test suite for ECMA-262
var webpage = require('webpage');
page = webpage.create();
page.onError = function() {};
page.open('http://test262.ecmascript.org/', function() {
page.evaluate(function() { $('a#run').click(); });
page.evaluate(function() { $('img#btnRunAll').click(); });
function monitor() {
var data = page.evaluate(function() {
return {
ran: $('#totalCounter').text(),
total: $('#testsToRun').text(),
pass: $('#Pass').text(),
fail: $('#Fail').text(),
progress: $('div#progressbar').text()
};
});
console.log('Tests: ', data.ran, 'of', data.total,
' Pass:', data.pass, ' Fail:', data.fail);
if (data.progress.indexOf('complete') > 0) {
page.render('report.png');
phantom.exit();
} else {
setTimeout(monitor, 1000);
}
}
setTimeout(monitor, 0);
});