This is an example repo on how to build clean e2e tests with Cypress.
I am using Vue CLI 3 to bootstrap a generic Vue app. For an API we are using json-server.
Install the deps
npm install
You need to start the API in a separate command prompt.
npm run api
Then you are ready to run the app or run tests.
npm run serve
You have essentially 2 options each with 2 variants.
Run the e2e tests in headless mode or in GUI mode.
Headless mode opens a browser behind the scenes and outputs the results in the terminal.
GUI mode opens the nice Cypress GUI and is more suited while developing e2e tests.
Each can run their own webpack dev server or use the one that is already started by you.
npm run test:e2e -- --headless
- this starts e2e tests and runs its own dev server
npm run test:e2e -- --headless --url http://locahost:8080
- this runs e2e tests on the provided url
npm run test:e2e
- opens the Cypress GUI and runs its own dev server
npm run test:e2e -- --url http://locahost:8080
- opens the Cypress GUI pointing to the provided url
Author: Dobromir Hristov