简体   繁体   English

使用量角器运行e2e测试的Angular.js教程

[英]Angular.js tutorial running e2e test using protractor

I am following the Angular tutorial https://docs.angularjs.org/tutorial When I get to the last bit on the first page - "e2e using protractor", I do "npm run protractor" in a new command window with the local site running and karma running, but I get the below error log: 我正在关注Angular教程https://docs.angularjs.org/tutorial当我到达第一页的最后一位时-“使用量角器进行e2e”,我在本地的新命令窗口中执行“ npm run protractor”站点正在运行,业力正在运行,但是出现以下错误日志:

0 info it worked if it ends with ok
1 verbose cli [ 'c:\\Program Files\\nodejs\\node.exe',
1 verbose cli   'c:\\Program Files\\nodejs\\node_modules\\npm\\bin\\npm-cli.js',
1 verbose cli   'run',
1 verbose cli   'protractor' ]
2 info using npm@2.11.2
3 info using node@v0.12.5
4 verbose run-script [ 'preprotractor', 'protractor', 'postprotractor' ]
5 info preprotractor angular-phonecat@0.0.0
6 verbose unsafe-perm in lifecycle true
7 info protractor angular-phonecat@0.0.0
8 verbose unsafe-perm in lifecycle true
9 info angular-phonecat@0.0.0 Failed to exec protractor script
10 verbose stack Error: angular-phonecat@0.0.0 protractor: `protractor test/protractor-conf.js`
10 verbose stack Exit status 1
10 verbose stack     at EventEmitter.<anonymous> (c:\Program Files\nodejs\node_modules\npm\lib\utils\lifecycle.js:213:16)
10 verbose stack     at EventEmitter.emit (events.js:110:17)
10 verbose stack     at ChildProcess.<anonymous> (c:\Program Files\nodejs\node_modules\npm\lib\utils\spawn.js:24:14)
10 verbose stack     at ChildProcess.emit (events.js:110:17)
10 verbose stack     at maybeClose (child_process.js:1015:16)
10 verbose stack     at Process.ChildProcess._handle.onexit (child_process.js:1087:5)
11 verbose pkgid angular-phonecat@0.0.0
12 verbose cwd c:\Program Files (x86)\GitExtensions\angular-phonecat
13 error Windows_NT 6.1.7601
14 error argv "c:\\Program Files\\nodejs\\node.exe" "c:\\Program Files\\nodejs\\node_modules\\npm\\bin\\npm-cli.js" "run" "protractor"
15 error node v0.12.5
16 error npm  v2.11.2
17 error code ELIFECYCLE
18 error angular-phonecat@0.0.0 protractor: `protractor test/protractor-conf.js`
18 error Exit status 1
19 error Failed at the angular-phonecat@0.0.0 protractor script 'protractor test/protractor-conf.js'.
19 error This is most likely a problem with the angular-phonecat package,
19 error not with npm itself.
19 error Tell the author that this fails on your system:
19 error     protractor test/protractor-conf.js
19 error You can get their info via:
19 error     npm owner ls angular-phonecat
19 error There is likely additional logging output above.
20 verbose exit [ 1, true ]


I had the same issue. 我遇到过同样的问题。 It seems that the chromedriver.zip archive that comes with the angular-phonecat package is corrupted, making the installation of chromedriver impossible. 似乎angular-phonecat软件包随附的chromedriver.zip存档已损坏,因此无法安装chromedriver。 You can go to http://chromedriver.storage.googleapis.com/index.html to download a clean archive of the chromedriver for your platform. 您可以访问http://chromedriver.storage.googleapis.com/index.html为您的平台下载chromedriver的干净档案。
Go to this folder: yourwebRoot\\angular-phonecat\\node_modules\\protractor\\selenium 转到此文件夹:yourwebRoot \\ angular-phonecat \\ node_modules \\ protractor \\ selenium
Remove the archive chromedriver_2.10 from the folder and extract the one you downloaded here. 从文件夹中删除归档文件chromedriver_2.10 ,然后解压缩您在此处下载的文件。
In your terminal type npm run protractor to run the e2e test again. 在终端中,键入npm run protractor再次运行e2e测试。 It should now work. 现在应该可以了。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM