test(drop-tmies): [drop-times] amend drop-times e2e test (#1184)

This commit is contained in:
李天佑 2023-12-19 17:04:02 -08:00 committed by GitHub
parent 491a5489f5
commit 6ec2a3cc4f
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
3 changed files with 7 additions and 3 deletions

View File

@ -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()

View File

@ -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/)
})

View File

@ -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()