Last week I invited Gleb Bahmutov, VP of Engineering at Cypress, to chat and teach me how to leverage Cypress with GitHub Actions to quickly get a test environment up and running.
- Explicit version
- Run tests in a given browser
- Using Docker image
- Specify environment variables
- Run only some spec files
- Test project in subfolder
- Record results on Cypress Cloud
- Specify auto cancel after failures
- Tag recordings
- Store test artifacts on GitHub
- Quiet output
- Set Cypress config values
- Use specific config file
- Run tests in parallel
- Run E2E and Component tests
- Build app before running the tests
- Start server before running the tests
- Start multiple servers before running the tests
- Wait for server to respond before running the tests
- use custom install command
- use command prefix
- use own custom test command
- pass custom build id when recording to Cypress Cloud
- generate a robust custom build id to allow re-running the workflow
- use different…
What I learned in our conversation is that Cypress is not just an npm package. Through the CLI, you gain access to a base binary ready to run their testing system on all platforms (Linux, Windows, and Mac). When you start Cypress, it runs the binary to engage and work with your machine's default browser giving you the ability to see your test pass or fail in front of your eyes.
Towards the end of our conversation, we installed Cypress on my bdougie.live repo to get positive browser test results in my GitHub Action logs.
If you have not tried out browser testing in your project, I encourage you to do so today, you are only minutes away from having the confidence e2e tests, and you can also do it with Actions!
Watch Gleb walk me through getting it installed on my project. You can find the link below.
Join me and friends live for Open Source Fridays at https://www.meetup.com/GitHub-Virtual.