Skip to content

Commit

Permalink
test: add wizard UI e2e test (#48)
Browse files Browse the repository at this point in the history
  • Loading branch information
chenxi-20 authored Sep 23, 2024
1 parent 41bc4e1 commit ce7ff28
Show file tree
Hide file tree
Showing 5 changed files with 35 additions and 0 deletions.
35 changes: 35 additions & 0 deletions tests/wizard/xdesign.spec.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,35 @@
import { expect, test } from '@playwright/test'

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

test('页向导模式 --UI截图', async ({ page }) => {
page.on('pageerror', (exception) => expect(exception).toBeNull())
await page.goto('wizard#page-guide')
const demo = page.locator('#page-guide .pc-demo')
await expect(demo).toBeInViewport()
await expect(demo).toHaveScreenshot('page-guide.png')
})

test('垂直模式 --UI截图', async ({ page }) => {
page.on('pageerror', (exception) => expect(exception).toBeNull())
await page.goto('wizard#vertical')
const demo = page.locator('#vertical .pc-demo')
await expect(demo).toBeInViewport()
await expect(demo).toHaveScreenshot('vertical.png')
})

test('时间线 --UI截图', async ({ page }) => {
page.on('pageerror', (exception) => expect(exception).toBeNull())
await page.goto('wizard#time-line-flow')
const demo = page.locator('#time-line-flow .pc-demo')
await expect(demo).toBeInViewport()
await expect(demo).toHaveScreenshot('time-line-flow.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.
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 ce7ff28

Please sign in to comment.