This guide provides instructions on how to execute tests using Cypress, including script naming conventions.
-
Script Naming Convention
Scripts in package.json follow a specific naming convention:
cy:{mode}:{stability}:{type}:{environment}:{execution} mode: gui (headed) or headless stability: stable or unstable type: smoke or regression environment: staging or school_api_test execution: local or ci
Example:
npm run cy:gui:stable:regression:staging:local
-
Examples
-
Run all stable regression tests in GUI mode locally:
npm run cy:gui:stable:regression:local
-
Run all unstable tests in headless mode for CI:
npm run cy:headless:unstable:smoke:ci
- Run specific scenario tagged with @only:
npm run cy:gui:only:local
-
-
Running Tests Locally To run tests locally:
- Ensure Environment Configuration: Verify that local.env.json contains the correct credentials and api keys.
- Select and Run Tests: Choose the appropriate script based on your test requirements.
-
Run all stable tests in headless mode locally:
npm run cy:headless:stable:local
-
Run tests for a specific environment in GUI mode (e.g., staging):
npm run cy:gui:stable:regression:staging:local
-
Run tests in headless mode CI environment:
npm run cy:headless:stable:regression:school_api_test:ci