0
我如何測試我的表單正在提交到受保護的頁面。喜歡assertHttpStatus()
?有沒有可以返回返回頁面的協議的函數?是否有斷言測試來確保頁面通過SSL?
我如何測試我的表單正在提交到受保護的頁面。喜歡assertHttpStatus()
?有沒有可以返回返回頁面的協議的函數?是否有斷言測試來確保頁面通過SSL?
從the docs採取(幾乎直接),assertUrlMatch似乎是正確的選擇;
casper.test.begin('assertUrlMatch() tests', 1, function(test) {
casper.start('https://www.google.com/', function() {
test.assertUrlMatch(/^https:\/\//, 'google.com is served in https://');
}).run(function() {
test.done();
});
});
當重定向到http頁時,這個斷言甚至會正確地失敗。請記住,只有在最後一頁至少已經開始加載時才能調用此斷言。它不應該用在'waitForResource'回調中。 – 2014-09-22 15:36:59