Skip to content

Commit 63fc16b

Browse files
committed
playwright: add a GitHub workflow to run the tests
The UI tests are most beneficial when they are run regularly ;-) For starters, this allows running them in a GitHub workflow that is triggered manually, offering the user to specify which site to test. Signed-off-by: Johannes Schindelin <[email protected]>
1 parent 2d83ef5 commit 63fc16b

File tree

2 files changed

+33
-0
lines changed

2 files changed

+33
-0
lines changed

.github/workflows/playwright.yml

Lines changed: 28 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,28 @@
1+
name: Playwright Tests
2+
on:
3+
workflow_dispatch:
4+
inputs:
5+
url:
6+
description: 'URL to test'
7+
required: true
8+
default: 'https://git-scm.com'
9+
jobs:
10+
test:
11+
timeout-minutes: 60
12+
runs-on: ubuntu-latest
13+
steps:
14+
- uses: actions/checkout@v4
15+
- uses: actions/setup-node@v4
16+
with:
17+
node-version: lts/*
18+
- name: Install @playwright/test
19+
run: npm install @playwright/test
20+
- name: Run Playwright tests
21+
env:
22+
PLAYWRIGHT_TEST_URL: ${{ github.event.inputs.url }}
23+
run: npx playwright test --project=chrome
24+
- uses: actions/upload-artifact@v4
25+
if: always()
26+
with:
27+
name: playwright-report
28+
path: playwright-report/

playwright.config.js

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -48,6 +48,11 @@ module.exports = defineConfig({
4848
use: { ...devices['Desktop Safari'] },
4949
},
5050

51+
{
52+
name: 'chrome',
53+
use: { ...devices['Desktop Chrome'], channel: 'chrome' },
54+
},
55+
5156
/* Test against mobile viewports. */
5257
// {
5358
// name: 'Mobile Chrome',

0 commit comments

Comments
 (0)