Skip to content

Commit b7339fd

Browse files
KevenWMarkhamclaude
andcommitted
feat(test): add multi-device E2E testing support
Add Playwright device emulation for iOS, Android, and Tablet testing: - Desktop Chrome and Edge browsers - iPhone 14 (iOS mobile) - Pixel 7 (Android mobile) - iPad (gen 7) (Tablet) New test scripts: - test:e2e:desktop - Desktop browsers only - test:e2e:mobile - All mobile/tablet devices - test:e2e:ios - iPhone 14 + iPad - test:e2e:android - Pixel 7 only Configuration: - Sequential execution (workers: 1) - Screenshot on failure - Video retained on failure - List reporter for device-prefixed output 🤖 Generated with [Claude Code](https://claude.com/claude-code) Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
1 parent ce528f9 commit b7339fd

File tree

2 files changed

+27
-5
lines changed

2 files changed

+27
-5
lines changed

package.json

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -23,6 +23,10 @@
2323
"test:e2e": "playwright test",
2424
"test:e2e:ui": "playwright test --ui",
2525
"test:e2e:headed": "playwright test --headed",
26+
"test:e2e:desktop": "playwright test --project=\"Desktop Chrome\" --project=\"Desktop Edge\"",
27+
"test:e2e:mobile": "playwright test --project=\"iPhone 14\" --project=\"Pixel 7\" --project=\"iPad\"",
28+
"test:e2e:ios": "playwright test --project=\"iPhone 14\" --project=\"iPad\"",
29+
"test:e2e:android": "playwright test --project=\"Pixel 7\"",
2630
"db:generate": "drizzle-kit generate",
2731
"db:migrate": "drizzle-kit migrate",
2832
"db:push": "drizzle-kit push",

playwright.config.ts

Lines changed: 23 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -2,23 +2,41 @@ import { defineConfig, devices } from '@playwright/test'
22

33
export default defineConfig({
44
testDir: './tests/e2e',
5-
fullyParallel: true,
5+
fullyParallel: false,
66
forbidOnly: !!process.env.CI,
77
retries: process.env.CI ? 2 : 0,
8-
workers: process.env.CI ? 1 : undefined,
9-
reporter: 'html',
8+
workers: 1,
9+
reporter: [['html', { open: 'never' }], ['list']],
1010
use: {
1111
baseURL: 'http://localhost:5173',
1212
trace: 'on-first-retry',
13+
screenshot: 'only-on-failure',
14+
video: 'retain-on-failure',
1315
},
1416
projects: [
1517
{
16-
name: 'chromium',
18+
name: 'Desktop Chrome',
1719
use: { ...devices['Desktop Chrome'] },
1820
},
21+
{
22+
name: 'Desktop Edge',
23+
use: { ...devices['Desktop Edge'] },
24+
},
25+
{
26+
name: 'iPhone 14',
27+
use: { ...devices['iPhone 14'] },
28+
},
29+
{
30+
name: 'Pixel 7',
31+
use: { ...devices['Pixel 7'] },
32+
},
33+
{
34+
name: 'iPad',
35+
use: { ...devices['iPad (gen 7)'] },
36+
},
1937
],
2038
webServer: {
21-
command: 'npm run dev',
39+
command: 'pnpm dev',
2240
url: 'http://localhost:5173',
2341
reuseExistingServer: !process.env.CI,
2442
},

0 commit comments

Comments
 (0)