NodeGoat
NodeGoat copied to clipboard
Enable video recording and upload on failure
This updates the E2E test workflow to record video of the cypress tests. The videos and screenshots for any failed test cases are uploaded as build artifacts. There will be an artifact called cypress-artifacts-node<version>
for each workflow job where cypress tests failed.
Here's an example workflow run where I made the learn_spec.js fail: https://github.com/rcowsill/NodeGoat/runs/1987578217
~~Note that this currently uploads videos for every spec rather than just the failed ones. It should be possible to exclude the videos for successful specs, but the whole set is <5MB so this is ok for now.~~ Fixed: see below
~~Converted to draft as I have a plan for how to only upload videos for failed specs.~~
~~Also I forgot to add the videos folder to .gitignore. Once those changes are done I'll force-push this PR branch.~~
Done!
I added a "Prepare cypress artifacts" step, which searches for folders under test/e2e/screenshots
and moves the corresponding video there (next to the corresponding screenshot files). The next step uploads the screenshots folder. Since cypress only makes screenshots for failed tests, that means only the videos for failed tests are uploaded as artifacts.
Landing it.