Skip to content
Merged
Show file tree
Hide file tree
Changes from 1 commit
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
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/**'
Comment thread
knightedcodemonkey marked this conversation as resolved.
- 'package-lock.json'
Comment thread
knightedcodemonkey marked this conversation as resolved.
pull_request:
branches:
- main
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
16 changes: 16 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,22 @@ npm run dev

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

## End-to-end tests

Run local Playwright tests (Chromium):

```bash
npm run test:e2e
```
Comment thread
knightedcodemonkey marked this conversation as resolved.

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