Chore: Update slider selector#2604
Conversation
There was a problem hiding this comment.
Pull request overview
Updates the PanelEditOptionsGroup slider input locator logic to match Grafana UI changes across versions, ensuring plugin-e2e can continue to find and interact with slider-backed option inputs.
Changes:
- Treat Grafana
>= 13.0.0slider inputs as text inputs. - Keep Grafana
>= 9.1.0and< 13.0.0slider inputs mapped to number inputs (spinbuttons). - Use the shared
getTextInput()helper for the fallback path.
| if (gte(this.ctx.grafanaVersion, '13.0.0')) { | ||
| return this.getTextInput(label); | ||
| } | ||
| if (gte(this.ctx.grafanaVersion, '9.1.0')) { |
There was a problem hiding this comment.
The >=13.0.0 branch currently returns the same locator as the default fallback (text input). Consider simplifying this to a single version range check (e.g., only special-case the versions where the slider is a spinbutton) and/or add a brief note about the Grafana UI change that requires treating v13 differently to avoid confusion later.
| if (gte(this.ctx.grafanaVersion, '13.0.0')) { | |
| return this.getTextInput(label); | |
| } | |
| if (gte(this.ctx.grafanaVersion, '9.1.0')) { | |
| if (gte(this.ctx.grafanaVersion, '9.1.0') && !gte(this.ctx.grafanaVersion, '13.0.0')) { |
| return this.getNumberInput(label); | ||
| } | ||
| return this.getFieldLocator(label).getByRole('textbox'); | ||
| return this.getTextInput(label); |
There was a problem hiding this comment.
this seems scary to change 🤔
There was a problem hiding this comment.
@hugohaggmark this.getTextInput(label) is exactly the same as this.getFieldLocator(label).getByRole('textbox'), i was just trying to simplify a bit 😅 i don't care about this bit at all so i can remove if needed
There was a problem hiding this comment.
ok, thanks for explaination
There was a problem hiding this comment.
there are tests broken, I'll wait a bit with approval until you looked at those
There was a problem hiding this comment.
@hugohaggmark i don't believe these are related to this PR sadly 😭
it also doesn't seem to be pushing canaries either
Playwright test results
Troubleshooting404 when clicking on
|
What this PR does / why we need it:
SliderselectorWhich issue(s) this PR fixes:
Fixes #
Special notes for your reviewer:
📦 Published PR as canary version:
Canary Versions✨ Test out this PR locally via:
npm install website@5.5.4-canary.2604.25389071972.0 npm install @grafana/create-plugin@7.3.1-canary.2604.25389071972.0 npm install @grafana/plugin-e2e@3.7.1-canary.2604.25389071972.0 # or yarn add website@5.5.4-canary.2604.25389071972.0 yarn add @grafana/create-plugin@7.3.1-canary.2604.25389071972.0 yarn add @grafana/plugin-e2e@3.7.1-canary.2604.25389071972.0