我使用NightwatchJS用的NodeJS:http://nightwatchjs.org/apiNightwatchJS .waitForElementPresent abortOnFailure不工作
我有一個模式對話框,這可能會或可能不會出現。它有一個#close_button
需要點擊(如果模態確實出現)繼續。
我將waitForElementPresent
的abortOnFailure
參數設置爲false
,因此如果模式沒有出現,腳本會繼續。但是我無法讓它工作。
有什麼建議嗎?
module.exports = {
"Test" : function (browser) {
browser
.url("http://domain.com/")
.waitForElementPresent('#close_button', 5000, false, function() {
this.click('#close_button')
})
.setValue('#username', '[email protected]')
//more code here
.end(); //does end() go here or inside .waitForElementPresent() above?
}
}