casper (+phantom) でリダイレクトがあるかどうかを確認するにはどうすればよいですか? それを試してみてください :
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();
});
});
casper+slimer では機能しますが、casper+phantom では機能しません。
curl -i http://www.linternaute.com/ville/rennes2/ville-35238
出力:HTTP/1.1 301 Moved Permanently
出力 casper+slimer :PASS HTTP status code is: 301
出力 casper+phantom : FAIL #current: 200, #expected: 301
-> issue?
スリム化/ファントムの違い->When PhantomJS receives a redirection as HTTP response, it doesn’t call the onResponseReceive with the start status,slimerJS calls it