Commit 77f99b04 77f99b0440fb1c4bb2e93737f4ed91c3f3533ff9 by Nicolas Perriault

ensured travis-ci is able to run the tests using phantomjs 1.5

1 parent 35533322
var received;
// skip this test for phantom versions < 1.5
if (phantom.version.major === 1 && phantom.version.minor < 6) {
casper.test.comment('Skipped tests, PhantomJS 1.6 required');
casper.test.done();
} else {
var received;
casper.setFilter('page.confirm', function(message) {
casper.setFilter('page.confirm', function(message) {
received = message;
return true;
});
});
casper.start('tests/site/confirm.html', function() {
casper.start('tests/site/confirm.html', function() {
this.test.assert(this.getGlobal('confirmed'), 'confirmation received');
});
});
casper.run(function() {
casper.run(function() {
this.test.assertEquals(received, 'are you sure?', 'confirmation message is ok');
this.test.done();
});
});
}
......
casper.setFilter('page.prompt', function(message, value) {
// skip this test for phantom versions < 1.5
if (phantom.version.major === 1 && phantom.version.minor < 6) {
casper.test.comment('Skipped tests, PhantomJS 1.6 required');
casper.test.done();
} else {
casper.setFilter('page.prompt', function(message, value) {
return 'Chuck ' + value;
});
});
casper.start('tests/site/prompt.html', function() {
casper.start('tests/site/prompt.html', function() {
this.test.assertEquals(this.getGlobal('name'), 'Chuck Norris', 'prompted value has been received');
});
});
casper.run(function() {
casper.run(function() {
this.test.done();
});
});
}
......