Skip to content

Commit 98c46ee

Browse files
committed
ci: run the Playwright tests in every Pull Request
As all building blocks are now in place to run the Playwright tests in-place, we can run them as part of every Pull Request, to catch regressions before they enter the official site. Signed-off-by: Johannes Schindelin <[email protected]>
1 parent 6bcfb1f commit 98c46ee

File tree

2 files changed

+9
-1
lines changed

2 files changed

+9
-1
lines changed

.github/workflows/ci.yml

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -76,3 +76,10 @@ jobs:
7676
public/
7777
output: lychee.md
7878
jobSummary: true
79+
80+
- name: Install @playwright/test
81+
run: npm install @playwright/test
82+
- name: Run Playwright tests
83+
env:
84+
PLAYWRIGHT_TEST_URL: http://localhost:5000/
85+
run: npx playwright test --project=chrome

playwright.config.js

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,8 @@ module.exports = defineConfig({
2121
/* Opt out of parallel tests on CI. */
2222
workers: process.env.CI ? 1 : undefined,
2323
/* Reporter to use. See https://playwright.dev/docs/test-reporters */
24-
reporter: 'html',
24+
/* 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',
2526
/* Shared settings for all the projects below. See https://playwright.dev/docs/api/class-testoptions. */
2627
use: {
2728
/* Base URL to use in actions like `await page.goto('/')`. */

0 commit comments

Comments
 (0)