Fast, easy and reliable testing for anything that runs in a browser.
Cypress is a next generation front end testing tool built for the modern web. It addresses the key pain points developers and QA engineers face when testing modern applications.
Refer to official documentation for detailed usage. →
Testing your application will require interacting with UI elements. Best practice for selecting elements in your tests is with special attributes for testing.
Refer to official documentation on writing tests for detailed usage. →
- Add test attributes to elements of your UI.
- Now these elements can be selected in tests with
- Add two custom commands from Real World App (RWA) for easier selection of elements.
- Don't forget to visit the page before each test.
baseUrloption to cypress configuration.
This will automatically prefix
cy.request() commands with this
- Add commands for opening Cypress Test Runner and running tests.
- Start your project in dev mode
- Run tests headlessly with
- Build your project
- run tests
cypress run runs tests to completion. By default,
cypress run will run all tests headlessly in the Electron browser.
cypress open opens the test runner and lets you run your tests invidually.
Cypress directory is placed in the root of the project.
- Don't forget to exclude Cypress from main
All this work will be handled automatically by CLI, so you don’t need to do anything extra as long as you choose Cypress plugin during the project creation phase.
If you didn't choose the plugin during project creation phase, you can follow the instructions below to add it.
- Follow instructions starting in Writing Tests