diff --git a/alfa-client/apps/run-tests.sh b/alfa-client/apps/run-tests.sh index 8c26cae1d5be481e4d7a56caa8d5c924d09c7fff..c356946270ce2c89537f755300ba4d846eb663ec 100755 --- a/alfa-client/apps/run-tests.sh +++ b/alfa-client/apps/run-tests.sh @@ -41,7 +41,7 @@ if [ -z $CONFIG_FILE ]; then echo "Config File not set" && exit 1; fi SCRIPT_DIR="$(dirname "$0")" BASE_PATH=${SCRIPT_DIR}/${APP_NAME} SPEC_GROUP=${BASE_PATH}/src/e2e/${APP_VARIATION} -COMMAND="npx cypress run --project ${BASE_PATH} --spec ${SPEC_GROUP} --config-file ${CONFIG_FILE}" +COMMAND="pnpm exec cypress run --project ${BASE_PATH} --spec ${SPEC_GROUP} --config-file ${CONFIG_FILE}" REPORT_PATH=${BASE_PATH}/reports/${APP_VARIATION} echo "Run E2E for ${APP_NAME} with command: '$COMMAND'" @@ -57,10 +57,10 @@ if [ -d "${REPORT_PATH}" ]; then MOCHA_REPORT_FILE=${MOCHA_REPORT_PATH}report.json mv ${MOCHA_REPORT_JSONS} ${MOCHA_REPORT_PATH}/jsons - npx mochawesome-merge ${MOCHA_REPORT_PATH}**/*.json > ${MOCHA_REPORT_FILE} + pnpm exec mochawesome-merge ${MOCHA_REPORT_PATH}**/*.json > ${MOCHA_REPORT_FILE} # Workaround: mochawesome's "screenshotsFolder" value is not added in the generated HTML file. Add "screenshots" to image paths. sed --in-place --regexp-extended 's/"([^"]*\.png)/"screenshots\1/' ${MOCHA_REPORT_FILE} - npx marge ${MOCHA_REPORT_FILE} -f report -o ${REPORT_PATH} + pnpm exec marge ${MOCHA_REPORT_FILE} -f report -o ${REPORT_PATH} else echo "ERROR: Reports do not exist at ${REPORT_PATH}" fi diff --git a/alfa-client/package.json b/alfa-client/package.json index ca4afbc133d04a943354238eb763ff44611cecea..b6092d172e2bcc826d3566492a463f7d4cfc2488 100644 --- a/alfa-client/package.json +++ b/alfa-client/package.json @@ -21,7 +21,7 @@ "ci-prodBuild": "nx run alfa:build --outputHashing=all --configuration production", "ci-prodBuild-admin": "nx container admin", "ci-test": "nx run-many --target=test --parallel 20 -- --runInBand", - "ci-sonar": "nx run-many --target=test --parallel 20 -- --runInBand --codeCoverage --coverageReporters=lcov --testResultsProcessor=jest-sonar-reporter && npx sonar-scanner", + "ci-sonar": "nx run-many --target=test --parallel 20 -- --runInBand --codeCoverage --coverageReporters=lcov --testResultsProcessor=jest-sonar-reporter && pnpm exec sonar-scanner", "lint": "nx workspace-lint && nx lint", "affected:apps": "nx affected:apps", "affected:libs": "nx affected:libs", @@ -38,14 +38,14 @@ "dep-graph": "nx dep-graph", "help": "nx help", "favicon": "real-favicon generate favicon/faviconDescription.json favicon/faviconData.json src/favicon", - "cypress:run": "npx cypress run --project apps/alfa-e2e", - "cypress:run-main": "npx cypress run --project apps/alfa-e2e --spec apps/alfa-e2e/src/e2e/main-tests", - "cypress:run-ea": "npx cypress run --project apps/alfa-e2e --spec apps/alfa-e2e/src/e2e/einheitlicher-ansprechpartner", - "cypress:run-admin": "npx cypress run --project apps/admin-e2e", - "cypress:version": "npx cypress version", - "cypress:install": "npx cypress install", - "cypress:open": "npx cypress open --project apps/alfa-e2e", - "cypress:open-admin": "npx cypress open --project apps/admin-e2e", + "cypress:run": "pnpm exec cypress run --project apps/alfa-e2e", + "cypress:run-main": "pnpm exec cypress run --project apps/alfa-e2e --spec apps/alfa-e2e/src/e2e/main-tests", + "cypress:run-ea": "pnpm exec cypress run --project apps/alfa-e2e --spec apps/alfa-e2e/src/e2e/einheitlicher-ansprechpartner", + "cypress:run-admin": "pnpm exec cypress run --project apps/admin-e2e", + "cypress:version": "pnpm exec cypress version", + "cypress:install": "pnpm exec cypress install", + "cypress:open": "pnpm exec cypress open --project apps/alfa-e2e", + "cypress:open-admin": "pnpm exec cypress open --project apps/admin-e2e", "workspace-generator": "nx workspace-generator", "storybook": "nx storybook design-system", "ci-storybook": "nx build-storybook design-system && nx container design-system" @@ -154,6 +154,7 @@ "jsonc-eslint-parser": "^2.4.0", "lodash": "^4.17.21", "mochawesome-merge": "^4.3.0", + "mochawesome-report-generator": "^6.2.0", "mongodb": "^4.17.2", "ng-mocks": "^14.13.1", "ng-packagr": "18.2.1", diff --git a/alfa-client/pnpm-lock.yaml b/alfa-client/pnpm-lock.yaml index c08b6a2c4bed742abe2e1a8d28423dadc6eaee42..9ff1eea46810db9efacb973e06d4db04bd98f748 100644 --- a/alfa-client/pnpm-lock.yaml +++ b/alfa-client/pnpm-lock.yaml @@ -313,6 +313,9 @@ importers: mochawesome-merge: specifier: ^4.3.0 version: 4.3.0 + mochawesome-report-generator: + specifier: ^6.2.0 + version: 6.2.0 mongodb: specifier: ^4.17.2 version: 4.17.2(@aws-sdk/client-sso-oidc@3.687.0(@aws-sdk/client-sts@3.687.0))