Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 0 additions & 3 deletions .github/workflows/deploy.yml
Original file line number Diff line number Diff line change
@@ -1,9 +1,6 @@
name: Deploy to GitHub Pages

on:
push:
branches:
- main
workflow_dispatch:

permissions:
Expand Down
61 changes: 61 additions & 0 deletions .github/workflows/playwright.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,61 @@
name: Playwright

on:
push:
branches:
- main
paths:
- 'src/**'
- 'playwright/**'
- 'package-lock.json'
- 'playwright.config.ts'
- '.github/workflows/playwright.yml'
workflow_dispatch:

jobs:
e2e:
name: E2E (Playwright)
runs-on: ubuntu-latest
timeout-minutes: 25

steps:
- name: Checkout
uses: actions/checkout@v6.0.1

- name: Setup Node
uses: actions/setup-node@v6.2.0
with:
node-version: '24.14.0'

- name: Install Dependencies
run: npm ci

- name: Check Types
run: npm run check-types

- name: Lint Playwright Files
run: npm run lint:playwright

- name: Install Browsers
run: npx playwright install --with-deps chromium webkit

- name: Run Playwright Tests
env:
CI: 'true'
run: npm run test:e2e

- name: Upload Playwright report
uses: actions/upload-artifact@v6.0.0
if: ${{ failure() }}
with:
name: playwright-report
path: playwright-report
if-no-files-found: ignore

- name: Upload Playwright test results
uses: actions/upload-artifact@v6.0.0
if: ${{ failure() }}
with:
name: test-results
path: test-results
if-no-files-found: ignore
4 changes: 3 additions & 1 deletion .gitignore
Original file line number Diff line number Diff line change
@@ -1,2 +1,4 @@
node_modules
dist
dist
playwright-report
test-results
28 changes: 28 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,34 @@ npm run dev

Then open the URL printed by the dev server (it should open `src/index.html`).

## End-to-end tests

Install Playwright browsers once before your first local run:

```bash
npx playwright install
```

If your environment needs system dependencies too (for example Linux CI-like containers), use:

```bash
npx playwright install --with-deps
```

Run local Playwright tests (Chromium):

```bash
npm run test:e2e
```

Run locally with headed browser:

```bash
npm run test:e2e:headed
```

CI runs Playwright on Chromium and WebKit.

## Notes

- This is currently a development playground, not a stable product.
Expand Down
28 changes: 28 additions & 0 deletions eslint.config.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,28 @@
import playwright from 'eslint-plugin-playwright'
import tsParser from '@typescript-eslint/parser'

const playwrightConfig = playwright.configs['flat/recommended']

export default [
{
ignores: [
'dist/**',
'coverage/**',
'node_modules/**',
'playwright-report/**',
'test-results/**',
],
},
{
files: ['playwright/**/*.{ts,tsx,js,jsx}', 'playwright.config.ts'],
languageOptions: {
parser: tsParser,
sourceType: 'module',
ecmaVersion: 'latest',
},
},
{
...playwrightConfig,
files: ['playwright/**/*.{ts,tsx,js,jsx}'],
},
]
Loading
Loading