Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix(guide): [guide] update e2e test #1456

Merged
merged 6 commits into from
Mar 2, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 3 additions & 2 deletions examples/sites/demos/pc/app/guide/basic-usage.spec.ts
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,7 @@ test('基础用法', async ({ page }) => {
const step2 = page.getByRole('heading', { name: '新手引导标题2' })
const step3 = page.getByRole('dialog').locator('div').nth(2)
const next = page.getByRole('button', { name: '下一步' })
const finished = page.getByRole('button', { name: '完成' })
const showBtn = page.getByRole('button', { name: '带滚动条新手引导' })
const closeBtn = page.getByRole('button', { name: 'Close Tour' })

Expand All @@ -22,8 +23,8 @@ test('基础用法', async ({ page }) => {
// 点击下一步,引导
await next.click()
await expect(step2).toBeVisible()
await next.click()
await expect(next).toBeHidden()
await finished.click()
await expect(finished).toBeHidden()
await expect(step3).toBeHidden()

// 引导显示后,点击关闭按钮可关闭
Expand Down
4 changes: 3 additions & 1 deletion examples/sites/demos/pc/app/guide/offset.spec.ts
Original file line number Diff line number Diff line change
Expand Up @@ -12,14 +12,16 @@ test('引导框偏移量', async ({ page }) => {
await guideBtn1.click()
await expect(guide).toBeVisible()

await page.waitForTimeout(500)
const guideBox1 = await guide.boundingBox()

// 引导2 50px
await page.getByRole('button', { name: 'Close Tour' }).click()
await guideBtn2.click()
await expect(guide).toBeVisible()

await page.waitForTimeout(500)
const guideBox2 = await guide.boundingBox()

expect(guideBox1.y).toBeLessThan(guideBox2.y)
await expect(guideBox1.y).toBeLessThan(guideBox2.y)
})
2 changes: 1 addition & 1 deletion packages/vue/src/loading/src/directive.ts
Original file line number Diff line number Diff line change
Expand Up @@ -98,7 +98,7 @@ const toggleLoading = (el, binding) => {
afterLeave(
el.instance,
() => {
if (!el.instance.hiding) {
if (!el.instance?.hiding) {
return
}

Expand Down
Loading