docs(sites): [form, alert] fix not pass e2e case (#1172)

This commit is contained in:
gimmyhehe 2023-12-19 10:28:26 +08:00 committed by GitHub
parent d59fc4d47e
commit 98bbf4ca3b
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
3 changed files with 5 additions and 2 deletions

View File

@ -7,7 +7,7 @@ test('关闭按钮', async ({ page }) => {
const demo = page.locator('#custom-close')
const customAlert = demo.locator('.tiny-alert').first()
const defaultClose = customAlert.locator('.tiny-alert__close')
const customClose = customAlert.locator('.icon')
const customClose = customAlert.locator('.is-custom .tiny-svg')
const switchBtn = demo.locator('.tiny-switch')
// 自定义关闭图标

View File

@ -142,7 +142,7 @@ export default {
'zh-CN': '指定跳转的目标页面地址',
'en-US': 'Specify the URL of the target page.'
},
'demoId': 'target'
'demoId': 'link'
},
{
'name': 'is-dot',

View File

@ -12,18 +12,21 @@ test('测试表单文本对齐', async ({ page }) => {
const firstItemContent = formItem.first().locator('.tiny-form-item__content')
await getBtnByText('left').click()
await page.waitForTimeout(300)
await expect(form).toHaveClass(/tiny-form--label-left/)
let labelBox = await firstItemLabel.boundingBox()
let contentBox = await firstItemContent.boundingBox()
expect(labelBox?.y).toEqual(contentBox?.y)
await getBtnByText('top').click()
await page.waitForTimeout(300)
await expect(form).toHaveClass(/tiny-form--label-top/)
labelBox = await firstItemLabel.boundingBox()
contentBox = await firstItemContent.boundingBox()
expect(labelBox?.y).toBeLessThan(contentBox?.y || 0)
await getBtnByText('right').click()
await page.waitForTimeout(300)
await expect(form).toHaveClass(/tiny-form--label-right/)
labelBox = await firstItemLabel.boundingBox()
contentBox = await firstItemContent.boundingBox()