Skip to content

ng e2e does not start a webserver #4042

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Closed
rolandjitsu opened this issue Jan 16, 2017 · 3 comments
Closed

ng e2e does not start a webserver #4042

rolandjitsu opened this issue Jan 16, 2017 · 3 comments

Comments

@rolandjitsu
Copy link

Please provide us with the following information:

OS?

Windows 7, 8 or 10. Linux (which distribution). Mac OSX (Yosemite? El Capitan?)

OS X El Capitan

Versions.

Please run ng --version. If there's nothing outputted, please run in a Terminal: node --version and paste the result here:

angular-cli: 1.0.0-beta.25.5
node: 6.7.0
os: darwin x64
@angular/common: 2.4.3
@angular/compiler: 2.4.3
@angular/core: 2.4.3
@angular/forms: 2.4.3
@angular/http: 2.4.3
@angular/platform-browser: 2.4.3
@angular/platform-browser-dynamic: 2.4.3
@angular/router: 3.4.3
@angular/material: 2.0.0-beta.1

Repro steps.

Was this an app that wasn't created using the CLI? What change did you do on your code? etc.

Running ng e2e fails because the webserver is never started.

The log given by the failure.

Normally this include a stack trace and some more information.

[13:20:23] E/protractor - Could not find Angular on page http://localhost:4200/ : retries looking for angular exceeded

Mention any other details that might be useful.

If this is expected behaviour, there should be a way to start a dev server and attach a callback to it so that we manually trigger the integration tests once the dev server is started.


Thanks! We'll be in touch soon.

@filipesilva
Copy link
Contributor

filipesilva commented Jan 16, 2017

This is intended behaviour, ng e2e does not start a server.

This was chosen because there are multiple ways in which you might want to test your project. For instance, you might need to test the latest build, that was done via ng build --multiple --flags --and-configs. You might also want to test the current running ng serve, or even your live site.

My recommendation for running e2e on a CI environment is to add this npm script:

"e2e": "ng build --no-progress && concurrently \"lite-server dist/\" \"ng e2e\" --kill-others --success first"

This script relies on https://github.com/kimmobrunfeldt/concurrently to coordinate processes and the fact that starting a lightweight webserver is always faster than starting protractor.

You might want to omit ng build if you already have a build available in dist/.

@rolandjitsu
Copy link
Author

Thanks for the suggestion :)

@angular-automatic-lock-bot
Copy link

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.

@angular-automatic-lock-bot angular-automatic-lock-bot bot locked and limited conversation to collaborators Sep 6, 2019
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants