[8.16] [Dashboard] Fix page object getPanels method for new grid system (#217812) (#217855)

# Backport

This will backport the following commits from `main` to `8.16`:
- [[Dashboard] Fix page object getPanels method for new grid system
(#217812)](https://github.com/elastic/kibana/pull/217812)

<!--- Backport version: 9.6.6 -->

### Questions ?
Please refer to the [Backport tool
documentation](https://github.com/sorenlouv/backport)

<!--BACKPORT [{"author":{"name":"Marco
Liberati","email":"dej611@users.noreply.github.com"},"sourceCommit":{"committedDate":"2025-04-10T14:22:27Z","message":"[Dashboard]
Fix page object getPanels method for new grid system (#217812)\n\n##
Summary\n\n@umbopepato made me notice that this method was always
returning an\nempty list of element.\nThat was due to the selector used
was targeting the old grid system.\nThis PR fixes that using the right
selector for the new grid system.\n\n---------\n\nCo-authored-by:
kibanamachine
<42973632+kibanamachine@users.noreply.github.com>","sha":"ff0ba15eaa2f63a6e8ba09454ac5fb4476d1353f","branchLabelMapping":{"^v9.1.0$":"main","^v8.19.0$":"8.x","^v(\\d+).(\\d+).\\d+$":"$1.$2"}},"sourcePullRequest":{"labels":["Feature:Dashboard","Team:Presentation","loe:small","release_note:skip","impact:low","backport:all-open","FTR","v9.1.0"],"title":"[Dashboard]
Fix page object getPanels method for new grid
system","number":217812,"url":"https://github.com/elastic/kibana/pull/217812","mergeCommit":{"message":"[Dashboard]
Fix page object getPanels method for new grid system (#217812)\n\n##
Summary\n\n@umbopepato made me notice that this method was always
returning an\nempty list of element.\nThat was due to the selector used
was targeting the old grid system.\nThis PR fixes that using the right
selector for the new grid system.\n\n---------\n\nCo-authored-by:
kibanamachine
<42973632+kibanamachine@users.noreply.github.com>","sha":"ff0ba15eaa2f63a6e8ba09454ac5fb4476d1353f"}},"sourceBranch":"main","suggestedTargetBranches":[],"targetPullRequestStates":[{"branch":"main","label":"v9.1.0","branchLabelMappingKey":"^v9.1.0$","isSourceBranch":true,"state":"MERGED","url":"https://github.com/elastic/kibana/pull/217812","number":217812,"mergeCommit":{"message":"[Dashboard]
Fix page object getPanels method for new grid system (#217812)\n\n##
Summary\n\n@umbopepato made me notice that this method was always
returning an\nempty list of element.\nThat was due to the selector used
was targeting the old grid system.\nThis PR fixes that using the right
selector for the new grid system.\n\n---------\n\nCo-authored-by:
kibanamachine
<42973632+kibanamachine@users.noreply.github.com>","sha":"ff0ba15eaa2f63a6e8ba09454ac5fb4476d1353f"}}]}]
BACKPORT-->

Co-authored-by: Marco Liberati <dej611@users.noreply.github.com>
This commit is contained in:
Kibana Machine 2025-04-10 18:23:48 +02:00 committed by GitHub
parent de8e8600ee
commit b491930179
No known key found for this signature in database
GPG key ID: B5690EEEBB952194

View file

@ -684,7 +684,7 @@ export class DashboardPageObject extends FtrService {
}
public async getPanels() {
return await this.find.allByCssSelector('.react-grid-item'); // These are gridster-defined elements and classes
return await this.testSubjects.findAll('dashboardPanel');
}
public async getPanelDimensions() {