test(grid): fix visual scroll e2e test case error (#3585)

* test(grid): fix visual scroll e2e test case

* test(grid): fix visual scroll e2e test case
This commit is contained in:
gimmyhehe 2025-07-15 10:40:15 +08:00 committed by GitHub
parent 65bc127da8
commit bbdcfe55e4
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
2 changed files with 14 additions and 4 deletions

View File

@ -7,12 +7,15 @@ test('全量加载', async ({ page }) => {
width: 1400, width: 1400,
height: 2500 height: 2500
}) })
await page.locator('.tiny-grid__body').hover() await page.waitForTimeout(1000)
await page.locator('.tiny-grid__body-wrapper').hover()
await page.locator('.tiny-grid__body-wrapper').click()
// 先滚动 1000px // 先滚动 1000px
await page.mouse.wheel(0, 1000) await page.mouse.wheel(0, 1000)
await expect(page.getByRole('cell', { name: '28' })).toBeVisible() await expect(page.getByRole('cell', { name: '28' })).toBeVisible()
await page.waitForTimeout(500) await page.waitForTimeout(500)
await page.locator('.tiny-grid__body').hover() await page.locator('.tiny-grid__body-wrapper').hover()
await page.locator('.tiny-grid__body-wrapper').click()
// 先滚动 4000px // 先滚动 4000px
await page.mouse.wheel(0, 5000) await page.mouse.wheel(0, 5000)
await page.waitForTimeout(200) await page.waitForTimeout(200)

View File

@ -3,12 +3,19 @@ import { test, expect } from '@playwright/test'
test('虚拟滚动', async ({ page }) => { test('虚拟滚动', async ({ page }) => {
page.on('pageerror', (exception) => expect(exception).toBeNull()) page.on('pageerror', (exception) => expect(exception).toBeNull())
await page.goto('grid-large-data#large-data-virtual-rolling') await page.goto('grid-large-data#large-data-virtual-rolling')
await page.locator('.tiny-grid__body').hover() await page.setViewportSize({
width: 1400,
height: 2500
})
await page.waitForTimeout(1000)
await page.locator('.tiny-grid__body-wrapper').hover()
await page.locator('.tiny-grid__body-wrapper').click()
// 先滚动 1000px // 先滚动 1000px
await page.mouse.wheel(0, 1000) await page.mouse.wheel(0, 1000)
await expect(page.getByRole('cell', { name: '24' })).toBeVisible() await expect(page.getByRole('cell', { name: '24' })).toBeVisible()
await page.waitForTimeout(500) await page.waitForTimeout(500)
await page.locator('.tiny-grid__body').hover() await page.locator('.tiny-grid__body-wrapper').hover()
await page.locator('.tiny-grid__body-wrapper').click()
// 先滚动 4000px // 先滚动 4000px
await page.mouse.wheel(0, 5000) await page.mouse.wheel(0, 5000)
await expect(page.getByRole('cell', { name: '124' })).toBeVisible() await expect(page.getByRole('cell', { name: '124' })).toBeVisible()