Updated reporter config

This commit is contained in:
Chase King 2025-02-27 16:05:14 -05:00
parent 86009a7c07
commit 7e64e0eee4
3 changed files with 6 additions and 7 deletions

1
.gitignore vendored
View file

@ -24,6 +24,7 @@ pnpm-debug.log*
# Playwright
/test-results/
/ortoni-report/
/playwright-report/
/blob-report/
/playwright/.cache/

View file

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

View file

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