@cypress/schematic: ng e2e does not start server
See original GitHub issueCurrent behavior
When adding the schematic to a new CLI project, then ng e2e
does not start the server.
Desired behavior
ng e2e
should start the server behind the scene as the @briebug/cypress-schematic
was (and the built-in Protractor as well).
Test code to reproduce
npx @angular/cli@12.0.0 new cypress-schematic-v12 --defaults
cd cypress-schematic-v12
ng add @cypress/schematic
ng e2e
Versions
Cypress: 7.3.0
@cypress/schematic
: 1.0.3
Issue Analytics
- State:
- Created 2 years ago
- Reactions:1
- Comments:9 (6 by maintainers)
Top Results From Across the Web
Adding @cypress/schematic to Angular workspace results in ...
When you run ng e2e app1 it starts Cypress but the default spec.js is not found. In fact, cypress is run without a...
Read more >Migrating from protractor to cypress in angular giving error
I tested the Angular 8 starter app + @cypress/schematic, and trying to run ng e2e gives the same error. will open the Cypress...
Read more >5 steps to set Cypress as your E2E test runner in Angular
Integrate Cypress E2E tests in your Angular app and run them with the CLI's “ng” command. End to end tests are a great...
Read more >CI ready e2e tests for Angular with Cypress and TypeScript in ...
This article aims to describe how you can set up end-to-end testing for Angular with Cypress including TypeScript. You will write your very ......
Read more >@cypress/schematic - npm
Add npm scripts for running Cypress e2e tests in run mode and open mode ... If you have chosen to add or update...
Read more >Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start FreeTop Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Top GitHub Comments
@admah Thank you for your answer.
I think this is a rather surprising change as most schematics work the other way around (default e2e schematic for protractor, the cypress one from Briebug, the one for webdriverio).
ng e2e
usually starts the server and that’s what your run on CI (with a--headless
parameter). Note thatng e2e
does start a server on a different port if you want to, or if the port is already taken, so it’s usually fairly easy to use locally.This will probably be a surprise to most Angular developers who migrate from Protractor or from the original cypress schematic. My 2 cents is that I would stick to the default behavior of the ecosystem.
If you keep it that way, it should probably be clearly stated in the documentation. It was a bit weird for me because the configuration of the
e2e
property inangular.json
does refer todevServerTarget
so that was clear in mind that it should start the server. Maybe that’s unnecessary then, and would need to be fixed as well.You’re welcome @cexbrayat! I’m looking over the PR now. Thank you!