diff --git a/.github/workflows/e2e.run.tests.yml b/.github/workflows/e2e.run.tests.yml index 7568eb1..44fe96e 100644 --- a/.github/workflows/e2e.run.tests.yml +++ b/.github/workflows/e2e.run.tests.yml @@ -11,4 +11,18 @@ jobs: uses: actions/checkout@master - name: E2E - Run all tests + id: e2e-tests uses: cypress-io/github-action@v6 + + - name: E2E | if tests failed, compile html report + if: ${{ failure() && steps.e2e-tests.conclusion == 'failure' }} + run: | + cd cypress/ + node create-cucumber-html-report.js + + - name: E2E | if tests failed, upload report + if: ${{ failure() && steps.e2e-tests.conclusion == 'failure' }} + uses: actions/upload-artifact@v4 + with: + name: boilerplate-e2e-test-report-pr${{ needs.e2e-tests.outputs.pr-number }} + path: /home/runner/work/boilerplate-e2e-cypress-cucumber/boilerplate-e2e-cypress-cucumber/cypress/reports/e2e_html_report diff --git a/cypress/create-cucumber-html-report.js b/cypress/create-cucumber-html-report.js new file mode 100644 index 0000000..1c3d796 --- /dev/null +++ b/cypress/create-cucumber-html-report.js @@ -0,0 +1,12 @@ +import report from 'multiple-cucumber-html-reporter' + +const reportTitle = 'DreamMall End-to-End Test Report' + +report.generate({ + jsonDir: 'reports/json_logs', + reportPath: './reports/cucumber_html_report', + pageTitle: reportTitle, + reportName: reportTitle, + pageFooter: '
', + hideMetadata: true, +})