forked from opentiny/tiny-vue
docs(sites): [form, alert] fix not pass e2e case (#1172)
This commit is contained in:
parent
d59fc4d47e
commit
98bbf4ca3b
|
@ -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')
|
||||
|
||||
// 自定义关闭图标
|
||||
|
|
|
@ -142,7 +142,7 @@ export default {
|
|||
'zh-CN': '指定跳转的目标页面地址',
|
||||
'en-US': 'Specify the URL of the target page.'
|
||||
},
|
||||
'demoId': 'target'
|
||||
'demoId': 'link'
|
||||
},
|
||||
{
|
||||
'name': 'is-dot',
|
||||
|
|
|
@ -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()
|
||||
|
|
Loading…
Reference in New Issue