1
对于量角器E2E测试,我很新,想知道元件是否可点击(ExpectedConditions.elementToBeClickable
)但不一定可见(ExpectedConditions.visibilityOf
)。可点击但不可见?
例如,我有以下代码:
var EC = protractor.ExpectedConditions;
var tryItButtonClickable = EC.elementToBeClickable(tryItButton);
var tryItButtonVisible = EC.visibilityOf(tryItButton);
return browser.wait(EC.and(tryItButtonClickable, tryItButtonVisible), getWaitTime())
.then(function() {
var protocol = url.parse(myarray[0].url).protocol;
if (protocol === null) {
throw new Error('expected ' + protocol + ' not to be null');
}
})
添加tryItButtonVisible
片之前,我就从量角器收到超时错误,大概是因为我的tryItButton
是点击,但尚未加载到DOM。
这是真的,还是我是多余的?
感谢
我我只是好奇,至于为什么当我和'两者在一起时,行为就是预期的行为,而当我只使用'elementToBeClickable'时,我的UI会冻结并且可以找不到元素 –