chore(functional): integrate html reporting with Playwright

This commit is contained in:
Ankita Shrivastava 2024-06-17 19:44:37 -04:00
Родитель 0b4e607e11
Коммит 6b0e150597
Не найден ключ, соответствующий данной подписи
Идентификатор ключа GPG: F3B1701360EA9310
2 изменённых файлов: 50 добавлений и 1 удалений

Просмотреть файл

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

Просмотреть файл

@ -73,6 +73,13 @@ export default defineConfig<PlaywrightTestConfig<TestOptions, WorkerOptions>>({
),
},
],
[
'blob',
{
outputDir: path.resolve(__dirname, '../../artifacts/blob-report'),
},
],
['html', { open: 'never' }],
]
: 'list',
workers,