1
我願做這樣的事情,但它不工作,因爲isPresent返回一個承諾,而不是一個布爾...如何在JS中使用量角器創建isVisible函數?
this.isVisible = function(){
return browser.isElementPresent(_this.username) &&
browser.isElementPresent(_this.password) &&
browser.isElementPresent(_this.submit)
}
我也試過
this.isVisible = function(){
return _this.username.isPresent() &&
_this.password.isPresent() &&
_this.submit.isPresent()
}
有沒有一種辦法處理這個(事情?也許全部使用,然後將其與單個布爾諾言或什麼?
酷那隻會返回一個帶有單個布爾權的承諾 – Jackie
@Ja ckie yup,我還添加了一些更可讀的版本,請檢查一下。謝謝。 – alecxe