[Discover] Fix flaky test #217012 (#218021)

## Summary

Flaky test runner x100:
https://buildkite.com/elastic/kibana-flaky-test-suite-runner/builds/8175.

Resolves #217012.

### Checklist

- [ ] Any text added follows [EUI's writing
guidelines](https://elastic.github.io/eui/#/guidelines/writing), uses
sentence case text and includes [i18n
support](https://github.com/elastic/kibana/blob/main/src/platform/packages/shared/kbn-i18n/README.md)
- [ ]
[Documentation](https://www.elastic.co/guide/en/kibana/master/development-documentation.html)
was added for features that require explanation or tutorials
- [x] [Unit or functional
tests](https://www.elastic.co/guide/en/kibana/master/development-tests.html)
were updated or added to match the most common scenarios
- [ ] If a plugin configuration key changed, check if it needs to be
allowlisted in the cloud and added to the [docker
list](https://github.com/elastic/kibana/blob/main/src/dev/build/tasks/os_packages/docker_generator/resources/base/bin/kibana-docker)
- [ ] This was checked for breaking HTTP API changes, and any breaking
changes have been approved by the breaking-change committee. The
`release_note:breaking` label should be applied in these situations.
- [x] [Flaky Test
Runner](https://ci-stats.kibana.dev/trigger_flaky_test_runner/1) was
used on any tests changed
- [ ] The PR description includes the appropriate Release Notes section,
and the correct `release_note:*` label is applied per the
[guidelines](https://www.elastic.co/guide/en/kibana/master/contributing.html#kibana-release-notes-process)
This commit is contained in:
Davis McPhee 2025-04-14 17:00:39 -03:00 committed by GitHub
parent e09548eff6
commit c9b32ff7ec
No known key found for this signature in database
GPG key ID: B5690EEEBB952194

View file

@ -50,8 +50,7 @@ export default function ({ getService, getPageObjects }: FtrProviderContext) {
await kibanaServer.savedObjects.clean({ types: ['search', 'index-pattern'] });
});
// FLAKY: https://github.com/elastic/kibana/issues/217012
describe.skip('top nav menu buttons', () => {
describe('top nav menu buttons', () => {
const focusAndPressButton = async (buttonTestSubject: string | WebElementWrapper) => {
const button =
typeof buttonTestSubject === 'string'
@ -68,7 +67,8 @@ export default function ({ getService, getPageObjects }: FtrProviderContext) {
await retry.try(async () => {
expect(await hasFocus(menuButtonTestSubject)).to.be(false);
});
// Small delay to allow the overlay to open fully
await new Promise((resolve) => setTimeout(resolve, 500));
await browser.pressKeys(browser.keys.ESCAPE);
await retry.try(async () => {
expect(await hasFocus(menuButtonTestSubject)).to.be(true);