【发布时间】:2018-03-20 13:58:49
【问题描述】:
如果不打开同步或告诉它该应用不是 Angular 应用,我无法运行 Angular 4 应用的 E2E 测试
browser.ignoreSynchronization = true;
browser.waitForAngularEnabled(false);
当我不执行上述操作时,我收到以下错误:
- Failed: Timed out waiting for asynchronous Angular tasks to finish after 11 seconds. This may be because the current page is not an Angular application. Please see the FAQ for more details: https://github.com/angular/protractor/blob/master/docs/timeouts.md#waiting-for-angular
我已经使用这两个命令中的任何一个成功地运行了测试,但是我的超时越来越多,因为我必须使用等待和预期条件才能使页面加载。
【问题讨论】:
-
角度应用程序可能正在使用超时。 Protractor 不支持这一点,但它会支持间隔,这可以完成同样的事情。在 repo 上查看 this issue 了解更多信息
-
尝试将此添加到您的配置中:
exports.config = { allScriptsTimeout: 11000000, jasmineNodeOpts: { defaultTimeoutInterval: 30000000 }}
标签: angular protractor