How do you check if there is a redirection with casper (+phantom) ? Try it :
casper.test.begin('\n********* check 301 : ***********', function(test){
casper.start('http://www.linternaute.com/ville/rennes2/ville-35238', function(response){
this.test.assertHttpStatus(301);
})
.run(function() {
this.test.comment('--- Done ---\n');
test.done();
});
});
It works with casper+slimer but not with casper+phantom.
curl -i http://www.linternaute.com/ville/rennes2/ville-35238
output : HTTP/1.1 301 Moved Permanently
output casper+slimer : PASS HTTP status code is: 301
output casper+phantom : FAIL #current: 200, #expected: 301
-> issue?
Differences slimer/phantom -> When PhantomJS receives a redirection as HTTP response, it doesn’t call the onResponseReceive with the start status,slimerJS calls it