Skip to content

Commit da3b9db

Browse files
committed
Merge branch 'dev' of https://github.com/Yujing613/tiny-vue into drawer_destroyOnClose
2 parents bdf9db5 + 1e9af22 commit da3b9db

2 files changed

Lines changed: 34 additions & 5 deletions

File tree

examples/vue3/package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,7 @@
1414
"test:e2e": "playwright test",
1515
"test:unit": "vitest",
1616
"install:browser": "playwright install",
17-
"codegen": "playwright codegen localhost:3101",
17+
"codegen": "playwright codegen --viewport-size=1920,1080 localhost:3101",
1818
"open:report": "playwright show-report"
1919
},
2020
"devDependencies": {

examples/vue3/playwright.config.js

Lines changed: 33 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,18 +1,48 @@
11
import Config from '@opentiny-internal/playwright-config'
2+
import { defineConfig } from '@playwright/test'
23

34
/**
45
* 本地开发环境链接:'http://localhost:7130/pc/'
56
* 本地官网链接:'http://localhost:3101'
67
* 外部测试官网链接:'https://opentiny.github.io/tiny-vue-web-doc'
78
*/
89
const origin = 'http://localhost:3101/tiny-vue'
9-
1010
const baseURL = `${origin}/zh-CN/os-theme/components/`
1111
const devServerCommon = 'pnpm run -w site'
1212

13-
export default Config({
13+
const baseConfig = Config({
1414
testDir: '../sites/demos/pc',
1515
baseURL,
16+
devServerCommon
17+
})
18+
19+
// 合并,确保关键字段不丢失
20+
export default defineConfig({
21+
// 保留 baseConfig
22+
...baseConfig,
23+
24+
// 显式覆盖 projects(完全替换)
25+
projects: [
26+
{
27+
name: 'chromium',
28+
use: {
29+
browserName: 'chromium',
30+
viewport: { width: 1920, height: 1080 },
31+
launchOptions: {
32+
args: ['--window-size=1920,1080']
33+
}
34+
}
35+
}
36+
],
37+
38+
// 合并 use
39+
use: {
40+
...baseConfig.use, // 保留 baseConfig 的 use 配置
41+
viewport: { width: 1920, height: 1080 },
42+
actionTimeout: 10000
43+
},
44+
45+
// 合并 storageState
1646
storageState: {
1747
origins: [
1848
{
@@ -24,6 +54,5 @@ export default Config({
2454
]
2555
}
2656
]
27-
},
28-
devServerCommon
57+
}
2958
})

0 commit comments

Comments
 (0)