Cypress Tests
Last updated
Was this helpful?
Last updated
Was this helpful?
Support for the has now been integrated into D.T.
With Cypress, you can easily create declarative tests, debug them visually and automatically run them in your continuous integration builds.
From the terminal, navigate to the disciple-tools-theme
directory and execute npm run cy:open
; which should display the Cypress Launchpad.
From there, select the E2E Testing
option; which should then display the following browser selection view.
On browser selection, you should then be taken to the End To End (E2E) view; as shown below.
The view from the previous section, displays all E2E tests created under the ./cypress/e2e
directory; which is organised as follows:
./cypress/e2e/contacts/
Siloed unit tests, covering the testing of contacts
post type related functionality; such as creating, updating and deleting records, searching, etc.
Please follow the pattern shown, when introducing tests for new features.
./cypress/support/commands.js
A holding area for custom functions; typically duplicate code; which can be encapsulated into a global function.
The following custom functions have been created:
dtLogin()
D.T frontend login.
Currently, all tests are run locally; so, you'll need to update the base url and admin credentials within the ./cypress.config.js
file.
Lastly, the following Cypress user guides also provide useful information, for gaining a better understanding of the framework.
See guide for more details.