Overview of testing strategy
What we are testing
What we’re not testing
Framework choice
Configuration / setup within DCB Admin
Infrastructure
Folder setup
Config files in play
Preparing and writing tests
Queries
Running tests locally
To run the Cypress tests locally, you have two options.
npx cypress open will open the Cypress application, assuming you have it installed on your machine. This will allow you to choose which tests you would like to run through the Cypress GUI.
You can also use
npx cypress run --spec "cypress/e2e/example-test.cy.ts"
to specify either an individual test, or a set of tests contained within a certain directory.
Note that this will run headlessly (in the command line) by default. To force it to run through the GUI, you must add the
--headed
flag to your command.To run all tests within a certain directory, use the following:
npx cypress run --spec "cypress/e2e"
Running coverage reports
Examples
Different examples from within the codebase may be useful to illustrate different testing use cases