Skip to content

feat(plugin-e2e): fetch e2e-selectors from Grafana at runtime - #2819

Draft
sunker wants to merge 1 commit into
mainfrom
runtime-e2e-selectors
Draft

feat(plugin-e2e): fetch e2e-selectors from Grafana at runtime#2819
sunker wants to merge 1 commit into
mainfrom
runtime-e2e-selectors

Conversation

@sunker

@sunker sunker commented Aug 5, 2026

Copy link
Copy Markdown
Contributor

What this PR does / why we need it:

Adds a runtime path to the selectors fixture: it fetches the data-only /public/e2e-selectors.json from the Grafana under test and reconstructs the template descriptors into selectors locally (no eval), falling back to the bundled @grafana/e2e-selectors when the file isn't served. No opt-in flag - it's used automatically when present, so tests stay in sync with the Grafana under test without the nightly npm dist-tag.

Pairs with the grafana/grafana side that serves the file.

Which issue(s) this PR fixes:

Fixes #

Special notes for your reviewer:

Reconstruction only substitutes {0}/{1} placeholders, it never executes fetched content. Unit tests cover reconstruct and the fixture (quiet 404 fallback, loud fallback on failures, per-version cache).

The selectors fixture fetches the data-only /public/e2e-selectors.json from the Grafana under test, reconstructs the template descriptors into functions locally (no eval) and resolves them. When the instance does not serve the file it falls back to the bundled @grafana/e2e-selectors (quiet on 404, warns on other failures).
@grafana-catalog-project-bot grafana-catalog-project-bot Bot moved this from 📬 Triage to 🧑‍💻 In development in Grafana Catalog Team Aug 5, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

Status: 🧑‍💻 In development

Development

Successfully merging this pull request may close these issues.

1 participant