From bbdcfe55e47f96f5a0f2176e9c50b5f7d5a05f84 Mon Sep 17 00:00:00 2001 From: gimmyhehe <975402925@qq.com> Date: Tue, 15 Jul 2025 10:40:15 +0800 Subject: [PATCH] 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 --- .../pc/app/grid/large-data/full-data-loading.spec.js | 7 +++++-- .../pc/app/grid/large-data/virtual-rolling.spec.js | 11 +++++++++-- 2 files changed, 14 insertions(+), 4 deletions(-) diff --git a/examples/sites/demos/pc/app/grid/large-data/full-data-loading.spec.js b/examples/sites/demos/pc/app/grid/large-data/full-data-loading.spec.js index 5cb20b20a..4ce2f96a9 100644 --- a/examples/sites/demos/pc/app/grid/large-data/full-data-loading.spec.js +++ b/examples/sites/demos/pc/app/grid/large-data/full-data-loading.spec.js @@ -7,12 +7,15 @@ test('全量加载', async ({ page }) => { width: 1400, 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 await page.mouse.wheel(0, 1000) await expect(page.getByRole('cell', { name: '28' })).toBeVisible() 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 await page.mouse.wheel(0, 5000) await page.waitForTimeout(200) diff --git a/examples/sites/demos/pc/app/grid/large-data/virtual-rolling.spec.js b/examples/sites/demos/pc/app/grid/large-data/virtual-rolling.spec.js index e5d93db8b..931f9c0fd 100644 --- a/examples/sites/demos/pc/app/grid/large-data/virtual-rolling.spec.js +++ b/examples/sites/demos/pc/app/grid/large-data/virtual-rolling.spec.js @@ -3,12 +3,19 @@ import { test, expect } from '@playwright/test' test('虚拟滚动', async ({ page }) => { page.on('pageerror', (exception) => expect(exception).toBeNull()) 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 await page.mouse.wheel(0, 1000) await expect(page.getByRole('cell', { name: '24' })).toBeVisible() 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 await page.mouse.wheel(0, 5000) await expect(page.getByRole('cell', { name: '124' })).toBeVisible()