Skip to content

Commit 53041cc

Browse files
authored
fix(e2e): fix all e2e test error (#2811)
* fix(e2e): fix all e2e test error * fix(e2e): fix all e2e test error * fix(e2e): fix all e2e test error * chore: 优化注释内容
1 parent 1378b32 commit 53041cc

File tree

4 files changed

+6
-3
lines changed

4 files changed

+6
-3
lines changed

.github/workflows/test-e2e-all.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -54,7 +54,7 @@ jobs:
5454

5555
- name: Release E2E Config
5656
if: contains(inputs.origin, 'http') == true
57-
run: pnpm release:e2eConfig -o ${{ inputs.origin }}
57+
run: pnpm release:e2eConfig -o ${{ inputs.origin }} & sleep 5
5858

5959
- name: update playwright
6060
run: pnpm recursive update @playwright/test

examples/vue3/playwright.config.js

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,7 @@ import Config from '@opentiny-internal/playwright-config'
33
/**
44
* 本地开发环境链接:'http://localhost:7130/pc/'
55
* 本地官网链接:'http://localhost:3101'
6+
* 外部测试官网链接:'https://opentiny.github.io/tiny-vue-web-doc'
67
*/
78
const origin = 'http://localhost:3101/tiny-vue'
89

internals/cli/src/commands/release/releaseE2EConfig.ts

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,9 @@ const playWrightConfigPath = pathFromExamples('vue3/playwright.config.js')
77

88
export const releaseE2EConfig = ({ origin }) => {
99
const content = fs.readFileSync(playWrightConfigPath).toString('UTF-8' as BufferEncoding)
10-
const result = origin ? content.replace('http://localhost:3101/tiny-vue', origin) : content
10+
const result = origin
11+
? content.replace('http://localhost:3101/tiny-vue', origin).replace('pnpm run -w site', '')
12+
: content
1113

1214
fs.writeFileSync(playWrightConfigPath, result)
1315
}

internals/playwright-config/src/index.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -52,7 +52,7 @@ const Config = ({ testDir, baseURL, storageState, devServerCommon }) =>
5252
},
5353
// 如果是全量跑测试官网或者本地测试则不需要开启webServer
5454
webServer:
55-
process.env.PYTEST_BASEURL || !process.env.CI
55+
!devServerCommon || !process.env.CI
5656
? null
5757
: {
5858
command: devServerCommon,

0 commit comments

Comments
 (0)