A practical guide showing how to run Cypress end-to-end tests inside a Docker container via TestContainers within a Spring Boot + Thymeleaf application's JUnit test suite. The approach uses @SpringBootTest with a random port, exposes the host port to the container, mounts Cypress test files via classpath resource mapping, and uses a CountDownLatch to wait for test completion. A caveat is noted: the test class as shown does not properly fail the JUnit test when Cypress tests fail.

1m read timeFrom wimdeblauwe.com
Post cover image

Sort: