protractor icon indicating copy to clipboard operation
protractor copied to clipboard

Switching to Angular 2.0.0-beta.16 stops Protractor tests

Open alexpopdev opened this issue 10 years ago • 5 comments

When switching to Angular 2.0.0-beta.16 from beta.8 previous successful Protractor tests stop running and the following message is displayed:

> webdriver-manager update && protractor protractor.conf.js

selenium standalone is up to date.
chromedriver is up to date.
[16:56:02] I/direct - Using ChromeDriver directly...
[16:56:02] I/launcher - Running 1 instances of WebDriver
[16:56:12] E/launcher - Error: ReferenceError: Zone is not defined
    at Object.<anonymous> (diffing_plugin_wrapper-output_path-WS3jPtnv.tmp/angular2/src/testing/fake_async.ts:4:34)
    at Module._compile (module.js:413:34)
    at Object.Module._extensions..js (module.js:422:10)
    at Module.load (module.js:357:32)
    at Function.Module._load (module.js:314:12)
    at Module.require (module.js:367:17)
    at require (internal/module.js:16:19)
    at Object.<anonymous> (diffing_plugin_wrapper-output_path-WS3jPtnv.tmp/angular2/src/testing/test_component_builder.ts:25:1)
    at Module._compile (module.js:413:34)
    at Object.Module._extensions..js (module.js:422:10)
[16:56:12] E/launcher - Process exited with error code 100

npm ERR! Windows_NT 10.0.10586
npm ERR! argv "C:\\Program Files\\nodejs\\node.exe" "C:\\Program Files\\nodejs\\node_modules\\npm\\bin\\npm-cli.js" "run" "e2e"
npm ERR! node v5.10.1
npm ERR! npm  v3.8.3
npm ERR! code ELIFECYCLE
npm ERR! [email protected] e2e: `webdriver-manager update && protractor protractor.conf.js`
npm ERR! Exit status 100
npm ERR!
npm ERR! Failed at the [email protected] e2e script 'webdriver-manager update && protractor protractor.conf.js'.

If I revert back to angular 2 beta 8 the tests are running OK. Is this an environmental issue by any chance or an angular 2 beta 9+ config change? Anyway I will use this issue to congratulate all past and present Protractor contributors for such a great testing tool :)

  • Node Version: v5.10.1
  • Protractor Version: 3.3, 3.2
  • Browser(s): Chrome
  • Operating System and Version Microsoft Windows [Version 10.0.10586]

alexpopdev avatar Apr 28 '16 16:04 alexpopdev

It seems this is not an actual bug as I was able to get Protractor tests running on the mgechev/angular2-seed repo that is using Angula2 Beta 16 and Protractor 3.3. I will investigate to see what needs to be changed as part of the beta16 upgrade and add a comment here.

alexpopdev avatar Apr 28 '16 16:04 alexpopdev

I could not figure out what was causing the issue and I ended up using protractor with angular 2 beta 8 in my tests folder in order to target sites built using Angular 2 beta 16.

alexpopdev avatar Apr 29 '16 15:04 alexpopdev

The same issue occurs after I upgraded to Angular 2 RC1

alexpopdev avatar May 11 '16 09:05 alexpopdev

Thanks to the "angular2-seed-advanced" project I found the fix for this issue: I had to add the following line to the protractor.conf.js onPreparemethod: require("zone.js/dist/zone-node");

alexpopdev avatar May 11 '16 09:05 alexpopdev

Thanks a lot. Adding require("zone.js/dist/zone-node") resolved the issue for me.

prabhap avatar Jun 15 '16 08:06 prabhap