Angular-cli: `ng e2e` fails on brand new project

Created on 23 Jan 2017  Â·  5Comments  Â·  Source: angular/angular-cli

Please provide us with the following information:

OS?

macOS 10.12.2 Sierra

Versions.

angular-cli: 1.0.0-beta.26
node: 7.4.0
os: darwin x64
@angular/common: 2.4.4
@angular/compiler: 2.4.4
@angular/core: 2.4.4
@angular/forms: 2.4.4
@angular/http: 2.4.4
@angular/platform-browser: 2.4.4
@angular/platform-browser-dynamic: 2.4.4
@angular/router: 3.4.4
@angular/compiler-cli: 2.4.4

Repro steps.

ng new initial
cd initial
ng build # succeeds
ng serve # succeeds
npm run e2e or ng e2e both fail with the same output

➜  initial git:(master) ng e2e

> [email protected] pree2e /Users/#######/workspace/js/ng/support/initial
> webdriver-manager update --standalone false --gecko false

[19:17:28] I/file_manager - creating folder /Users/########/workspace/js/ng/support/initial/node_modules/protractor/node_modules/webdriver-manager/selenium
[19:17:28] I/downloader - chromedriver: downloading version 2.26
[19:17:28] I/downloader - curl -o /Users/#######/workspace/js/ng/support/initial/node_modules/protractor/node_modules/webdriver-manager/selenium/chromedriver_2.26mac64.zip https://chromedriver.storage.googleapis.com/2.26/chromedriver_mac64.zip
[19:17:30] I/update - chromedriver: unzipping /Users/#######/workspace/js/ng/support/initial/node_modules/protractor/node_modules/webdriver-manager/selenium/chromedriver_2.26mac64.zip
[19:17:31] I/update - chromedriver: setting permissions to 0755 for /Users/#######/workspace/js/ng/support/initial/node_modules/protractor/node_modules/webdriver-manager/selenium/chromedriver_2.26

> [email protected] e2e /Users/#######/workspace/js/ng/support/initial
> protractor "./protractor.conf.js"

[19:17:31] I/direct - Using ChromeDriver directly...
[19:17:31] I/launcher - Running 1 instances of WebDriver
Spec started
[19:17:44] E/protractor - Could not find Angular on page http://localhost:4200/ : retries looking for angular exceeded

  initial App
    ✗ should display message saying app works
      - Failed: Angular could not be found on the page http://localhost:4200/. If this is not an Angular application, you may need to turn off waiting for Angular. Please see https://github.com/angular/protractor/blob/master/docs/timeouts.md#waiting-for-angular-on-page-load

**************************************************
*                    Failures                    *
**************************************************

1) initial App should display message saying app works
  - Failed: Angular could not be found on the page http://localhost:4200/. If this is not an Angular application, you may need to turn off waiting for Angular. Please see https://github.com/angular/protractor/blob/master/docs/timeouts.md#waiting-for-angular-on-page-load

Executed 1 of 1 spec (1 FAILED) in 10 secs.
[19:17:44] I/launcher - 0 instance(s) of WebDriver still running
[19:17:44] I/launcher - chrome #01 failed 1 test(s)
[19:17:44] I/launcher - overall: 1 failed spec(s)
[19:17:44] E/launcher - Process exited with error code 1

(node:71842) DeprecationWarning: os.tmpDir() is deprecated. Use os.tmpdir() instead.

npm ERR! Darwin 16.3.0
npm ERR! argv "/usr/local/bin/node" "/usr/local/bin/npm" "run" "e2e" "--" "./protractor.conf.js"
npm ERR! node v7.4.0
npm ERR! npm  v4.0.5
npm ERR! code ELIFECYCLE
npm ERR! [email protected] e2e: `protractor "./protractor.conf.js"`
npm ERR! Exit status 1
npm ERR!
npm ERR! Failed at the [email protected] e2e script 'protractor "./protractor.conf.js"'.
npm ERR! Make sure you have the latest version of node.js and npm installed.
npm ERR! If you do, this is most likely a problem with the initial package,
npm ERR! not with npm itself.
npm ERR! Tell the author that this fails on your system:
npm ERR!     protractor "./protractor.conf.js"
npm ERR! You can get information on how to open an issue for this project with:
npm ERR!     npm bugs initial
npm ERR! Or if that isn't available, you can get their info via:
npm ERR!     npm owner ls initial
npm ERR! There is likely additional logging output above.

npm ERR! Please include the following file with any support request:
npm ERR!     /Users/#######/workspace/js/ng/support/initial/npm-debug.log

Some end-to-end tests failed, see above.

npm-debug.log.zip

more info

Most helpful comment

@catull @beeman I just tried this myself and it worked fine. Just to confirm, you're leaving ng serve running while doing ng e2e, right?

All 5 comments

@catull Confirmed with master and installed using ng new initial --link-cli

@catull @beeman I just tried this myself and it worked fine. Just to confirm, you're leaving ng serve running while doing ng e2e, right?

@filipesilva You nailed it! That way, it does run fine for me.

➜  initial git:(master) ng e2e

> [email protected] pree2e /Users/#########/workspace/js/ng/support/initial
> webdriver-manager update --standalone false --gecko false

[22:42:07] I/file_manager - creating folder /Users/#########/workspace/js/ng/support/initial/node_modules/protractor/node_modules/webdriver-manager/selenium
[22:42:07] I/downloader - chromedriver: downloading version 2.26
[22:42:07] I/downloader - curl -o /Users/#########/workspace/js/ng/support/initial/node_modules/protractor/node_modules/webdriver-manager/selenium/chromedriver_2.26mac64.zip https://chromedriver.storage.googleapis.com/2.26/chromedriver_mac64.zip
[22:42:08] I/update - chromedriver: unzipping /Users/#########/workspace/js/ng/support/initial/node_modules/protractor/node_modules/webdriver-manager/selenium/chromedriver_2.26mac64.zip
[22:42:08] I/update - chromedriver: setting permissions to 0755 for /Users/#########/workspace/js/ng/support/initial/node_modules/protractor/node_modules/webdriver-manager/selenium/chromedriver_2.26

> [email protected] e2e /Users/#########/workspace/js/ng/support/initial
> protractor "./protractor.conf.js"

[22:42:09] I/direct - Using ChromeDriver directly...
[22:42:09] I/launcher - Running 1 instances of WebDriver
Spec started

  initial App
    ✓ should display message saying app works

Executed 1 of 1 spec SUCCESS in 1 sec.
[22:42:13] I/launcher - 0 instance(s) of WebDriver still running
[22:42:13] I/launcher - chrome #01 passed

All end-to-end tests pass.

You can close the issue.

You're not the first to have trouble with it, in this exact way. Maybe ng e2e shouldn't expect an existing server and instead use a build project. Might be something to review... but not for 1.0.

This issue has been automatically locked due to inactivity.
Please file a new issue if you are encountering a similar or related problem.

Read more about our automatic conversation locking policy.

_This action has been performed automatically by a bot._

Was this page helpful?
0 / 5 - 0 ratings

Related issues

jmurphzyo picture jmurphzyo  Â·  3Comments

jbeckton picture jbeckton  Â·  3Comments

purushottamjha picture purushottamjha  Â·  3Comments

sysmat picture sysmat  Â·  3Comments

brtnshrdr picture brtnshrdr  Â·  3Comments