Commit 3aebbea6 3aebbea6b29f64a7008658780001c8677eea25e0 by oncletom Committed by Nicolas Perriault

Testing response as argument of step function

1 parent 7958d51d
......@@ -20,12 +20,12 @@ function dumpHeaders () {
});
}
casper.start('tests/site/index.html', function thenLocalPage () {
this.test.assertEquals(casper.currentResponse, undefined, 'No response available on local page');
casper.start('tests/site/index.html', function thenLocalPage (response) {
this.test.assertEquals(response, undefined, 'No response available on local page');
});
casper.thenOpen('http://localhost:8090/', function thenLocalhost () {
var headers = casper.currentResponse.headers;
casper.thenOpen('http://localhost:8090/', function thenLocalhost (response) {
var headers = response.headers;
this.test.assertEquals(headers.get('Content-Language'), 'en', 'Checking existing header (case sensitive)');
this.test.assertEquals(headers.get('content-language'), 'en', 'Checking existing header (case insensitive)');
......
......@@ -4,8 +4,9 @@ casper.start('tests/site/index.html');
var nsteps = casper.steps.length;
casper.then(function(self) {
casper.then(function(response) {
this.test.assertTitle('CasperJS test index', 'Casper.then() added a new step');
this.test.assert(response === undefined, 'Casper.then() response is undefined in local mode');
});
casper.test.assertEquals(casper.steps.length, nsteps + 1, 'Casper.then() can add a new step');
......