feat: strengthen backup and mobile workflows
This commit is contained in:
@@ -0,0 +1,41 @@
|
||||
import { defineConfig } from '@playwright/test'
|
||||
import path from 'node:path'
|
||||
|
||||
const projectName = process.env.DODO_E2E_PROJECT
|
||||
if (!projectName) throw new Error('DODO_E2E_PROJECT is required; use pnpm test:e2e:mobile')
|
||||
const project = projectName === 'mobile-390'
|
||||
? { name: 'mobile-390', use: { viewport: { width: 390, height: 844 }, deviceScaleFactor: 3, isMobile: true, hasTouch: true } }
|
||||
: projectName === 'mobile-375'
|
||||
? { name: 'mobile-375', testIgnore: /backup-roundtrip\.spec\.ts/, use: { viewport: { width: 375, height: 667 }, deviceScaleFactor: 2, isMobile: true, hasTouch: true } }
|
||||
: null
|
||||
if (!project) throw new Error(`unknown DODO_E2E_PROJECT: ${projectName}`)
|
||||
|
||||
const runtimeRoot = path.resolve('playwright-runtime', projectName)
|
||||
|
||||
export default defineConfig({
|
||||
testDir: './e2e',
|
||||
fullyParallel: false,
|
||||
workers: 1,
|
||||
timeout: 45_000,
|
||||
expect: { timeout: 8_000 },
|
||||
outputDir: path.join(runtimeRoot, 'test-results'),
|
||||
reporter: [['line'], ['html', { outputFolder: path.join(runtimeRoot, 'report'), open: 'never' }]],
|
||||
globalSetup: './e2e/global-setup.ts',
|
||||
use: {
|
||||
baseURL: 'http://127.0.0.1:5173',
|
||||
storageState: path.join(runtimeRoot, 'auth.json'),
|
||||
reducedMotion: 'reduce',
|
||||
trace: 'retain-on-failure',
|
||||
screenshot: 'only-on-failure',
|
||||
video: 'retain-on-failure',
|
||||
},
|
||||
projects: [project],
|
||||
webServer: {
|
||||
command: 'node scripts/playwright-mobile-server.mjs',
|
||||
url: 'http://127.0.0.1:5173',
|
||||
reuseExistingServer: false,
|
||||
timeout: 120_000,
|
||||
stdout: 'pipe',
|
||||
stderr: 'pipe',
|
||||
},
|
||||
})
|
||||
Reference in New Issue
Block a user