-
Notifications
You must be signed in to change notification settings - Fork 26
Expand file tree
/
Copy pathplaywright.config.ts
More file actions
44 lines (43 loc) · 1.15 KB
/
playwright.config.ts
File metadata and controls
44 lines (43 loc) · 1.15 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
import { defineConfig, devices } from '@playwright/test';
export default defineConfig({
workers: 1,
timeout: 60_000,
expect: { timeout: 10_000 },
fullyParallel: false,
forbidOnly: !!process.env.CI,
retries: process.env.CI ? 2 : 1,
reporter: [
['list'],
['html', { outputFolder: 'playwright-report', open: 'never' }]
],
use: {
baseURL: 'http://localhost:3031/vue-pro',
trace: 'on-first-retry',
},
projects: [
// 手机
{
name: 'iPhone 12 Safari', // 390 * 664
use: { ...devices['iPhone 12'] },
testDir: './tests/e2e/mobile',
},
{
name: 'Pixel 5', // 393 * 727
use: { ...devices['Pixel 5'] },
testDir: './tests/e2e/mobile',
},
// 平板
{
name: 'iPad (gen 5)', // 768 * 1024
use: { ...devices['iPad (gen 5)'] },
testDir: './tests/e2e/mobile',
}
],
webServer: {
command: 'pnpm start',
cwd: 'template/tinyvue',
url: 'http://localhost:3031/vue-pro',
reuseExistingServer: true,
timeout: 120_000
}
});