artworkjpm
artworkjpm

Reputation: 1347

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:

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 [email protected]
3 info using [email protected]
4 verbose run-script [ 'preprotractor', 'protractor', 'postprotractor' ]
5 info preprotractor [email protected]
6 verbose unsafe-perm in lifecycle true
7 info protractor [email protected]
8 verbose unsafe-perm in lifecycle true
9 info [email protected] Failed to exec protractor script
10 verbose stack Error: [email protected] 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 [email protected]
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 [email protected] protractor: `protractor test/protractor-conf.js`
18 error Exit status 1
19 error Failed at the [email protected] 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 ]

Upvotes: 0

Views: 451

Answers (1)

JeffT
JeffT

Reputation: 145


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. You can go to http://chromedriver.storage.googleapis.com/index.html to download a clean archive of the chromedriver for your platform.
Go to this folder: yourwebRoot\angular-phonecat\node_modules\protractor\selenium
Remove the archive chromedriver_2.10 from the folder and extract the one you downloaded here.
In your terminal type npm run protractor to run the e2e test again. It should now work.

Upvotes: 1

Related Questions