test(grid): optimize scrolling method in full-data-loading and virtual-rolling specs#4162
test(grid): optimize scrolling method in full-data-loading and virtual-rolling specs#4162
Conversation
WalkthroughTwo Playwright test files were updated to replace mouse wheel-based scrolling with direct programmatic scrolling. The changes introduce a Changes
Estimated code review effort🎯 2 (Simple) | ⏱️ ~12 minutes Poem
🚥 Pre-merge checks | ✅ 3✅ Passed checks (3 passed)
✏️ Tip: You can configure your own custom pre-merge checks in the settings. ✨ Finishing Touches📝 Generate docstrings
🧪 Generate unit tests (beta)
Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. Comment |
There was a problem hiding this comment.
🧹 Nitpick comments (2)
examples/sites/demos/pc/app/grid/large-data/virtual-rolling.spec.js (2)
13-14: Remove now-redundant hover/click steps around programmatic scroll.Since scrolling is done via
scrollTop, the extra focus interactions are unnecessary and can introduce avoidable flakiness.♻️ Proposed cleanup
- await page.locator('.tiny-grid__body-wrapper').hover() - await page.locator('.tiny-grid__body-wrapper').click() 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() await scrollContainer.evaluate((el) => (el.scrollTop = 6000))Also applies to: 20-20
🤖 Prompt for AI Agents
Verify each finding against the current code and only fix it if needed. In `@examples/sites/demos/pc/app/grid/large-data/virtual-rolling.spec.js` around lines 13 - 14, The test currently performs unnecessary hover/click/focus interactions before or after programmatic scrolling using scrollContainer (page.locator('.tiny-grid__body-wrapper')) and its evaluate((el) => (el.scrollTop = 1000)) call; remove those redundant focus/hover/click steps so the test only performs the programmatic scroll via scrollContainer.evaluate and then asserts expected state, reducing flakiness (search for any adjacent .hover(), .click(), or .focus() calls around the scrollContainer.evaluate invocation and delete them).
13-14: Please verify this spec behavior in both Vue 2 and Vue 3 runs.This is a view-interaction change in E2E behavior, so it should be confirmed in both runtime variants before merge. Based on learnings: Verify view changes work correctly in both Vue 2 and Vue 3 environments before submitting PR.
Also applies to: 20-20
🤖 Prompt for AI Agents
Verify each finding against the current code and only fix it if needed. In `@examples/sites/demos/pc/app/grid/large-data/virtual-rolling.spec.js` around lines 13 - 14, This change alters view scrolling in virtual-rolling.spec.js (the scrollContainer locator and the await scrollContainer.evaluate((el) => (el.scrollTop = 1000)) line) and needs verification in both Vue 2 and Vue 3; run the E2E spec in both runtime variants (Vue 2 and Vue 3) against the grid/large-data/virtual-rolling.spec.js scenario, confirm the scroll results and subsequent assertions behave identically, and if any differences appear either adjust the interaction (e.g., use page.mouse/wheel or await scrollContainer.evaluateHandle + ensure layout flush) or add runtime-specific guards to the spec so it passes reliably in both Vue 2 and Vue 3 environments.
🤖 Prompt for all review comments with AI agents
Verify each finding against the current code and only fix it if needed.
Nitpick comments:
In `@examples/sites/demos/pc/app/grid/large-data/virtual-rolling.spec.js`:
- Around line 13-14: The test currently performs unnecessary hover/click/focus
interactions before or after programmatic scrolling using scrollContainer
(page.locator('.tiny-grid__body-wrapper')) and its evaluate((el) =>
(el.scrollTop = 1000)) call; remove those redundant focus/hover/click steps so
the test only performs the programmatic scroll via scrollContainer.evaluate and
then asserts expected state, reducing flakiness (search for any adjacent
.hover(), .click(), or .focus() calls around the scrollContainer.evaluate
invocation and delete them).
- Around line 13-14: This change alters view scrolling in
virtual-rolling.spec.js (the scrollContainer locator and the await
scrollContainer.evaluate((el) => (el.scrollTop = 1000)) line) and needs
verification in both Vue 2 and Vue 3; run the E2E spec in both runtime variants
(Vue 2 and Vue 3) against the grid/large-data/virtual-rolling.spec.js scenario,
confirm the scroll results and subsequent assertions behave identically, and if
any differences appear either adjust the interaction (e.g., use page.mouse/wheel
or await scrollContainer.evaluateHandle + ensure layout flush) or add
runtime-specific guards to the spec so it passes reliably in both Vue 2 and Vue
3 environments.
ℹ️ Review info
⚙️ Run configuration
Configuration used: Repository UI
Review profile: CHILL
Plan: Pro
Run ID: 9cdeca23-0e29-4090-95bf-882daa483701
📒 Files selected for processing (2)
examples/sites/demos/pc/app/grid/large-data/full-data-loading.spec.jsexamples/sites/demos/pc/app/grid/large-data/virtual-rolling.spec.js
PR
PR Checklist
Please check if your PR fulfills the following requirements:
PR Type
What kind of change does this PR introduce?
What is the current behavior?
Issue Number: N/A
What is the new behavior?
Does this PR introduce a breaking change?
Other information
Summary by CodeRabbit