Skip to content

Commit

Permalink
test(e2e): add breadcrumb UI e2e test (#71)
Browse files Browse the repository at this point in the history
  • Loading branch information
zzcr authored Sep 29, 2024
1 parent 90805ac commit 867b32a
Show file tree
Hide file tree
Showing 4 changed files with 24 additions and 0 deletions.
24 changes: 24 additions & 0 deletions tests/breadcrumb/xdesign.spec.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,24 @@
import { expect, test } from '@playwright/test'

test.describe('breadcrumb组件xdesign规范', () => {
test('默认--UI截图', async ({ page }) => {
page.on('pageerror', (exception) => expect(exception).toBeNull())
await page.goto('breadcrumb#base')
const demo = page.locator('#base .pc-demo')
await expect(demo).toBeInViewport()
await expect(demo).toHaveScreenshot('base.png')

// 关闭按钮hover状态
await demo.getByText('产品').hover()
await expect(demo).toBeInViewport()
await expect(demo).toHaveScreenshot('hover.png')
})

test('自定义分隔符--UI截图', async ({ page }) => {
page.on('pageerror', (exception) => expect(exception).toBeNull())
await page.goto('breadcrumb#separator')
const demo = page.locator('#separator .pc-demo')
await expect(demo).toBeInViewport()
await expect(demo).toHaveScreenshot('separator.png')
})
})
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.

0 comments on commit 867b32a

Please sign in to comment.