

Also from Kynth Studios


Also from Kynth Studios


Also from Kynth Studios
1# plugin-e2e API Tests - Agent Instructions23## Purpose45These tests verify that `@grafana/plugin-e2e` fixtures, page models and matchers remain compatible with the latest Grafana UI. They are **not** plugin tests - they are forward-compatibility canaries. If a Grafana UI change breaks a selector or interaction pattern that `@grafana/plugin-e2e` depends on, these tests catch it before it ships.67## What to do when a test breaks89A failing test here means a Grafana UI change broke the `@grafana/plugin-e2e` testing API. This affects every plugin that uses `@grafana/plugin-e2e` for end-to-end testing. **Do not delete or skip the test** - that defeats its purpose. Instead, follow these steps in order:1011### 1. Reuse the existing e2e selector in your new UI1213This is the preferred fix. The `@grafana/plugin-e2e` package locates UI elements using selectors defined in `packages/grafana-e2e-selectors/src/selectors/` (see [pages.ts](../../../packages/grafana-e2e-selectors/src/selectors/pages.ts) and [components.ts](../../../packages/grafana-e2e-selectors/src/selectors/components.ts)). If you changed or replaced a UI element, apply the same `data-testid` or `aria-label` selector that the old element used. This requires no changes outside the Grafana repo.1415For example, if you rebuilt the "Add panel" button, make sure the new button still uses the same selector value that the old one did. The test will pass without any other changes.1617### 2. Add a new version to the selector1819If the element still exists but its selector value legitimately needs to change (e.g. the `data-testid` was renamed for good reason), add a new versioned entry to the selector object. See [packages/grafana-e2e-selectors/src/selectors/README.md](../../../packages/grafana-e2e-selectors/src/selectors/README.md) for how versioned selectors work.2021```typescript22// example: selector value changed in Grafana 12.5.023const components = {24 PanelEditor: {25 content: {26 '12.5.0': 'data-testid New panel editor content',27 '11.1.0': 'data-testid Panel editor content',28 '9.5.0': 'Panel editor content',29 },30 },31};32```3334**Important rules for selectors:**3536- Never delete selectors. Even if unused in the Grafana repo, they may be used by external plugins.37- Only create new selectors for genuinely new UI. If you're changing existing UI that already has a selector, reuse it.38- Prefer string selectors over function selectors.3940### 3. Raise a PR in plugin-e2e (last resort)4142If the UI changed so fundamentally that no existing selector can be reused (e.g. an entirely new interaction flow replaced an old one), you may need to update `@grafana/plugin-e2e` itself. In this case:43441. Raise a PR in [grafana/plugin-tools](https://github.com/grafana/plugin-tools) to update the affected page model or fixture in `@grafana/plugin-e2e`.452. Follow the [contributing guide for fixing broken test scenarios](https://github.com/grafana/plugin-tools/blob/main/packages/plugin-e2e/CONTRIBUTING.md#how-to-fix-broken-test-scenarios-after-changes-in-grafana).463. Once the new `@grafana/plugin-e2e` version is published and updated in the Grafana repo, update the test here if needed.4748This should be rare. Most UI changes can be handled by steps 1 or 2.4950## Reference5152- **E2E selectors**: `packages/grafana-e2e-selectors/src/selectors/` ([README](../../../packages/grafana-e2e-selectors/src/selectors/README.md))53- **`@grafana/plugin-e2e` API types**: `node_modules/@grafana/plugin-e2e/dist/index.d.ts`54- **Contributing guide**: [How to fix broken test scenarios after changes in Grafana](https://github.com/grafana/plugin-tools/blob/main/packages/plugin-e2e/CONTRIBUTING.md#how-to-fix-broken-test-scenarios-after-changes-in-grafana)55- **Playwright config**: `playwright.config.ts` (projects `admin` and `viewer`)56
One repository carrying more than one format is the comparison this product exists for: does anyone actually write different content in each file, or is one a copy of the other?
| Repository | Format | Stack | Covers | Score | Changed |
|---|---|---|---|---|---|
| grafana/grafanae2e-playwright/dashboard-new-layouts/AGENTS.md · 76k | AGENTS.md | teststyletesting-strategyagent-behaviour | 62/100 | today | |
| grafana/grafanapublic/app/core/journeys/AGENTS.md · 76k | AGENTS.md | testtesting-strategygitagent-behaviour | 73/100 | 14 days ago | |
| grafana/grafanapublic/app/features/alerting/unified/AGENTS.md · 76k | AGENTS.md | setuptestlint-formatstyle+11 | 76/100 | 9 days ago | |
| grafana/grafanapublic/app/features/expressions/components/SqlExpressions/SqlEditor/AGENTS.md · 76k | AGENTS.md | styleagent-behaviour | 43/100 | 14 days ago | |
| grafana/grafanapackages/grafana-ui/AGENTS.md · 76k | AGENTS.md | uiagent-behaviour | 16/100 | 14 days ago | |
| grafana/grafanapkg/storage/unified/AGENTS.md · 76k | AGENTS.md | do-not | 46/100 | 14 days ago | |
| grafana/grafanaAGENTS.md · 76k | AGENTS.md | setupbuildtestlint-format+6 | 89/100 | 14 days ago | |
| grafana/grafanapublic/app/plugins/panel/AGENTS.md · 76k | AGENTS.md | agent-behaviour | 16/100 | 14 days ago | |
| grafana/grafanae2e-playwright/alerting-suite/AGENTS.md · 76k | AGENTS.md | teststylearchtesting-strategy+3 | 81/100 | 14 days ago | |
| grafana/grafanapublic/app/features/AGENTS.md · 76k | AGENTS.md | agent-behaviour | 16/100 | 14 days ago |
Same format, overlapping stack, ranked by quality.
| Repository | Format | Stack | Covers | Score | Changed |
|---|---|---|---|---|---|
| deepseek-ai/deepseek-harnessnative/landlock-run/AGENTS.md · 104k | AGENTS.md | setupteststylearch+3 | 100/100 | today | |
| mui/material-uiAGENTS.md · 99k | AGENTS.md | setupbuildtestlint-format+9 | 100/100 | 14 days ago | |
| duckduckgo/content-scope-scriptsspecial-pages/AGENTS.md · 70 | AGENTS.md | buildteststylearch+3 | 100/100 | 14 days ago | |
| n8n-io/n8npackages/@n8n/agents/AGENTS.md · 201k | AGENTS.md | buildteststylearch+3 | 100/100 | 14 days ago | |
| TryGhost/Ghoste2e/AGENTS.md · 55k | AGENTS.md | setupteststylearch+2 | 100/100 | today | |
| code-yeongyu/oh-my-openagentpackages/web/AGENTS.md · 68k | AGENTS.md | setupbuildtestlint-format+6 | 100/100 | 13 days ago | |
| aaif-goose/gooseAGENTS.md · 53k | AGENTS.md | setupbuildtestlint-format+7 | 100/100 | 8 days ago | |
| ethereum/go-ethereumAGENTS.md · 51k | AGENTS.md | buildtestlint-formatgit+1 | 100/100 | 14 days ago |
A badge carrying the measured quality of the strongest agent config file in this repository, out of 100. It reads from this index every time somebody loads your page, so it changes when the measurement changes and there is nothing to keep up to date. Free, no account, and the value is not something you or we can set by hand.
[](https://rulestack.kynth.studio/configs/grafana-grafana-e2e-playwright-plugin-e2e-plugin-e2e-api-tests-agents)Would rather not hotlink us? Every badge is also served in shields.io’s endpoint schema, so shields renders the image and your readers never talk to our domain:
Published by Toolproof, the masthead over this index and eight others. The method behind the number is at toolproof.kynth.studio/methodology, and the whole thing is readable as JSON with no key at /api.