Repository navigation
[2.0] fix(playwright): stop search-settings slider drags from landing on stale coordinates - #37639
Conversation
… on stale coordinates setSliderValue read the track's bounding box before hover() scrolled the slider into view, then dragged with raw mouse events and never checked the result. In the Collate AUT shell the slider starts below the fold and its collapse panel is still expanding, so the drag missed, the weight stayed at 1, Save stayed disabled, and "Preview config reflects reverted n-gram weight after save" timed out on every retry. Re-measure after hover() on every attempt, drag along the handle's own row, key-step the remaining gap (step 0.1), and assert aria-valuenow inside expect().toPass so a lost drag is retried instead of silently ignored.
❌ PR checklist incompleteThis PR cannot be merged until the following are addressed on its linked issue:
The fields live on the linked issue in the Shipping project (open the issue → right sidebar → Projects). After you set them, re-run this check (or push a commit) — issue/project changes do not re-trigger it automatically. Maintainers can bypass this check by adding the |
Code Review ✅ Approved 🟡 Medium riskChanging the Playwright slider helper to retry drags and adjust with arrow keys could produce incorrect settings or alter test outcomes. Test-only fix to the VerificationRules No rules evaluated Functional validation Not enabledAuto-approval Not enabledFor more verification details, comment OptionsDisplay: compact → Showing compact verification results. Comment with these commands to change the behavior for this request:
Was this helpful? React with 👍 / 👎 | Powered by Gitar — free for open source |
Describe your changes:
No issue: test-only fix for the nightly AUT failure in openmetadata-nightly run 43151588373 (AUT kind / postgresql 1.12.14 ➡ 2.0).
SearchSettings.spec.ts › Preview config reflects reverted n-gram weight after savehas timed out on all 3 attempts in most 2.0 AUT runs since Nov 8. Of 13 runs, 7 failed and 4 passed only on retry.Root cause (from the trace):
setSliderValueread the slider track's bounding box beforehover()scrolled the slider into view. In the Collate shell, the track was measured aty=862(the viewport is 720px tall), and the hover then scrolled the handle toy=541. The helper dragged with rawmouse.down/move/upon those stale coordinates while the n-gram collapse panel was still expanding, and it never checked the result. The drag was lost and the weight stayed at1. Save stayed disabled, and the test hit the 60s timeout onsave-btn.click().Fix:
setSliderValuenow:hover()on every attempt, and drags along the handle's own row;0.1) for any remaining gap, so values like25.6or the reverted1land exactly;aria-valuenow, all insideexpect().toPass({ timeout: 15_000 }), so a lost drag is retried instead of being ignored.This is 2.0 only.
mainreplaced the antd slider and this helper in #35253.Type of change:
High-level design:
N/A — small change (one Playwright helper).
Tests:
Use cases covered
Unit tests
Backend integration tests
Ingestion integration tests
Playwright (UI) tests
playwright/utils/searchSettingUtils.ts(used bySearchSettings.spec.tsandCustomProperties.spec.ts).Manual testing performed
Run locally against an OpenMetadata 2.0.7 stack (no search-settings UI or config drift between
2.0.7-releaseand2.0):Emulation.setCPUThrottlingRate), viewport heights 720/420/360. The old helper failed 11/11 (lands on5.1instead of5). The new helper passed 11/11.SearchSettings.spec.ts:438(the failing test),--repeat-each=5: 5/5 passed.SearchSettings.spec.ts(Basic + chromium projects): 10/10 passed.CustomProperties.spec.ts"configure search for Dashboard/Pipeline" (other helper callers): 2/2 passed.Playwright run (terminal): the failing test 5/5 with
--repeat-each=5, then the fullSearchSettings.spec.ts10/10, at commit629c3eb3640against OpenMetadata 2.0.7.UI screen recording / screenshots:
Not applicable.
Checklist:
🤖 Generated with Claude Code