https://github.com/bep/netlify-cypress-test
Just a minimal repo to set up a Cypress integration test running in a GitHub Action after a successful Netlify preview build.
https://github.com/bep/netlify-cypress-test
Last synced: about 1 year ago
JSON representation
Just a minimal repo to set up a Cypress integration test running in a GitHub Action after a successful Netlify preview build.
- Host: GitHub
- URL: https://github.com/bep/netlify-cypress-test
- Owner: bep
- License: mit
- Created: 2021-03-18T10:05:16.000Z (about 5 years ago)
- Default Branch: main
- Last Pushed: 2024-08-10T12:57:56.000Z (almost 2 years ago)
- Last Synced: 2025-03-17T01:41:21.017Z (about 1 year ago)
- Language: JavaScript
- Homepage:
- Size: 54.7 KB
- Stars: 3
- Watchers: 2
- Forks: 1
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
Just a minimal repo to set up [Cypress](https://www.cypress.io/) integration tests running in a GitHub Action after a successful [Netlify](https://www.netlify.com/) preview build.
Why not run these tests on Netlify, you ask? I tried, but there are several reasons why running these on GitHub is better:
* There are no (known) way to run tests on Netlify on the published site _and_ fail the Netlify build.
* Setting up the Cypress environment can be a hassle -- there are ready-to-use GitHub Actions with matching Docker containers for this.
* GitHub builds are cheaper (or … more free)
See the GitHub Action [workflow file](.github/workflows/cypress.yml). This workflow triggers on Pull Request status updates from Netlify, runs the Cypress tests when the Netlify preview is ready, and updates the PR's test status to be one of `pending`, `failure` or `success`.
The workflow can be tested with [Ack](https://github.com/nektos/act) locally:
```bash
act status -e test-event.json
```