Skip to content

Commit bbdcfe5

Browse files
authored
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
1 parent 65bc127 commit bbdcfe5

File tree

2 files changed

+14
-4
lines changed

2 files changed

+14
-4
lines changed

examples/sites/demos/pc/app/grid/large-data/full-data-loading.spec.js

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -7,12 +7,15 @@ test('全量加载', async ({ page }) => {
77
width: 1400,
88
height: 2500
99
})
10-
await page.locator('.tiny-grid__body').hover()
10+
await page.waitForTimeout(1000)
11+
await page.locator('.tiny-grid__body-wrapper').hover()
12+
await page.locator('.tiny-grid__body-wrapper').click()
1113
// 先滚动 1000px
1214
await page.mouse.wheel(0, 1000)
1315
await expect(page.getByRole('cell', { name: '28' })).toBeVisible()
1416
await page.waitForTimeout(500)
15-
await page.locator('.tiny-grid__body').hover()
17+
await page.locator('.tiny-grid__body-wrapper').hover()
18+
await page.locator('.tiny-grid__body-wrapper').click()
1619
// 先滚动 4000px
1720
await page.mouse.wheel(0, 5000)
1821
await page.waitForTimeout(200)

examples/sites/demos/pc/app/grid/large-data/virtual-rolling.spec.js

Lines changed: 9 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -3,12 +3,19 @@ import { test, expect } from '@playwright/test'
33
test('虚拟滚动', async ({ page }) => {
44
page.on('pageerror', (exception) => expect(exception).toBeNull())
55
await page.goto('grid-large-data#large-data-virtual-rolling')
6-
await page.locator('.tiny-grid__body').hover()
6+
await page.setViewportSize({
7+
width: 1400,
8+
height: 2500
9+
})
10+
await page.waitForTimeout(1000)
11+
await page.locator('.tiny-grid__body-wrapper').hover()
12+
await page.locator('.tiny-grid__body-wrapper').click()
713
// 先滚动 1000px
814
await page.mouse.wheel(0, 1000)
915
await expect(page.getByRole('cell', { name: '24' })).toBeVisible()
1016
await page.waitForTimeout(500)
11-
await page.locator('.tiny-grid__body').hover()
17+
await page.locator('.tiny-grid__body-wrapper').hover()
18+
await page.locator('.tiny-grid__body-wrapper').click()
1219
// 先滚动 4000px
1320
await page.mouse.wheel(0, 5000)
1421
await expect(page.getByRole('cell', { name: '124' })).toBeVisible()

0 commit comments

Comments
 (0)