Skip to content

Commit

Permalink
Store failure screenshots as test artifacts in CI
Browse files Browse the repository at this point in the history
When system tests fail, Capybara automatically takes a screenshot of the
page to help developers debug the context of the failure. This was
introduced in 6ca32a1.

This commit configures the GitHub Actions CI job to store those
screenshots as test artifacts. This makes them available to developers
following a failed build.

Inspired by DFE-Digital/apply-for-teacher-training#8848
  • Loading branch information
ollietreend committed Jan 5, 2024
1 parent 346bf36 commit 4e22b20
Showing 1 changed file with 7 additions and 0 deletions.
7 changes: 7 additions & 0 deletions .github/workflows/deploy.yml
Original file line number Diff line number Diff line change
Expand Up @@ -97,3 +97,10 @@ jobs:
bundle exec rake db:create
bundle exec rails db:schema:load
bundle exec rspec --format progress
- name: Upload failure screenshots
if: failure()
uses: actions/upload-artifact@v4
with:
name: failure-screenshots
path: tmp/capybara/
if-no-files-found: ignore

0 comments on commit 4e22b20

Please sign in to comment.