更新我的节点模块后,我的 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
启动的 Google Chrome 窗口是空白的,但它具有正确的 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/