This is the example project for the Cypress JavaScript tutorial. It shows how to start automating visual tests with Applitools Eyes and Cypress in JavaScript.
It uses:
- Cypress for browser automation
- Google Chrome as the local browser for testing
- npm for dependency management
- Applitools Eyes for visual testing
- Applitools Ultrafast Grid for cross-browser execution
To run this example project, you'll need:
- An Applitools account, which you can register for free
- Node.js version 16 or higher
- A good JavaScript editor like Visual Studio Code
To install project dependencies and set up Applitools Eyes, run:
npm install
npx eyes-setup
The Applitools config file is applitools.config.js
.
The main test spec is simple-example.cy.js
.
To execute tests, set the APPLITOOLS_API_KEY
environment variable
to your account's API key.
- Note: If you are not using the Eyes public cloud, you will need to update the
serverUrl
to your Eyes server URL in the applitools.config.js configuration file or set via anAPPLITOOLS_SERVER_URL
environment variable. See our documentation for more information on these settings.
Then, to open the Cypress window for launching tests, run:
npx cypress open
If you want to run tests directly from the command line, run this instead:
npx cypress run
For full instructions on running this project, take our Cypress JavaScript tutorial!