From 6b0e15059760034771ed4fb497004eb92ed28255 Mon Sep 17 00:00:00 2001 From: Ankita Shrivastava Date: Mon, 17 Jun 2024 19:44:37 -0400 Subject: [PATCH] chore(functional): integrate html reporting with Playwright --- .circleci/config.yml | 44 ++++++++++++++++++- .../functional-tests/playwright.config.ts | 7 +++ 2 files changed, 50 insertions(+), 1 deletion(-) diff --git a/.circleci/config.yml b/.circleci/config.yml index 363ec0c69c..10f9b6cb3b 100644 --- a/.circleci/config.yml +++ b/.circleci/config.yml @@ -322,6 +322,8 @@ commands: NODE_OPTIONS: --dns-result-order=ipv4first JEST_JUNIT_OUTPUT_DIR: ./artifacts/tests JEST_JUNIT_ADD_FILE_ATTRIBUTE: true + PLAYWRIGHT_BLOB_OUTPUT_DIR: ./artifacts/blob-report + PW_TEST_HTML_REPORT_OPEN: never ACCOUNTS_DOMAIN: << pipeline.parameters.accounts-domain >> PAYMENTS_DOMAIN: << pipeline.parameters.payments-domain >> ACCOUNTS_API_DOMAIN: << pipeline.parameters.accounts-api-domain >> @@ -332,7 +334,7 @@ commands: steps: - run: name: Ensure directories - command: mkdir -p artifacts/tests && mkdir -p ~/.pm2/logs && mkdir -p ~/screenshots + command: mkdir -p artifacts/tests && mkdir -p ~/.pm2/logs && mkdir -p ~/screenshots && mkdir -p artifacts/blob-report && mkdir -p artifacts/playwright-report - store_artifacts: path: artifacts - store_artifacts: @@ -342,6 +344,21 @@ commands: - store_test_results: path: artifacts/tests + rename-reports: + steps: + - run: + name: Rename Reports + command: | + cd artifacts/blob-report + mv report.zip reports-${CIRCLE_NODE_INDEX}.zip + - store_artifacts: + path: artifacts/blob-report + - persist_to_workspace: + root: /home/circleci/project + paths: + - artifacts/blob-report + + build: steps: - run: @@ -657,6 +674,23 @@ jobs: - run-playwright-tests: project: local - store-artifacts + - rename-reports + + playwright-functional-test-report: + executor: default-executor + steps: + - attach_workspace: + at: /home/circleci/project + - run: + name: Merge blob Reports + command: ls -l artifacts/blob-report && npx playwright merge-reports --reporter=blob artifacts/blob-report + - store_artifacts: + path: blob-report + - run: + name: Merge html Reports + command: npx playwright merge-reports --reporter=html artifacts/blob-report + - store_artifacts: + path: playwright-report build-and-deploy-storybooks: executor: default-executor @@ -771,6 +805,10 @@ workflows: parallelism: 8 requires: - Build (PR) + - playwright-functional-test-report: + name: Merge Playwright Reports (PR) + requires: + - Functional Tests - Playwright (PR) - build-and-deploy-storybooks: name: Deploy Storybooks (PR) requires: @@ -1093,6 +1131,10 @@ workflows: parallelism: 8 requires: - Build (nightly) + - playwright-functional-test-report: + name: Merge Playwright Reports (nightly) + requires: + - Functional Tests - Playwright (nightly) - on-complete: name: Tests Complete (nightly) stage: Tests (nightly) diff --git a/packages/functional-tests/playwright.config.ts b/packages/functional-tests/playwright.config.ts index 76878ec933..a2ca1ea742 100644 --- a/packages/functional-tests/playwright.config.ts +++ b/packages/functional-tests/playwright.config.ts @@ -73,6 +73,13 @@ export default defineConfig>({ ), }, ], + [ + 'blob', + { + outputDir: path.resolve(__dirname, '../../artifacts/blob-report'), + }, + ], + ['html', { open: 'never' }], ] : 'list', workers,