Skip to content
This repository has been archived by the owner on Feb 23, 2024. It is now read-only.

Commit

Permalink
Add screenshots on E2E test failures (#4898)
Browse files Browse the repository at this point in the history
* Add test environment to catch errors

* Add jest-circus and jest-html-reporters

This is so we can log the screenshots and errors that happen during E2E tests.

* Use the jest reporters and jest-circus to run the E2E tests

* Force cart test to break

Revert this!

* Upload jest report artifact when tests fail

* Run artifact upload on failure

* Upload entire report directory to artifact

* Revert "Force cart test to break"

This reverts commit c57f2c5.

* Update .gitignore and jest.config

* Force cart test to break

* Force cart test to break

* Remove <rootDir> from jest-html-reporter path

This was causing the artefact not to upload.

* Revert "Force cart test to break"

Co-authored-by: Niels Lange <[email protected]>
  • Loading branch information
opr and nielslange authored Oct 8, 2021
1 parent 876c777 commit 4642467
Show file tree
Hide file tree
Showing 6 changed files with 859 additions and 1 deletion.
14 changes: 14 additions & 0 deletions .github/workflows/php-js-e2e-tests.yml
Original file line number Diff line number Diff line change
Expand Up @@ -121,6 +121,13 @@ jobs:
npm run wp-env clean all
npm run test:e2e
- name: Upload artifacts on failure
if: ${{ failure() }}
uses: actions/upload-artifact@v2
with:
name: e2e-with-gutenberg-test-report
path: reports/e2e

JSE2ETests:
name: JavaScript E2E Tests (latest)
needs: Setup
Expand Down Expand Up @@ -182,3 +189,10 @@ jobs:
npm run wp-env start
npm run wp-env clean all
npm run test:e2e
- name: Upload artifacts on failure
if: ${{ failure() }}
uses: actions/upload-artifact@v2
with:
name: e2e-test-report
path: reports/e2e
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -38,6 +38,7 @@ tests/cli/vendor
/tmp
/tests/bin/tmp
/tests/e2e-tests/config/local-*.json
/reports

# Logs
/logs
Expand Down
Loading

0 comments on commit 4642467

Please sign in to comment.