Skip to content

Commit

Permalink
fix(guide): [guide] update e2e test (#1456)
Browse files Browse the repository at this point in the history
* test(dept): [dept] Fix test cases

* test(dept): [dept] Fix test cases

* test(loading):  Resolve loading error

* fix(guide): [guide] update e2e test
  • Loading branch information
wuyiping0628 authored Mar 2, 2024
1 parent 41fa0ce commit 91bce03
Show file tree
Hide file tree
Showing 3 changed files with 7 additions and 4 deletions.
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

0 comments on commit 91bce03

Please sign in to comment.