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

e2eTesting: update selectors #874

Merged
merged 3 commits into from
Apr 24, 2024
Merged

Conversation

L-M-K-B
Copy link
Contributor

@L-M-K-B L-M-K-B commented Apr 12, 2024

An external contributor updated some e2e selectors which are duplicated in this repo. In order to fix playwright tests in their PR in grafana/grafana I updated the selectors here.

Related to grafana/grafana#78536

📦 Published PR as canary version: Canary Versions

✨ Test out this PR locally via:

npm install @grafana/plugin-e2e@1.1.1-canary.874.63ebb8f.0
# or 
yarn add @grafana/plugin-e2e@1.1.1-canary.874.63ebb8f.0

@L-M-K-B L-M-K-B added the plugin-e2e related to the plugin-e2e package label Apr 12, 2024
@L-M-K-B L-M-K-B requested a review from a team as a code owner April 12, 2024 14:08
@L-M-K-B L-M-K-B requested review from leventebalogh and removed request for a team April 12, 2024 14:08
Copy link

github-actions bot commented Apr 12, 2024

Hello! 👋 This repository uses Auto for releasing packages using PR labels.

✨ This PR can be merged and will trigger a new patch release.
NOTE: When merging a PR with the release label please avoid merging another PR. For further information see here.

@L-M-K-B L-M-K-B requested a review from sunker April 12, 2024 14:09
@L-M-K-B L-M-K-B added no-changelog Don't include in changelog and version calculations release Create a release when this pr is merged patch Increment the patch version when merged and removed no-changelog Don't include in changelog and version calculations labels Apr 12, 2024
@L-M-K-B
Copy link
Contributor Author

L-M-K-B commented Apr 12, 2024

All E2E tests are failing (e.g. this one). Is this happening because the selectors deviate from grafana/grafana main branch or do I have to fix anything in this repo?
@sunker and @leventebalogh

Copy link
Contributor

@sunker sunker left a comment

Choose a reason for hiding this comment

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

Thanks for raising this PR!

The e2e-selectors in plugin-e2e are a little different than the ones defined in grafana/e2e-selectors. In grafana/e2e-selectors, the entire package has the same version strategy as Grafana. The plugin-e2e package is detached from the Grafana release cycle, so instead every single selector has a minimum Grafana version associated with it.

Now that you're changing these selectors in Grafana 11.1.0-pre, you can set 11.1.0 as the associated version. This means for example PanelEditor.General.content will have the value Panel editor content in versions prior to 11.1.0, and the value data-testid Panel editor content in versions equals to or larger than 11.1.0.

  PanelEditor: {
    General: {
      content: {
        '11.1.0': 'data-testid Panel editor content',
        [MIN_GRAFANA_VERSION]: 'Panel editor content',
      },
    },

If you change this, tests should be working again.

ivanortegaalba
ivanortegaalba previously approved these changes Apr 16, 2024
@ivanortegaalba ivanortegaalba self-requested a review April 16, 2024 10:04
@ivanortegaalba ivanortegaalba dismissed their stale review April 16, 2024 10:05

I didn't see the feedback from platform team. Good to know!

@L-M-K-B L-M-K-B requested a review from sunker April 24, 2024 07:00
Copy link
Contributor

@sunker sunker left a comment

Choose a reason for hiding this comment

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

Looks great! You can ignore the tests that are failing for grafana-dev@11.1.0-174229 as the selectors are resolved for all builds in 11.1.0 and currently not taking build version into account.

@L-M-K-B L-M-K-B merged commit e626fb8 into main Apr 24, 2024
21 of 22 checks passed
@L-M-K-B L-M-K-B deleted the laura/refactor/update-e2e-selectors branch April 24, 2024 12:20
@grafana-plugins-platform-bot
Copy link

🚀 PR was released in @grafana/create-plugin@4.8.0, @grafana/plugin-e2e@1.2.0 🚀

@grafana-plugins-platform-bot grafana-plugins-platform-bot bot added the released This issue/pull request has been released. label Apr 24, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
patch Increment the patch version when merged plugin-e2e related to the plugin-e2e package release Create a release when this pr is merged released This issue/pull request has been released.
Projects
Development

Successfully merging this pull request may close these issues.

3 participants