diff --git a/README.md b/README.md index 9861addd71aded5b77d844ce0bc6299668fa6c39..ec38581e899fc7d1e51fd3bf5169ace50a43f976 100644 --- a/README.md +++ b/README.md @@ -31,11 +31,11 @@ It uses the following variable: | `CYPRESS_EXTRA_ARGS` | Cypress extra [run options](https://docs.cypress.io/guides/guides/command-line.html#cypress-run) (to select a different browser, configuration or spec files for e.g.) | _none_ | | `REVIEW_ENABLED` | Set to `true` to enable Cypress tests on review environments (dynamic environments instantiated on development branches) | _none_ (disabled) | -### Unit tests report integration +In addition to a textual report in the console, this job produces the following reports, kept for one day: -Cypress test reports are [integrated to GitLab by generating JUnit reports](https://docs.gitlab.com/ee/ci/junit_test_reports.html). - -This is done using the following Cypress CLI options: `--reporter junit --reporter-options "mochaFile=cypress/reports/TEST-[hash].xml"` +| Report | Format | Usage | +| -------------- | ---------------------------------------------------------------------------- | ----------------- | +| `$CYPRESS_PROJECT_DIR/reports/cypress-*.xunit.xml` | [xUnit](https://github.com/jest-community/jest-junit#readme) test report(s) | [GitLab integration](https://docs.gitlab.com/ee/ci/yaml/artifacts_reports.html#artifactsreportsjunit) | ### Cypress `baseUrl` auto evaluation diff --git a/templates/gitlab-ci-cypress.yml b/templates/gitlab-ci-cypress.yml index 0e62e276b88dc2c53147380c396233e84d69f967..664ff38d354bdf7b5889a8f1d70cb6d4e03a756e 100644 --- a/templates/gitlab-ci-cypress.yml +++ b/templates/gitlab-ci-cypress.yml @@ -243,17 +243,17 @@ cypress: # maybe activate DEBUG traces - 'if [[ "$TRACE" ]]; then export DEBUG=cypress:*; fi' # run Cypress tests - - cypress run --reporter junit --reporter-options "mochaFile=cypress/reports/TEST-[hash].xml" $CYPRESS_EXTRA_ARGS + - cypress run --reporter junit --reporter-options "mochaFile=reports/cypress-[hash].xunit.xml" $CYPRESS_EXTRA_ARGS artifacts: name: "$CI_JOB_NAME artifacts from $CI_PROJECT_NAME on $CI_COMMIT_REF_SLUG" when: always paths: - - $CYPRESS_PROJECT_DIR/cypress/reports/ + - "$CYPRESS_PROJECT_DIR/reports/cypress-*" - $CYPRESS_PROJECT_DIR/cypress/videos/ - $CYPRESS_PROJECT_DIR/cypress/screenshots/ reports: junit: - - $CYPRESS_PROJECT_DIR/cypress/reports/TEST-*.xml + - "$CYPRESS_PROJECT_DIR/reports/cypress-*.xunit.xml" expire_in: 1 day rules: - !reference [.acceptance-policy, rules]