From 9a38a8dc43d6663e0495948b387a567cb4eea162 Mon Sep 17 00:00:00 2001 From: mahula Date: Wed, 5 Jul 2023 18:04:24 +0200 Subject: [PATCH] fix report generation in e2e test flow --- .github/workflows/test_e2e.yml | 8 +++++--- e2e-tests/create-cucumber-html-report.js | 4 +++- e2e-tests/package.json | 4 ++-- 3 files changed, 10 insertions(+), 6 deletions(-) diff --git a/.github/workflows/test_e2e.yml b/.github/workflows/test_e2e.yml index f17754724..425ac5dbf 100644 --- a/.github/workflows/test_e2e.yml +++ b/.github/workflows/test_e2e.yml @@ -33,7 +33,6 @@ jobs: yarn && yarn dev_reset cd ../backend yarn && yarn seed - cd .. - name: Boot up test system | docker-compose frontends run: docker-compose -f docker-compose.yml -f docker-compose.test.yml up --detach --no-deps frontend admin nginx @@ -54,11 +53,14 @@ jobs: - name: End-to-end tests | run tests id: e2e-tests - run: pwd && yarn run cypress run + run: | + cd e2e-tests/ + yarn run cypress run + node create-cucumber-html-report.js - name: End-to-end tests | if tests failed, upload report if: ${{ failure() && steps.e2e-tests.conclusion == 'failure' }} uses: actions/upload-artifact@v3 with: name: cypress-report-PR-${{ github.event.number }} - path: /home/runner/work/gradido/gradido/e2e-tests/cypress/reports/ + path: /home/runner/work/gradido/gradido/e2e-tests/cypress/reports/cucumber_html_report diff --git a/e2e-tests/create-cucumber-html-report.js b/e2e-tests/create-cucumber-html-report.js index be0aa0897..1832c4c77 100644 --- a/e2e-tests/create-cucumber-html-report.js +++ b/e2e-tests/create-cucumber-html-report.js @@ -1,7 +1,9 @@ const report = require("multiple-cucumber-html-reporter"); report.generate({ - jsonDir: "cypress/json_logs", + jsonDir: "cypress/reports/json_logs", reportPath: "./cypress/reports/cucumber_html_report", + pageTitle: "Gradido webapp end-to-end test report", + metadata: { app: { name: "Gradido webapp" diff --git a/e2e-tests/package.json b/e2e-tests/package.json index b81537795..e2ecbb4f9 100644 --- a/e2e-tests/package.json +++ b/e2e-tests/package.json @@ -11,12 +11,12 @@ "stepDefinitions": "cypress/support/step_definitions/*.ts", "json": { "enabled": true, - "output": "cypress/json_logs/cucumber_log.json", + "output": "cypress/reports/json_logs/cucumber_log.json", "formatter": "cucumber-json-formatter" }, "messages": { "enabled": true, - "output": "cypress/json_logs/messages.ndjson" + "output": "cypress/reports/json_logs/messages.ndjson" }, "html": { "enabled": false