Plugin E2E: Select MultiSelect options sequentially#2626
Conversation
There was a problem hiding this comment.
Pull request overview
This PR reduces flakiness in @grafana/plugin-e2e component interactions by making MultiSelect.selectOptions select values sequentially instead of concurrently, avoiding Playwright races against the same open menu element.
Changes:
- Replaced concurrent
Promise.all(values.map(...))selection with a sequentialfor...ofloop. - Preserved the API contract by still returning the selected option text values as a
string[].
d329227 to
2de5a4a
Compare
…rently Replace Promise.all with a for...of loop in MultiSelect.selectOptions to avoid racing concurrent Playwright clicks on the same open menu. Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
2de5a4a to
b5756ca
Compare
Playwright test results
Troubleshooting404 when clicking on
|
|
🚀 PR was released in |
What this PR does / why we need it:
Replaces
Promise.all(values.map(...))with a sequentialfor...ofloop inMultiSelect.selectOptions. Playwright interactions on the same UI element are not safe to run concurrently — racing clicks against the same open menu can cause flaky tests because the DOM mutates after each selection. The sequential approach ensures each option is fully selected before the next begins.Which issue(s) this PR fixes:
Fixes a potential source of flaky tests flagged in #2621 (comment)
Special notes for your reviewer:
The behavior is unchanged — same options are selected in the same order, just awaited one at a time instead of concurrently.
📦 Published PR as canary version:
Canary Versions✨ Test out this PR locally via:
npm install @grafana/plugin-e2e@3.7.2-canary.2626.25732312320.0 npm install @grafana/sign-plugin@3.2.2-canary.2626.25732312320.0 # or yarn add @grafana/plugin-e2e@3.7.2-canary.2626.25732312320.0 yarn add @grafana/sign-plugin@3.2.2-canary.2626.25732312320.0