diff --git a/test/functional/apps/console/monaco/_misc_console_behavior.ts b/test/functional/apps/console/monaco/_misc_console_behavior.ts index 1d72fa796e421..f7ad2957c8411 100644 --- a/test/functional/apps/console/monaco/_misc_console_behavior.ts +++ b/test/functional/apps/console/monaco/_misc_console_behavior.ts @@ -27,11 +27,11 @@ export default function ({ getService, getPageObjects }: FtrProviderContext) { }); describe('keyboard shortcuts', () => { - let tabCount = 1; - - after(async () => { - if (tabCount > 1) { + let tabOpened = false; + afterEach(async () => { + if (tabOpened) { await browser.closeCurrentWindow(); + tabOpened = false; await browser.switchTab(0); } }); @@ -91,20 +91,24 @@ export default function ({ getService, getPageObjects }: FtrProviderContext) { expect(await PageObjects.console.monaco.getCurrentLineNumber()).to.be(4); }); - // flaky - it.skip('should open documentation when Ctrl+/ is pressed', async () => { - await PageObjects.console.monaco.enterText('GET _search'); - await PageObjects.console.monaco.pressEscape(); - await PageObjects.console.monaco.pressCtrlSlash(); - await retry.tryForTime(10000, async () => { - await browser.switchTab(1); - tabCount++; - }); - - // Retry until the documentation is loaded - await retry.try(async () => { - const url = await browser.getCurrentUrl(); - expect(url).to.contain('search-search.html'); + describe('open documentation', () => { + const requests = ['GET _search', 'GET test_index/_search', 'GET /_search']; + requests.forEach((request) => { + it('should open documentation when Ctrl+/ is pressed', async () => { + await PageObjects.console.monaco.enterText(request); + await PageObjects.console.monaco.pressEscape(); + await PageObjects.console.monaco.pressCtrlSlash(); + await retry.tryForTime(10000, async () => { + await browser.switchTab(1); + tabOpened = true; + }); + + // Retry until the documentation is loaded + await retry.try(async () => { + const url = await browser.getCurrentUrl(); + expect(url).to.contain('search-search.html'); + }); + }); }); }); });