gpt4 book ai didi

javascript - Protractor 测试在页面完全加载之前通过

转载 作者:行者123 更新时间:2023-11-29 21:16:24 25 4
gpt4 key购买 nike

更新我的 node_modules 后,我的 Protractor 测试开始失败。测试似乎在页面加载之前就开始运行:

Using the selenium server at http://127.0.0.1:4444/wd/hub
[launcher] Running 1 instances of WebDriver
Spec started

Login
✓ should navigate to the homepage
✓ should display login form

Password > Forgot Password
✓ should go the forgot password form
✓ should not redirect user if email does not exist

Executed 4 of 4 specs SUCCESS in 0.025 sec.
Uncaught exception: Error while waiting for Protractor to sync with the page: "[ng:test] no injector found for element argument to getTestability\nhttp://errors.angularjs.org/1.5.8/ng/test"
[launcher] Process exited with error code 1

启动的谷歌浏览器窗口是空白的,但它有正确的 url ( http://localhost:8081 )。但是,如果我不运行测试而只是调用 browser.get('/'),窗口将导航到我的 Web 应用程序并且页面按预期加载。

我怀疑测试以某种方式独立于 Protractor 、selenium 和 Chrome 之间的通信运行,并且以某种方式异步出错。

我目前正在运行以下版本:

  • Protractor :2.5.1
  • selenium-server-standalone:2.47.1(我也试过 2.46.0)
  • chromedriver:最新版本,使用 webdriver-update 安装
  • Chrome :52.0.2743.116

最佳答案

感谢@alecxe,升级到 v4 解决了我的问题。

关于javascript - Protractor 测试在页面完全加载之前通过,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/39251011/

25 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com