[Discover] Unskip and improve a11y test (#216627)

This commit is contained in:
Matthias Wilhelm 2025-04-02 15:26:49 +02:00 committed by GitHub
parent 9268afecf7
commit 92d18e1553
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/213461
describe.skip('top nav menu buttons', () => {
describe('top nav menu buttons', () => {
const focusAndPressButton = async (buttonTestSubject: string | WebElementWrapper) => {
const button =
typeof buttonTestSubject === 'string'
@ -65,9 +64,14 @@ export default function ({ getService, getPageObjects }: FtrProviderContext) {
menuButtonTestSubject: string
) => {
await focusAndPressButton(menuButtonTestSubject);
expect(await hasFocus(menuButtonTestSubject)).to.be(false);
await retry.try(async () => {
expect(await hasFocus(menuButtonTestSubject)).to.be(false);
});
await browser.pressKeys(browser.keys.ESCAPE);
expect(await hasFocus(menuButtonTestSubject)).to.be(true);
await retry.try(async () => {
expect(await hasFocus(menuButtonTestSubject)).to.be(true);
});
};
it('should return focus to the open button when dismissing the open search flyout', () =>