Acceptance tests for PRX systems using Cypress.
Cypress is a next-generation front end testing tool built for the modern web. It enables you to write all types of tests:
- End-to-end tests
- Integration tests
- Unit tests
We're using E2E tests to cover core functionality of apps at PRX.
- Clone this repository
- Install dependencies:
yarn install
- Configure your test user/pass/fixtures:
cp env-example .env # Edit .env with your settings
There are two main ways to run Cypress tests:
Run tests in headless mode:
yarn test
This command runs all tests in the terminal without opening a browser window. It's useful for continuous integration environments or when you want to quickly run all tests.
Open Cypress Test Runner:
yarn start
This command opens the Cypress Test Runner, a graphical user interface that allows you to:
- See all test files
- Choose specific tests to run
- Watch tests run in real time in the browser
- Debug tests using browser developer tools
The Test Runner is particularly useful during test development and debugging --
You can set a debugger
statement or inspect the DOM using familiar chrome
debugger tools.
Cypress tests are located in the cypress/e2e
directory. To create a new test:
- Create a new
.cy.ts
file in thecypress/e2e
directory - Write your test using Cypress commands
- Run your test using the Cypress Test Runner or command line
For more information on writing Cypress tests, refer to the Cypress Documentation.
- Fork it
- Create your feature branch (git checkout -b feat/my-new-feature)
- Commit your changes (git commit -am 'Add some feature')
- Push to the branch (git push origin feat/my-new-feature)
- Create new Pull Request