fix:修复测试用例 (#3272)

This commit is contained in:
liukun 2025-04-08 19:30:32 +08:00 committed by GitHub
parent 682cf7aa94
commit 5fb18f80e2
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
2 changed files with 3 additions and 8 deletions

View File

@ -7,7 +7,7 @@ test('清除按钮', async ({ page }) => {
const timePickerDefaultClearIcon = page.getByRole('textbox', { name: '18:40:00' }).first()
const timePickerHideClearIcon = page.getByRole('textbox', { name: '18:40:00' }).nth(1)
const timePickerCustomClearIcon = page.getByRole('textbox', { name: '18:40:00' }).nth(2)
const closeIcon = page.locator('.tiny-date-editor--time svg.baseClearicon')
const closeIcon = page.locator('.tiny-date-editor--time svg.baseClearicon').first()
// 默认显示清除按钮
await timePickerDefaultClearIcon.hover()
@ -23,6 +23,6 @@ test('清除按钮', async ({ page }) => {
// 测试清除功能
await timePickerDefaultClearIcon.hover()
await closeIcon.first().click()
await closeIcon.click()
await expect(page.getByRole('textbox').nth(1)).toHaveValue('')
})

View File

@ -34,12 +34,7 @@ test('时间格式化', async ({ page }) => {
// value-format: 选中值的格式
await page.getByRole('textbox', { name: '18:30:00' }).click()
await page.waitForTimeout(100)
await page
.locator(
'div:nth-child(13) > .tiny-time-panel__content > .tiny-time-spinner > div > .tiny-scrollbar__wrap > .tiny-scrollbar__view > li:nth-child(20)'
)
.first()
.click()
await page.getByText('19').nth(11).click()
await page.getByRole('button', { name: '确定' }).click()
await page.waitForTimeout(100)
await expect(page.getByRole('textbox', { name: '19:30:00' })).toBeVisible()