Skip to content

Commit

Permalink
[8.11] [Controls] Fix flaky a11y test (#169559) (#170771)
Browse files Browse the repository at this point in the history
# Backport

This will backport the following commits from `main` to `8.11`:
- [[Controls] Fix flaky `a11y` test
(#169559)](#169559)

<!--- Backport version: 8.9.7 -->

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

<!--BACKPORT [{"author":{"name":"Hannah
Mudge","email":"[email protected]"},"sourceCommit":{"committedDate":"2023-10-24T15:48:16Z","message":"[Controls]
Fix flaky `a11y` test (#169559)\n\nCloses
https://github.com/elastic/kibana/issues/169542\r\n\r\n##
Summary\r\n\r\nFor some reason, the search session popover was being
opened, which\r\nblocked the controls button from being
clickable:\r\n\r\n\r\n![image](https://github.com/elastic/kibana/assets/8698078/6882e67e-6f17-4820-8e71-14e84c3d04c2)\r\n\r\nI'm
unsure why this popover is open to begin with; this should
**only**\r\nhappen when the `searchSessionIndicator` button is clicked,
but this\r\nbutton is **not** interacted with in **any** of the
accessibility tests\r\n(that I could find). This makes me suspicious
that this is actually a\r\n**misclick** - i.e. the element that was
meant to be clicked gets moved\r\n(possibly the Dashboard \"edit\"
button?), which causes the\r\n`searchSessionIndicator` button to be
clicked instead.\r\n\r\nGoing off this theory, I've switched the
controls `a11y` tests to use\r\nthe Dashboard page's methods (which have
more safeguards in place) to\r\nnavigate to the desired dashboard rather
than clicking elements solely\r\nbased off of the `data-test-subj` like
we were previously.\r\n\r\n### [Flaky
Test\r\nRunner](https://buildkite.com/elastic/kibana-flaky-test-suite-runner/builds/3686)\r\n\r\n\r\n![image](https://github.com/elastic/kibana/assets/8698078/74fb0d27-9cb2-4650-ba91-97865a3bd962)\r\n\r\n###
Checklist\r\n\r\n- [x] [Unit or
functional\r\ntests](https://www.elastic.co/guide/en/kibana/master/development-tests.html)\r\nwere
updated or added to match the most common scenarios\r\n\r\n\r\n### For
maintainers\r\n\r\n- [ ] This was checked for breaking API changes and
was
[labeled\r\nappropriately](https://www.elastic.co/guide/en/kibana/master/contributing.html#kibana-release-notes-process)","sha":"ad932ec5d5c71c33f11cdf29dd5faa10123e1ca9","branchLabelMapping":{"^v8.12.0$":"main","^v(\\d+).(\\d+).\\d+$":"$1.$2"}},"sourcePullRequest":{"labels":["Team:Presentation","loe:small","release_note:skip","impact:critical","backport:prev-minor","v8.11.0","v8.12.0"],"number":169559,"url":"https://github.com/elastic/kibana/pull/169559","mergeCommit":{"message":"[Controls]
Fix flaky `a11y` test (#169559)\n\nCloses
https://github.com/elastic/kibana/issues/169542\r\n\r\n##
Summary\r\n\r\nFor some reason, the search session popover was being
opened, which\r\nblocked the controls button from being
clickable:\r\n\r\n\r\n![image](https://github.com/elastic/kibana/assets/8698078/6882e67e-6f17-4820-8e71-14e84c3d04c2)\r\n\r\nI'm
unsure why this popover is open to begin with; this should
**only**\r\nhappen when the `searchSessionIndicator` button is clicked,
but this\r\nbutton is **not** interacted with in **any** of the
accessibility tests\r\n(that I could find). This makes me suspicious
that this is actually a\r\n**misclick** - i.e. the element that was
meant to be clicked gets moved\r\n(possibly the Dashboard \"edit\"
button?), which causes the\r\n`searchSessionIndicator` button to be
clicked instead.\r\n\r\nGoing off this theory, I've switched the
controls `a11y` tests to use\r\nthe Dashboard page's methods (which have
more safeguards in place) to\r\nnavigate to the desired dashboard rather
than clicking elements solely\r\nbased off of the `data-test-subj` like
we were previously.\r\n\r\n### [Flaky
Test\r\nRunner](https://buildkite.com/elastic/kibana-flaky-test-suite-runner/builds/3686)\r\n\r\n\r\n![image](https://github.com/elastic/kibana/assets/8698078/74fb0d27-9cb2-4650-ba91-97865a3bd962)\r\n\r\n###
Checklist\r\n\r\n- [x] [Unit or
functional\r\ntests](https://www.elastic.co/guide/en/kibana/master/development-tests.html)\r\nwere
updated or added to match the most common scenarios\r\n\r\n\r\n### For
maintainers\r\n\r\n- [ ] This was checked for breaking API changes and
was
[labeled\r\nappropriately](https://www.elastic.co/guide/en/kibana/master/contributing.html#kibana-release-notes-process)","sha":"ad932ec5d5c71c33f11cdf29dd5faa10123e1ca9"}},"sourceBranch":"main","suggestedTargetBranches":["8.11"],"targetPullRequestStates":[{"branch":"8.11","label":"v8.11.0","labelRegex":"^v(\\d+).(\\d+).\\d+$","isSourceBranch":false,"state":"NOT_CREATED"},{"branch":"main","label":"v8.12.0","labelRegex":"^v8.12.0$","isSourceBranch":true,"state":"MERGED","url":"https://github.com/elastic/kibana/pull/169559","number":169559,"mergeCommit":{"message":"[Controls]
Fix flaky `a11y` test (#169559)\n\nCloses
https://github.com/elastic/kibana/issues/169542\r\n\r\n##
Summary\r\n\r\nFor some reason, the search session popover was being
opened, which\r\nblocked the controls button from being
clickable:\r\n\r\n\r\n![image](https://github.com/elastic/kibana/assets/8698078/6882e67e-6f17-4820-8e71-14e84c3d04c2)\r\n\r\nI'm
unsure why this popover is open to begin with; this should
**only**\r\nhappen when the `searchSessionIndicator` button is clicked,
but this\r\nbutton is **not** interacted with in **any** of the
accessibility tests\r\n(that I could find). This makes me suspicious
that this is actually a\r\n**misclick** - i.e. the element that was
meant to be clicked gets moved\r\n(possibly the Dashboard \"edit\"
button?), which causes the\r\n`searchSessionIndicator` button to be
clicked instead.\r\n\r\nGoing off this theory, I've switched the
controls `a11y` tests to use\r\nthe Dashboard page's methods (which have
more safeguards in place) to\r\nnavigate to the desired dashboard rather
than clicking elements solely\r\nbased off of the `data-test-subj` like
we were previously.\r\n\r\n### [Flaky
Test\r\nRunner](https://buildkite.com/elastic/kibana-flaky-test-suite-runner/builds/3686)\r\n\r\n\r\n![image](https://github.com/elastic/kibana/assets/8698078/74fb0d27-9cb2-4650-ba91-97865a3bd962)\r\n\r\n###
Checklist\r\n\r\n- [x] [Unit or
functional\r\ntests](https://www.elastic.co/guide/en/kibana/master/development-tests.html)\r\nwere
updated or added to match the most common scenarios\r\n\r\n\r\n### For
maintainers\r\n\r\n- [ ] This was checked for breaking API changes and
was
[labeled\r\nappropriately](https://www.elastic.co/guide/en/kibana/master/contributing.html#kibana-release-notes-process)","sha":"ad932ec5d5c71c33f11cdf29dd5faa10123e1ca9"}}]}]
BACKPORT-->

Co-authored-by: Hannah Mudge <[email protected]>
  • Loading branch information
kibanamachine and Heenawter authored Nov 7, 2023
1 parent d550227 commit b372e86
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions x-pack/test/accessibility/apps/dashboard_controls.ts
Original file line number Diff line number Diff line change
Expand Up @@ -23,8 +23,8 @@ export default function ({ getService, getPageObjects }: FtrProviderContext) {
});
await PageObjects.home.addSampleDataSet('flights');
await PageObjects.common.navigateToApp('dashboard');
await testSubjects.click('dashboardListingTitleLink-[Flights]-Global-Flight-Dashboard');
await testSubjects.click('dashboardEditMode');
await PageObjects.dashboard.loadSavedDashboard('[Flights] Global Flight Dashboard');
await PageObjects.dashboard.switchToEditMode();
});

after(async () => {
Expand Down

0 comments on commit b372e86

Please sign in to comment.