# Cypress UI Tests This project uses [Cypress](https://www.cypress.io/) to run UI tests for the project. ## How to run the tests Go to `CypressIntegrationTest` and run it as a normal unit test in IntelliJ. This will start the application as a `SpringBootTest` which uses Testcontainers to start running the Cypress tests. The test then gathers all the output from the Cypress tests and displays them as normal unit test output in IntelliJ. The reporting of the tests themselves will be located in `target/test-classes/e2e/cypress/reports/mochawesome`. Please note that cypress requires the templates to have been build first. ### Run outside of maven Want to run them outside of maven? Make sure you have node 22 installed and the application running and listening to `http://localhost:8080` . Then do: ```shell cd src/test/e2e/cypress npx cypress run ``` ## How to interact with elements - To select an element in the UI, add a `data-cy` attribute to the HTML element and give it a unique value. - To interact with the element in the test, use the `cy.dataCy()` command and pass the value of the `data-cy` attribute as an argument. For example: ```javascript // HTML element