【发布时间】:2015-03-11 05:41:18
【问题描述】:
我不时使用在 protractor 1.7 中引入的"Expected Conditions" feature。
用例:
var EC = protractor.ExpectedConditions;
browser.wait(EC.visibilityOf(header.displayName), 10000);
其中header 是一个页面对象。
如果header.displayName 在 10 秒内不可见,则会抛出错误:
[firefox #4] 2) Describe description here
[firefox #4] Message:
[firefox #4] Error: Wait timed out after 10082ms
[firefox #4] Stacktrace:
[firefox #4] Error: Wait timed out after 10082ms
[firefox #4] ==== async task ====
[firefox #4] at [object Object].<anonymous> (/Path/to/project/test/e2e/my.spec.js:38:17)
这不是很可读,需要一些时间来理解和一些研究。
问题:
是否可以自定义这种等待超时错误?
仅供参考,我们可以提供自定义的expect 失败消息,如下所述:
【问题讨论】:
标签: testing selenium jasmine protractor end-to-end