From 963486b663592bc4a49846cac1f11ac588a3e38d Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?David=20N=C3=A9grier?= Date: Wed, 24 Nov 2021 09:26:54 +0100 Subject: [PATCH] Adding code to post screenshots of failed tests --- .github/workflows/end_to_end_tests.yml | 10 +++++++++- tests/.testcaferc.js | 3 ++- 2 files changed, 11 insertions(+), 2 deletions(-) diff --git a/.github/workflows/end_to_end_tests.yml b/.github/workflows/end_to_end_tests.yml index 15e491f4..658fff4d 100644 --- a/.github/workflows/end_to_end_tests.yml +++ b/.github/workflows/end_to_end_tests.yml @@ -24,7 +24,7 @@ jobs: run: cp .env.template .env - name: "Edit ownership of file for test cases" - run: sudo chown 1000:1000 -R maps/tests/Variables/Cache + run: sudo chown 1000:1000 -R . - name: "Start environment" run: docker-compose up -d @@ -34,3 +34,11 @@ jobs: - name: "Run tests" run: docker-compose -f docker-compose.testcafe.yml up --exit-code-from testcafe + + - name: Upload failed tests + if: ${{ failure() }} + uses: edunad/action-image@v1.0.0 + with: + path: './tests/screenshots/**/*.png' + GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} + title: 'Failed E2E tests 🙀' diff --git a/tests/.testcaferc.js b/tests/.testcaferc.js index ed3922ae..16ecc4c0 100644 --- a/tests/.testcaferc.js +++ b/tests/.testcaferc.js @@ -7,6 +7,7 @@ module.exports = { "src": "tests/", "screenshots": { "path": "screenshots/", - "takeOnFails": true + "takeOnFails": true, + "thumbnails": false, } }