test(floatbar): fix running failed E2E cases (#1443)

This commit is contained in:
黄怡林 2024-03-01 16:31:55 +08:00 committed by GitHub
parent db3ccaafd0
commit 0b4ef3c55f
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
4 changed files with 4 additions and 4 deletions

View File

@ -4,7 +4,7 @@ test('基本用法', async ({ page }) => {
page.on('pageerror', (exception) => expect(exception).toBeNull())
await page.goto('floatbar#base')
const floatbar = page.locator('#preview .tiny-float-bar')
const floatbar = page.locator('.tiny-float-bar')
await expect(floatbar).toBeVisible()
await expect(floatbar).toHaveCSS('right', '10px')
await page.getByRole('listitem').filter({ hasText: 'Default-A' }).click()

View File

@ -4,7 +4,7 @@ test('自定义内容', async ({ page }) => {
page.on('pageerror', (exception) => expect(exception).toBeNull())
await page.goto('floatbar#custom-floatbar-item')
const floatbar = page.locator('#preview .tiny-float-bar')
const floatbar = page.locator('.tiny-float-bar')
const item1 = floatbar.getByRole('listitem').first()
const item2 = floatbar.getByRole('listitem').nth(1)
const item3 = floatbar.getByRole('listitem').nth(2)

View File

@ -4,7 +4,7 @@ test('自定义样式', async ({ page }) => {
page.on('pageerror', (exception) => expect(exception).toBeNull())
await page.goto('floatbar#custom-style')
const floatbar = page.locator('#preview .tiny-float-bar')
const floatbar = page.locator('.tiny-float-bar')
const item = page.getByRole('listitem').filter({ hasText: 'Default-A' })
await expect(floatbar).toHaveClass(/custom/)
await expect(floatbar).toHaveCSS('background-color', 'rgb(222, 184, 135)')

View File

@ -4,7 +4,7 @@ test('操作浮动块内容', async ({ page }) => {
page.on('pageerror', (exception) => expect(exception).toBeNull())
await page.goto('floatbar#operation-floatbar-item')
const floatbar = page.locator('#preview .tiny-float-bar')
const floatbar = page.locator('.tiny-float-bar')
const item = floatbar.getByRole('listitem').filter({ hasText: 'custom-Add' })
await page.getByRole('button', { name: '增加一项' }).click()
await expect(item).toBeVisible()