【发布时间】:2017-07-14 19:38:02
【问题描述】:
我听说 webdriver 控制流将来会被删除,并且想更新我的测试用例。
我不确定替换它的更好方法是什么:
- 异步等待:运行良好,但 jshint 不支持。
- promises 链接:我不知道如何确保 promise 与 jasmin 链接。
例如:
it('should should clear qa cookies using the qa command', function() {
browser.waitForAngularEnabled(false)
.then(browser.get('cookies url'));
});
it('should open product page', function() {
browser.waitForAngularEnabled(true)
.then(browser.get('page-url'))
.then(browser.wait(function() {
return element.all(by.css('locator')).first().isDisplayed();
}))
.then(expect(true).toBe(true));
});
如何使第二个规范仅在第一个规范之后运行?
谢谢!!!
【问题讨论】:
标签: promise protractor control-flow