diff --git a/examples/sites/demos/pc/app/time-picker/clearable.spec.ts b/examples/sites/demos/pc/app/time-picker/clearable.spec.ts index 8fe0e5085..922f9fcef 100644 --- a/examples/sites/demos/pc/app/time-picker/clearable.spec.ts +++ b/examples/sites/demos/pc/app/time-picker/clearable.spec.ts @@ -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('') }) diff --git a/examples/sites/demos/pc/app/time-picker/format.spec.ts b/examples/sites/demos/pc/app/time-picker/format.spec.ts index b85017330..795b4b263 100644 --- a/examples/sites/demos/pc/app/time-picker/format.spec.ts +++ b/examples/sites/demos/pc/app/time-picker/format.spec.ts @@ -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()