Skip to content

Commit

Permalink
test(e2e): update some components e2e test
Browse files Browse the repository at this point in the history
  • Loading branch information
zzcr committed Oct 21, 2024
1 parent 000f2b8 commit 54afc86
Showing 1 changed file with 6 additions and 5 deletions.
11 changes: 6 additions & 5 deletions examples/sites/demos/pc/app/dialog-box/destroy-on-close.spec.ts
Original file line number Diff line number Diff line change
Expand Up @@ -5,13 +5,14 @@ test('关闭时销毁主体元素', async ({ page }) => {
const dialogBox = page.locator('.tiny-dialog-box')
await page.goto('dialog-box#destroy-on-close')
const demo = page.locator('#destroy-on-close')
await demo.getByRole('button', { name: '打开弹框' }).click()
await demo.getByLabel('Close').click()

await demo.locator('label').filter({ hasText: '关闭时不销毁' }).click()
await demo.getByRole('button', { name: '打开弹框' }).click()
await page.getByRole('button', { name: '确定' }).click()
await demo.locator('.tiny-dialog-box__footer').getByRole('button', { name: '确定' }).click()
await expect(dialogBox).toBeHidden()

await demo.locator('label').filter({ hasText: '关闭时销毁' }).click()
await demo.getByRole('button', { name: '打开弹框' }).click()
await page.getByRole('button', { name: '确定' }).click()
await expect(dialogBox).toBeHidden()
await demo.locator('.tiny-dialog-box__footer').getByRole('button', { name: '确定' }).click()
await expect(dialogBox).toHaveCount(0)
})

0 comments on commit 54afc86

Please sign in to comment.