Dedicated Scripts

Learn how to use dedicated scripts.

Imagine a back-ender is going to release an update and wants to run only the E2E tests locally to be sure that everything works as expected. A npm run tests:e2e script could be helpful. Something like the following script will launch just the E2E tests.

"scripts": {
  "tests:e2e": "cypress run --spec \"cypress/integration/**/*.e2e.*\""

You can also use the cypress-select-tests plugin to select the tests an easier way (cypress run --env fgrep=e2e) or to run only the tests with a particular title (cypress run --env grep='E2E').

Get hands-on with 1200+ tech skills courses.