Skip to content
Open
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
Original file line number Diff line number Diff line change
Expand Up @@ -8,16 +8,11 @@ test('全量加载', async ({ page }) => {
height: 2500
})
await page.waitForTimeout(1000)
await page.locator('.tiny-grid__body-wrapper').hover()
await page.locator('.tiny-grid__body-wrapper').click()
// 先滚动 1000px
await page.mouse.wheel(0, 1000)
const scrollContainer = page.locator('.tiny-grid__body-wrapper')
await scrollContainer.evaluate((el) => (el.scrollTop = 1000))
await expect(page.getByRole('cell', { name: '28' })).toBeVisible()
await page.waitForTimeout(500)
await page.locator('.tiny-grid__body-wrapper').hover()
await page.locator('.tiny-grid__body-wrapper').click()
// 先滚动 4000px
await page.mouse.wheel(0, 5000)
await scrollContainer.evaluate((el) => (el.scrollTop = 6000))
await page.waitForTimeout(200)
await expect(page.getByRole('cell', { name: '129' })).toBeVisible()
})
Original file line number Diff line number Diff line change
Expand Up @@ -10,13 +10,13 @@ test('虚拟滚动', async ({ page }) => {
await page.waitForTimeout(1000)
await page.locator('.tiny-grid__body-wrapper').hover()
await page.locator('.tiny-grid__body-wrapper').click()
// 先滚动 1000px
await page.mouse.wheel(0, 1000)
const scrollContainer = page.locator('.tiny-grid__body-wrapper')
await scrollContainer.evaluate((el) => (el.scrollTop = 1000))
await expect(page.getByRole('cell', { name: '24' })).toBeVisible()
await page.waitForTimeout(500)
await page.locator('.tiny-grid__body-wrapper').hover()
await page.locator('.tiny-grid__body-wrapper').click()
// 先滚动 4000px
await page.mouse.wheel(0, 5000)

await scrollContainer.evaluate((el) => (el.scrollTop = 6000))
await expect(page.getByRole('cell', { name: '124' })).toBeVisible()
})
Loading