Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Feat: Add proper selectors for UI components #724

Closed
4 tasks
Tracked by #576
sunker opened this issue Feb 8, 2024 · 3 comments · Fixed by #833
Closed
4 tasks
Tracked by #576

Feat: Add proper selectors for UI components #724

sunker opened this issue Feb 8, 2024 · 3 comments · Fixed by #833
Assignees
Labels
enhancement New feature or request

Comments

@sunker
Copy link
Contributor

sunker commented Feb 8, 2024

Which areas does this feature request relate to

  • Create Plugin
  • Sign Plugin
  • Plugin E2E
  • Documentation

Problem

In some places in the code when plugin-e2e needs to interact with the Grafana UI, propers e2e-selectors are missing so adhoc selector are being used. See this example:

await this.ctx.page.getByRole('button', { name: 'TEST' }).click();

This is brittle and error prone. We should always use selectors defined in grafana/e2e-selectors rather than using adhoc selectors like this.

Solution

  1. Add new selectors to grafana/e2e-selectors
  2. Make sure they're being used in grafana/ui
  3. Update versioned selectors in grafana/plugin-e2e accordingly and make sure they're used throughout the plugin-e2e codebase

The following interactions need proper selectors:

Tasks

Alternatives

No response

Additional context

No response

Are you interested in contributing the solution?

@sunker sunker added the enhancement New feature or request label Feb 8, 2024
@sunker sunker self-assigned this Feb 8, 2024
@sunker sunker moved this from 📬 Triage to 📅 Planned in Plugins Platform / Grafana Community Feb 8, 2024
@sunker sunker mentioned this issue Feb 8, 2024
6 tasks
@sunker
Copy link
Contributor Author

sunker commented Feb 8, 2024

cc @sympatheticmoose

@tolzhabayev
Copy link
Collaborator

tolzhabayev commented Feb 20, 2024

@sunker can we turn the "The following interactions need proper selectors" into a tasklist and change the URLs so that they are working again e.g.
https://github.com/grafana/plugin-tools/blob/main/packages/plugin-e2e/dist/models/AnnotationEditPage.js ->

await this.ctx.page.getByRole('button', { name: 'TEST' }).click();

@sunker
Copy link
Contributor Author

sunker commented Feb 20, 2024

@sunker can we turn the "The following interactions need proper selectors" into a tasklist and change the URLs so that they are working again e.g. https://github.com/grafana/plugin-tools/blob/main/packages/plugin-e2e/dist/models/AnnotationEditPage.js ->

await this.ctx.page.getByRole('button', { name: 'TEST' }).click();

Yep done!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
Development

Successfully merging a pull request may close this issue.

2 participants