Skip to content

Commit

Permalink
test: add anchor UI e2e test
Browse files Browse the repository at this point in the history
  • Loading branch information
chenxi-20 committed Sep 19, 2024
1 parent eff32a3 commit f458d9a
Show file tree
Hide file tree
Showing 3 changed files with 15 additions and 0 deletions.
15 changes: 15 additions & 0 deletions tests/anchor/xdesign.spec.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
import { expect, test } from '@playwright/test'

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

// 点击时截图
await page.getByLabel('示例', { exact: true }).getByRole('link', { name: '基本用法' }).click()
await expect(demo).toHaveScreenshot('basic-usage-click.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.

0 comments on commit f458d9a

Please sign in to comment.