Skip to content

Commit 57a12c8

Browse files
authored
ci(workflow): add origin input parameter of E2E test configuration, support specifying test domain name, and fix sticky component test cases (#3428)
* fix(sticky): 修复偏移测试用例,增加等待时间以确保元素可见性 * ci(workflow): 增加E2E测试配置的origin输入参数,支持指定测试域名
1 parent 3dcabd8 commit 57a12c8

File tree

2 files changed

+14
-1
lines changed

2 files changed

+14
-1
lines changed

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

+12-1
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
name: E2E Test Dispatch
2-
run-name: E2E Test Dispatch--${{ inputs.testDemos }}--
2+
run-name: E2E Test Dispatch--${{ inputs.testDemos }}--origin--${{ inputs.origin }}
33
on:
44
workflow_dispatch:
55
inputs:
@@ -9,6 +9,12 @@ on:
99
such as `input, alert`.
1010
required: true
1111
type: string
12+
origin:
13+
description: |
14+
输入需要测试的域名地址,包括微服务路径,如果不输入则采用本地启动服务测试,
15+
例如: `https://opentiny.github.io/tiny-vue-web-doc`.
16+
required: false
17+
type: string
1218
concurrency:
1319
group: ${{ github.workflow }}-${{ github.sha }}
1420
cancel-in-progress: true
@@ -44,8 +50,13 @@ jobs:
4450
run: pnpm i --no-frozen-lockfile
4551

4652
- name: dev start
53+
if: contains(inputs.origin, 'http') == false
4754
run: pnpm site & sleep 5
4855

56+
- name: Release E2E Config
57+
if: contains(inputs.origin, 'http') == true
58+
run: pnpm release:e2eConfig -o ${{ inputs.origin }} & sleep 5
59+
4960
- name: Install Playwright browsers
5061
run: pnpm install:browser --with-deps chromium
5162

examples/sites/demos/pc/app/sticky/offset.spec.ts

+2
Original file line numberDiff line numberDiff line change
@@ -7,5 +7,7 @@ test('偏移距离', async ({ page }) => {
77
const demo = page.locator('#offset')
88

99
await demo.locator('i').first().scrollIntoViewIfNeeded()
10+
await page.waitForTimeout(200)
11+
await demo.locator('i').nth(2).scrollIntoViewIfNeeded()
1012
await expect(demo.locator('.tiny-sticky--fixed')).toHaveCSS('top', '100px')
1113
})

0 commit comments

Comments
 (0)