configure html reporting for failing test run

This commit is contained in:
mahula 2024-02-23 18:36:51 +01:00
parent 0a9ad44a38
commit d68e9c3bac
2 changed files with 26 additions and 0 deletions

View File

@ -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

View File

@ -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: '<div></div>',
hideMetadata: true,
})