diff --git a/.eslintignore b/.eslintignore index 0a5b7d9..cc37758 100644 --- a/.eslintignore +++ b/.eslintignore @@ -1,3 +1,4 @@ build/ cypress/reports/ -node_modules/ \ No newline at end of file +cypress/screenshots/ +node_modules/ diff --git a/.github/workflows/e2e.run.tests.yml b/.github/workflows/e2e.run.tests.yml index 7568eb1..08b51e4 100644 --- a/.github/workflows/e2e.run.tests.yml +++ b/.github/workflows/e2e.run.tests.yml @@ -11,4 +11,23 @@ jobs: uses: actions/checkout@master - name: E2E - Run all tests + id: e2e-run uses: cypress-io/github-action@v6 + + - name: E2E | if tests failed, compile html report + if: ${{ failure() && steps.e2e-run.conclusion == 'failure' }} + run: | + cd cypress/ + node create-cucumber-html-report.js + + - name: Get PR number + if: ${{ failure() && steps.e2e-run.conclusion == 'failure' }} + uses: jwalton/gh-find-current-pr@master + id: pr-number + + - name: E2E | if tests failed, upload report + if: ${{ failure() && steps.e2e-run.conclusion == 'failure' }} + uses: actions/upload-artifact@v4 + with: + name: boilerplate-e2e-test-report-pr-${{ steps.pr-number.outputs.pr }} + path: /home/runner/work/boilerplate-e2e-cypress-cucumber/boilerplate-e2e-cypress-cucumber/cypress/reports/e2e_html_report diff --git a/.gitignore b/.gitignore index 95858d8..0ddd73c 100644 --- a/.gitignore +++ b/.gitignore @@ -1,5 +1,6 @@ build/ cypress/reports/ +cypress/screenshots/ node_modules/ .vuepress/.cache .vuepress/.temp diff --git a/cypress/create-cucumber-html-report.js b/cypress/create-cucumber-html-report.js new file mode 100644 index 0000000..1321172 --- /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/', + reportPath: './reports/e2e_html_report', + pageTitle: reportTitle, + reportName: reportTitle, + pageFooter: '
', + hideMetadata: true, +})