Skip to content
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

Replace e2e:open script with dev:e2e when Cypress is installed #878

Closed
chrisvfritz opened this issue Feb 24, 2018 · 4 comments
Closed

Replace e2e:open script with dev:e2e when Cypress is installed #878

chrisvfritz opened this issue Feb 24, 2018 · 4 comments

Comments

@chrisvfritz
Copy link
Contributor

Something unique about Cypress is that it's not just a test framework, but also offers a nice development environment. The plugin for Cypress currently comes with an e2e:open script for running the Cypress client:

"e2e:open": "vue-cli-service e2e:open"

But it serves in production mode, which I only prefer when debugging the very rare production-only issue. This also defeats what I feel is the primary purpose of the client: to facilitate development, whether you're writing new tests alongside or not.

For that reason, I've replaced it with a dev:e2e script in vue-enterprise-boilerplate:

"dev:e2e": "vue-cli-service e2e:open --mode=development",

A few advantages I'm thinking of:

  • The emphasis on development (dev:e2e instead of e2e:open or e2e:dev) highlights it as a vital tool in the development process.
  • Running the dev server in development mode means that when something goes wrong, users will get more useful errors from Vue and potentially other libraries. This would make debugging failing tests a lot easier.

What do you think? Would it be appropriate to replace e2e:open with a dev:e2e?

@nanomad
Copy link
Contributor

nanomad commented Mar 1, 2018

I have to agree. The dev mode is, to me, more useful. I'd still keep the old open script around as it is useful to debug sporadic issues with "prod-like" code

@yyx990803
Copy link
Member

So I think this is better done by exposing a single e2e command, which defaults to open mode and takes an optional --headless flag.

@chrisvfritz
Copy link
Contributor Author

chrisvfritz commented Apr 27, 2018

@yyx990803 That works for me! 🙂 However, it still doesn't address the core development/production mode issue.

Maybe the default mode for e2e could be development, since it will be most useful when people want to develop/debug and the quality of that experience will usually be the top priority.

But then when specifying --headless, the default mode could be production, since that will usually run in a CI process, where the top priority is speed and making sure everything works in production.

What do you think?

@yyx990803
Copy link
Member

I think it's more confusing to have different default modes depending on another flag.

So with the latest changes you can just do yarn test:e2e --mode=development for the same effect, or simply add the --mode=development to the default script.

I prefer to keep the naming consistent, so no dev:e2e - that can be added manually after project is created.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

3 participants