Commit 46690d33 46690d3366afd5434ed52e6170a80a2d6bfb4ad6 by Nicolas Perriault

tests should not rely on remote scripts

1 parent 33fe4345
/*global casper*/
/*jshint strict:false*/
casper.test.begin('remote script includes tests', 6, function(test) {
casper.test.begin('remote script includes tests', 4, {
setUp: function() {
casper.options.remoteScripts = [
'includes/include1.js', // local includes are actually served
'includes/include2.js', // through the local test webserver
'http://code.jquery.com/jquery-1.8.3.min.js'
'includes/include2.js' // through the local test webserver
];
},
tearDown: function() {
casper.options.remoteScripts = [];
},
test: function(test) {
casper.start('tests/site/index.html', function() {
test.assertSelectorHasText('#include1', 'include1',
'Casper.includeRemoteScripts() includes a first remote script on start');
test.assertSelectorHasText('#include2', 'include2',
'Casper.includeRemoteScripts() includes a second remote script on start');
test.assertEval(function() {
return 'jQuery' in window;
}, 'Casper.includeRemoteScripts() includes a really remote file on first step');
});
casper.thenOpen('tests/site/form.html', function() {
......@@ -22,13 +25,10 @@ casper.test.begin('remote script includes tests', 6, function(test) {
'Casper.includeRemoteScripts() includes a first remote script on second step');
test.assertSelectorHasText('#include2', 'include2',
'Casper.includeRemoteScripts() includes a second remote script on second step');
test.assertEval(function() {
return 'jQuery' in window;
}, 'Casper.includeRemoteScripts() includes a really remote file on second step');
});
casper.run(function() {
this.options.remoteScripts = [];
test.done();
});
}
});
......