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
29 changes: 29 additions & 0 deletions .github/workflows/playwright.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,29 @@
name: "Playwright"
on: [pull_request]

jobs:
playwright:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4

- uses: oven-sh/setup-bun@v1
with:
bun-version: latest

- name: Install dependencies
run: bun install --frozen-lockfile

- name: Install Playwright browsers
run: bunx playwright install chromium

- name: Run Playwright tests
run: bun run test:playwright

- name: Upload test results
if: failure()
uses: actions/upload-artifact@v4
with:
name: playwright-report
path: playwright-report/
retention-days: 7
5 changes: 5 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -29,3 +29,8 @@ dist-ssr
/target/
recording_*
.crush/

# Playwright
playwright-report/
test-results/
blob-report/
9 changes: 9 additions & 0 deletions bun.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

5 changes: 4 additions & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,9 @@
"format": "prettier --write . && cd src-tauri && cargo fmt",
"format:check": "prettier --check . && cd src-tauri && cargo fmt -- --check",
"format:frontend": "prettier --write .",
"format:backend": "cd src-tauri && cargo fmt"
"format:backend": "cd src-tauri && cargo fmt",
"test:playwright": "playwright test",
"test:playwright:ui": "playwright test --ui"
},
"dependencies": {
"@tailwindcss/vite": "^4.1.16",
Expand Down Expand Up @@ -42,6 +44,7 @@
"zustand": "^5.0.8"
},
"devDependencies": {
"@playwright/test": "^1.58.0",
"@tauri-apps/cli": "^2.9.1",
"@types/node": "^24.9.1",
"@types/react": "^18.3.26",
Expand Down
26 changes: 26 additions & 0 deletions playwright.config.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,26 @@
import { defineConfig, devices } from "@playwright/test";

export default defineConfig({
testDir: "./tests",
fullyParallel: true,
forbidOnly: !!process.env.CI,
retries: process.env.CI ? 2 : 0,
workers: process.env.CI ? 1 : undefined,
reporter: "html",
use: {
baseURL: "http://localhost:1420",
trace: "on-first-retry",
},
projects: [
{
name: "chromium",
use: { ...devices["Desktop Chrome"] },
},
],
webServer: {
command: "bunx vite dev",
url: "http://localhost:1420",
reuseExistingServer: !process.env.CI,
timeout: 30000,
},
});
18 changes: 18 additions & 0 deletions tests/app.spec.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
import { test, expect } from "@playwright/test";

test.describe("Handy App", () => {
test("dev server responds", async ({ page }) => {
// Just verify the dev server is running and responds
const response = await page.goto("/");
expect(response?.status()).toBe(200);
});

test("page has html structure", async ({ page }) => {
await page.goto("/");

// Verify basic HTML structure exists
const html = await page.content();
expect(html).toContain("<html");
expect(html).toContain("<body");
});
});