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

Panel edit: Add e2e selectors to input fields #83246

Merged
merged 2 commits into from Mar 12, 2024
Merged

Conversation

sunker
Copy link
Contributor

@sunker sunker commented Feb 22, 2024

What is this feature?

This PR adds e2e selectors to the input fields for the common panel edit options.
[Add a brief description of what the feature or update does.]

Why do we need this feature?

Needed in e2e tests.

[Add a description of the problem the feature is trying to solve.]

Who is this feature for?

[Add information on what kind of user the feature is for.]

Which issue(s) does this PR fix?:
Part of grafana/plugin-tools#724

Fixes #

Special notes for your reviewer:

Please check that:

  • It works as expected from a user's perspective.
  • If this is a pre-GA feature, it is behind a feature toggle.
  • The docs are updated, and if this is a notable improvement, it's added to our What's New doc.

@sunker sunker requested review from a team as code owners February 22, 2024 14:45
@sunker sunker requested review from oscarkilhed, Sergej-Vlasov, joshhunt and L-M-K-B and removed request for a team February 22, 2024 14:45
@grafana-delivery-bot grafana-delivery-bot bot added this to the 11.0.x milestone Feb 22, 2024
@sunker sunker added the no-changelog Skip including change in changelog/release notes label Feb 22, 2024
@sunker
Copy link
Contributor Author

sunker commented Mar 12, 2024

@grafana/grafana-frontend-platform can you take a look at this? :)

@@ -49,6 +50,7 @@ export function getPanelFrameCategory(props: OptionPaneRenderProps): OptionsPane
render: function renderTitle() {
return (
<Input
data-testid={selectors.components.PanelEditor.OptionsPane.fieldInput('Title')}
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looking at these selectors I wonder why aren't we using Cypress testing library as it has the same idea as React Testing Library and would allow us to reuse the existing ways to query elements?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Sorry I missed this comments.

There are many other factors affecting the choice of e2e testing framework for plugin e2e testing. You can find more information in this design doc. TLDR; Playwright was chosen because it's more extensible than Cypress.

Anyway, Cypress also has some kind of actionability checks so I think we would have faced the same issues there. .

@sunker sunker merged commit 8c06c0d into main Mar 12, 2024
18 checks passed
@sunker sunker deleted the panel-edit/e2e-selectors branch March 12, 2024 08:17
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
area/frontend no-changelog Skip including change in changelog/release notes
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

3 participants