diff --git a/examples/sites/demos/pc/app/drop-times/basic-usage.spec.ts b/examples/sites/demos/pc/app/drop-times/basic-usage.spec.ts index ecd892467..2a40e8d90 100644 --- a/examples/sites/demos/pc/app/drop-times/basic-usage.spec.ts +++ b/examples/sites/demos/pc/app/drop-times/basic-usage.spec.ts @@ -4,7 +4,7 @@ test('基本用法', async ({ page }) => { page.on('pageerror', (exception) => expect(exception).toBeNull()) await page.goto('drop-times#basic-usage') - const droptimes = page.getByPlaceholder('请选择') + const droptimes = page.locator('#basic-usage').getByRole('textbox', { name: '请选择' }) const option = page.getByRole('listitem').filter({ hasText: '01:00' }) await droptimes.click() diff --git a/examples/sites/demos/pc/app/drop-times/size.spec.ts b/examples/sites/demos/pc/app/drop-times/size.spec.ts index 8f7630e7c..bef3a4efc 100644 --- a/examples/sites/demos/pc/app/drop-times/size.spec.ts +++ b/examples/sites/demos/pc/app/drop-times/size.spec.ts @@ -4,6 +4,10 @@ test('设置组件尺寸', async ({ page }) => { page.on('pageerror', (exception) => expect(exception).toBeNull()) await page.goto('drop-times#size') - const droptimes = page.locator('.tiny-select') + const droptimes = page.locator('.drop-time-demo-size > div:nth-child(1)') await expect(droptimes).toHaveClass(/tiny-select--medium/) + const droptimesSmall = page.locator('.drop-time-demo-size > div:nth-child(2)') + await expect(droptimesSmall).toHaveClass(/tiny-select--small/) + const droptimesMini = page.locator('.drop-time-demo-size > div:nth-child(3)') + await expect(droptimesMini).toHaveClass(/tiny-select--mini/) }) diff --git a/examples/sites/demos/pc/app/drop-times/start-end-step.spec.ts b/examples/sites/demos/pc/app/drop-times/start-end-step.spec.ts index 42a526b6f..618b8c034 100644 --- a/examples/sites/demos/pc/app/drop-times/start-end-step.spec.ts +++ b/examples/sites/demos/pc/app/drop-times/start-end-step.spec.ts @@ -4,7 +4,7 @@ test('步长与时间区间', async ({ page }) => { page.on('pageerror', (exception) => expect(exception).toBeNull()) await page.goto('drop-times#start-end-step') - const droptimes = page.getByPlaceholder('请选择') + const droptimes = page.locator('#start-end-step').getByRole('textbox', { name: '请选择' }) const option1 = page.locator('.tiny-select-dropdown__item').first() const option2 = page.locator('.tiny-select-dropdown__item').nth(1) const option3 = page.locator('.tiny-select-dropdown__item').last()