protractor conf.js
(使用全局安装副本),它可以完美地运行。每次成功测试后,一个绿色点出现一次,大约需要80秒。这里就有点棘手了。如果我通过执行
(项目路径)/node_modules/protractor/bin/protractor conf.js
来强制运行本地安装的Protractor,则它会启动,并立即显示几个绿色点,然后抛出无法连接到Angular的错误。这对于与我们的构建集成存在问题,因为Grunt会寻找并使用本地的Protractor副本。更复杂的是,另外两位开发人员中的一位可以拉取我的repo并在我的conf.js上轻松运行本地protractor安装。它完美地运行了100%。
Error while waiting for Protractor to sync with the page: "window.angular is
undefined. This could be either because this is a non-angular page or because your
test involves client-side navigation, which can interfere with Protractor's
bootstrapping. See http://git.io/v4gXM for details"
我们已经检查了以下所有内容:
Both local and global installations of Protractor are the same version, installed with npm.
Richards-MacBook-Pro:protractor richardpressler$ npm ls protractor wear-test-web-framework@0.0.1 /path_to_project/wear-test-track0 └── protractor@3.1.1 Richards-MacBook-Pro:protractor richardpressler$ npm ls -g protractor /usr/local/lib └── protractor@3.1.1
Selenium is up-to date. We have run both
(path to project)/node_modules/protractor/bin/webdriver-manager update
as well aswebdriver-manager update
to update both local and global selenium server installationsI've tried firing up Selenium separately and then pointing Protractor to it so that I can see the output and it looks great when I run the conf.js using the global protractor (
protractor conf.js
), showing several [Executing] statements each followed by a [Done] statement. However, when I run the local protractor binary with(path to project)/node_modules/protractor/bin/protractor conf.js
, I see that Protractor was able to connect to the Selenium instance, but didn't do much afterword:
当量角器的输出看起来像这样:
Richards-MacBook-Pro:protractor richardpressler$ ../../node_modules/protractor/bin/protractor conf.js
Using the selenium server at http://127.0.0.1:4444/wd/hub
[launcher] Running 1 instances of WebDriver
Started
.......................
Selenium服务器只会输出这个信息:
10:35:47.612 INFO - Selenium Server is up and running
10:35:49.479 INFO - Executing: [new session: Capabilities [{count=1, browserName=chrome}]])
10:35:49.487 INFO - Creating a new session for Capabilities [{count=1, browserName=chrome}]
Starting ChromeDriver 2.21.371459 (36d3d07f660ff2bc1bf28a75d1cdabed0983e7c4) on port 34848
Only local connections are allowed.
10:35:50.516 INFO - Done: [new session: Capabilities [{count=1, browserName=chrome}]]
10:35:50.532 INFO - Executing: [set script timeout: 11000])
10:35:50.537 INFO - Done: [set script timeout: 11000]
有没有人在比较全局、命令行版本和项目中本地安装的Protractor版本时遇到类似的不良行为?
谢谢。