diff --git a/.gitignore b/.gitignore index c859f2d5..57ddef5d 100644 --- a/.gitignore +++ b/.gitignore @@ -24,6 +24,7 @@ pnpm-debug.log* # Playwright /test-results/ +/ortoni-report/ /playwright-report/ /blob-report/ /playwright/.cache/ diff --git a/azure-pipelines-automated-testing.yml b/azure-pipelines-automated-testing.yml index b118c19a..a4469639 100644 --- a/azure-pipelines-automated-testing.yml +++ b/azure-pipelines-automated-testing.yml @@ -156,13 +156,12 @@ stages: -e JIRA_SERVER=$(JIRA_SERVER) \ -e JIRA_USERNAME=$(JIRA_USERNAME) \ -e JIRA_API_KEY=$(JIRA_API_KEY) \ - -e PLAYWRIGHT_JUNIT_OUTPUT_FILE=$(PLAYWRIGHT_JUNIT_OUTPUT_FILE) \ $(dockerImageName):$(imageTag) \ bash -c "echo \"Moving Playwright reports out of subfolders...\" && find ./playwright-reports/ -mindepth 2 -type f -exec mv {} ./playwright-reports/ \; && echo \"Merging reports...\" && - PLAYWRIGHT_JUNIT_OUTPUT_FILE=$(PLAYWRIGHT_JUNIT_OUTPUT_FILE) npx playwright merge-reports --reporter=ortoni-report,junit ./playwright-reports - num_failures=$(sed -n 's/.*failures="\([^"]*\)".*/\1/p' "/app/$PLAYWRIGHT_JUNIT_OUTPUT_FILE" | head -n 1) + npx playwright merge-reports --config=playwright-tests/playwright.config.ts ./playwright-reports + num_failures=$(sed -n 's/.*failures="\([^"]*\)".*/\1/p' /app/test-results/junit_results.xml | head -n 1) echo \"Number of test failures: '$num_failures'\" (($num_failures -eq 0)) && jira_message='Playwright tests passed!' || jira_message=\"$num_failures Playwright tests failed.\" echo \"Contents of ortoni-report:\" && ls ./ortoni-report && @@ -180,7 +179,7 @@ stages: # Copy test results from container echo "Copying test results..." docker cp $container_id:/app/ortoni-report/. $(System.DefaultWorkingDirectory)/ortoni-report - docker cp $container_id:/app/$(PLAYWRIGHT_JUNIT_OUTPUT_FILE) $(System.DefaultWorkingDirectory) + docker cp $container_id:/app/test-results/junit_results.xml $(System.DefaultWorkingDirectory) # TODO: Update to include junit results if necessary # Remove container @@ -188,7 +187,6 @@ stages: docker rm $container_id env: JIRA_API_KEY: $(JIRA_API_KEY) - PLAYWRIGHT_JUNIT_OUTPUT_FILE: "test-results/junit_results.xml" displayName: merge_and_publish_results_to_jira # TODO: Enable later when working on PR gate diff --git a/playwright-tests/playwright.config.ts b/playwright-tests/playwright.config.ts index 59a42657..bb5e6134 100644 --- a/playwright-tests/playwright.config.ts +++ b/playwright-tests/playwright.config.ts @@ -28,7 +28,7 @@ if (!process.env.CI) { const reportConfig: OrtoniReportConfig = { port: 1994, open: "never", - folderPath: "test-results", + folderPath: "ortoni-report", filename: "index.html", logo: "../business-logic/data/logo.png", title: "Test Report", @@ -55,7 +55,7 @@ export default defineConfig({ /* Reporter to use. See https://playwright.dev/docs/test-reporters */ reporter: [ ['ortoni-report', reportConfig], - ['junit'], + ['junit', {outputFile: '../test-results/junit_results.xml'}], ['list'] ], timeout: 240_000,