Skip to content

Commit 3dcabd8

Browse files
authored
fix:修复e2e测试用例 (#3429)
1 parent f9d88bc commit 3dcabd8

File tree

2 files changed

+4
-10
lines changed

2 files changed

+4
-10
lines changed

examples/sites/demos/pc/app/date-picker/format.spec.ts

+1-1
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@ test('[DatePicker] 测试日期格式化', async ({ page }) => {
1111

1212
// time-format: 时间输入框中显示的格式
1313
await page.locator('.tiny-date-editor input').nth(1).click()
14-
await page.getByRole('row', { name: '21 22 23 24 25 26 27' }).getByText('24').click()
14+
await page.getByRole('cell', { name: '24' }).locator('span').click();
1515
await page.getByRole('button', { name: '确定' }).click()
1616
await expect(page.locator('.tiny-date-editor input').nth(1)).toHaveValue('2023 年 05 月 24 日 08 时 00 分 00 秒')
1717

examples/sites/demos/pc/app/time-picker/format.spec.ts

+3-9
Original file line numberDiff line numberDiff line change
@@ -40,15 +40,9 @@ test('时间格式化', async ({ page }) => {
4040
await expect(page.getByRole('textbox', { name: '19:30:00' })).toBeVisible()
4141

4242
// picker-options.format: 下拉框中显示的格式
43-
const timePickerHour = page
44-
.locator(
45-
'div:nth-child(14) > .tiny-time-panel__content > .tiny-time-spinner > div > .tiny-scrollbar__wrap > .tiny-scrollbar__view > li:nth-child(19)'
46-
)
47-
.first()
48-
const timePickerMinute = page.locator(
49-
'div:nth-child(14) > .tiny-time-panel__content > .tiny-time-spinner > div:nth-child(2) > .tiny-scrollbar__wrap > .tiny-scrollbar__view > li:nth-child(41)'
50-
)
51-
const timePickerSecond = page.locator('.of-hidden > div:nth-child(12) .tiny-scrollbar').nth(2)
43+
const timePickerHour = page.getByRole('list').first()
44+
const timePickerMinute = page.getByRole('list').nth(1)
45+
const timePickerSecond = page.getByRole('list').nth(2)
5246
await page.getByRole('textbox', { name: '18:40:00' }).click()
5347
await page.waitForTimeout(200)
5448
await expect(timePickerHour).toBeVisible()

0 commit comments

Comments
 (0)