Skip to content

Commit 9e694c5

Browse files
committed
ci: upload Playwright tests' results even in PR builds
We do that in all other workflows that run the Playwright tests, and it is very helpful when diagnosing issues (especially the screenshots that are stored on failure). This needs a slight change in the Playwright configuration where we now want to have the `github` reporter _in addition_ to the `html` reporter (and not instead of it). Signed-off-by: Johannes Schindelin <[email protected]>
1 parent 7f4e3a3 commit 9e694c5

File tree

2 files changed

+11
-2
lines changed

2 files changed

+11
-2
lines changed

.github/workflows/ci.yml

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -82,4 +82,9 @@ jobs:
8282
- name: Run Playwright tests
8383
env:
8484
PLAYWRIGHT_TEST_URL: http://localhost:5000/
85-
run: npx playwright test --project=chrome
85+
run: npx playwright test --project=chrome
86+
- uses: actions/upload-artifact@v4
87+
if: always()
88+
with:
89+
name: playwright-report
90+
path: playwright-report/

playwright.config.js

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,11 @@ module.exports = defineConfig({
2222
workers: process.env.CI ? 1 : undefined,
2323
/* Reporter to use. See https://playwright.dev/docs/test-reporters */
2424
/* Uses 'github' for GitHub Actions CI to generate annotations, otherwise 'html' */
25-
reporter: process.env.CI && process.env.PLAYWRIGHT_TEST_URL === 'http://localhost:5000/' ? 'github' : 'html',
25+
reporter: [
26+
[ 'html' ],
27+
...(process.env.CI && process.env.PLAYWRIGHT_TEST_URL === 'http://localhost:5000/'
28+
? [ [ 'github' ] ] : [])
29+
],
2630
/* Shared settings for all the projects below. See https://playwright.dev/docs/api/class-testoptions. */
2731
use: {
2832
/* Base URL to use in actions like `await page.goto('/')`. */

0 commit comments

Comments
 (0)