From 7b0f9457cf6389b6d6eadfc31bc32cac5b4edbc8 Mon Sep 17 00:00:00 2001 From: Adrian Moldovan <3854374+adimoldovan@users.noreply.github.com> Date: Mon, 8 Jul 2024 13:02:31 +0100 Subject: [PATCH] [e2e tests] Add Allure reporter to Blocks e2e tests (#49228) --- plugins/woocommerce-blocks/package.json | 1 + .../tests/e2e/playwright.config.ts | 12 +++++++++++- .../changelog/e2e-add-allure-to-blocks-e2e | 4 ++++ plugins/woocommerce/package.json | 3 ++- pnpm-lock.yaml | 5 ++++- 5 files changed, 22 insertions(+), 3 deletions(-) create mode 100644 plugins/woocommerce/changelog/e2e-add-allure-to-blocks-e2e diff --git a/plugins/woocommerce-blocks/package.json b/plugins/woocommerce-blocks/package.json index c45afb3103c..8cee0db56a6 100644 --- a/plugins/woocommerce-blocks/package.json +++ b/plugins/woocommerce-blocks/package.json @@ -194,6 +194,7 @@ "@wordpress/prettier-config": "1.4.0", "@wordpress/scripts": "24.6.0", "@wordpress/stylelint-config": "^21.36.0", + "allure-playwright": "^2.9.2", "autoprefixer": "10.4.14", "axios": "0.27.2", "babel-jest": "^29.7.0", diff --git a/plugins/woocommerce-blocks/tests/e2e/playwright.config.ts b/plugins/woocommerce-blocks/tests/e2e/playwright.config.ts index a34c21dfa28..44b30868bed 100644 --- a/plugins/woocommerce-blocks/tests/e2e/playwright.config.ts +++ b/plugins/woocommerce-blocks/tests/e2e/playwright.config.ts @@ -23,7 +23,17 @@ const config: PlaywrightTestConfig = { // Don't report slow test "files", as we're running our tests in serial. reportSlowTests: null, reporter: process.env.CI - ? [ [ 'github' ], [ 'list' ], [ './flaky-tests-reporter.ts' ] ] + ? [ + [ 'github' ], + [ 'list' ], + [ './flaky-tests-reporter.ts' ], + [ + 'allure-playwright', + { + outputFolder: `${ __dirname }/artifacts/test-results/allure-results`, + }, + ], + ] : 'list', use: { baseURL: BASE_URL, diff --git a/plugins/woocommerce/changelog/e2e-add-allure-to-blocks-e2e b/plugins/woocommerce/changelog/e2e-add-allure-to-blocks-e2e new file mode 100644 index 00000000000..75456116d0d --- /dev/null +++ b/plugins/woocommerce/changelog/e2e-add-allure-to-blocks-e2e @@ -0,0 +1,4 @@ +Significance: patch +Type: dev + +Add Allure to Blocks e2e tests diff --git a/plugins/woocommerce/package.json b/plugins/woocommerce/package.json index 562b8600ff0..54d61a30613 100644 --- a/plugins/woocommerce/package.json +++ b/plugins/woocommerce/package.json @@ -605,7 +605,8 @@ ], "report": { "resultsBlobName": "blocks-e2e-report", - "resultsPath": "../woocommerce-blocks/tests/e2e/artifacts/test-results" + "resultsPath": "../woocommerce-blocks/tests/e2e/artifacts/test-results", + "allure": true } }, { diff --git a/pnpm-lock.yaml b/pnpm-lock.yaml index 38712475de1..c83aaa60ee1 100644 --- a/pnpm-lock.yaml +++ b/pnpm-lock.yaml @@ -4260,6 +4260,9 @@ importers: '@wordpress/stylelint-config': specifier: ^21.36.0 version: 21.36.0(postcss@8.4.32)(stylelint@14.16.1) + allure-playwright: + specifier: ^2.9.2 + version: 2.9.2 autoprefixer: specifier: 10.4.14 version: 10.4.14(postcss@8.4.32) @@ -21630,7 +21633,7 @@ packages: engines: {node: '>=18'} hasBin: true peerDependencies: - react: 18.2.0 + react: ^17.0.2 react-number-format@4.9.3: resolution: {integrity: sha512-am1A1xYAbENuKJ+zpM7V+B1oRTSeOHYltqVKExznIVFweBzhLmOBmyb1DfIKjHo90E0bo1p3nzVJ2NgS5xh+sQ==}