1
我知道我可以使用waitForSelector
來測試某個特定元素是否準備就緒,但JavaScript呢?測試是否使用casperjs評估/準備好所需的JavaScript文件
this.waitForSelector('#someid', function _then() {
// do something that requires js to be fully loaded and functional
// before clicking the submit button
self.click('#submit')
}, function _timeout() {
fail('Page timeout')
})