Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix:[modal,slider-bar] update e2e test #1455

Merged
merged 2 commits into from
Mar 1, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions examples/sites/demos/pc/app/modal/min-width-height.spec.ts
Original file line number Diff line number Diff line change
@@ -1,10 +1,10 @@
import { test, expect } from '@playwright/test'

test('调整窗口后显示的最小宽度', async ({ page }) => {
test('调整窗口后显示的最小宽高度', async ({ page }) => {
page.on('pageerror', (exception) => expect(exception).toBeNull())
await page.goto('modal#min-width-height')

await page.getByRole('button', { name: '最小宽高度' }).click()
await page.getByRole('button', { name: /最小宽高度/ }).click()
const modal = page.locator('.tiny-modal.active .tiny-modal__box')
// 获取弹窗位置
const { x, y } = await modal.boundingBox()
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,6 @@ test('控制显示头部及底部', async ({ page }) => {
await page.goto('modal#show-header-footer')

const modal = page.locator('.tiny-modal.active')
await page.getByRole('button', { name: '控制显示头部及底部' }).click()
await page.getByRole('button', { name: /控制显示头部及底部/ }).click()
await expect(modal.locator('.tiny-modal__header')).not.toBeVisible()
})
4 changes: 2 additions & 2 deletions examples/sites/demos/pc/app/slide-bar/basic-usage.spec.ts
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ test('基础用法', async ({ page }) => {
await expect(slideBarList.locator('li').first()).toHaveCSS('border-color', 'rgba(153, 153, 153, 0.7)')
await preview.locator('.icon-chevron-right').click()
// 单个滚动块的宽度为 width + marginLeft,固定值为196px
await expect(slideBarList).toHaveCSS('left', '-358px')
await expect(slideBarList).toHaveCSS('left', '-360px')
await preview.locator('.icon-chevron-left').click()
await expect(slideBarList).toHaveCSS('left', '-179px')
await expect(slideBarList).toHaveCSS('left', '-180px')
})
6 changes: 3 additions & 3 deletions examples/sites/demos/pc/app/slide-bar/wheel-blocks.spec.ts
Original file line number Diff line number Diff line change
Expand Up @@ -9,9 +9,9 @@ test('每次滚动块数', async ({ page }) => {
await slideBarList.first().click()
await page.locator('.icon-chevron-right').click()
// 单个滚动块的宽度固定为196px,所以应为 196px * 2
await expect(slideBarList).toHaveCSS('left', '-358px')
await expect(slideBarList).toHaveCSS('left', '-360px')
await page.locator('.icon-chevron-right').click()
await expect(slideBarList).toHaveCSS('left', '-716px')
await expect(slideBarList).toHaveCSS('left', '-720px')
await page.locator('.icon-chevron-left').click()
await expect(slideBarList).toHaveCSS('left', '-358px')
await expect(slideBarList).toHaveCSS('left', '-360px')
})
Loading