diff --git a/test/functional/apps/discover/group3/_request_counts.ts b/test/functional/apps/discover/group3/_request_counts.ts index 03fdab88e2f23..e44b0de22cb28 100644 --- a/test/functional/apps/discover/group3/_request_counts.ts +++ b/test/functional/apps/discover/group3/_request_counts.ts @@ -38,12 +38,9 @@ export default function ({ getService, getPageObjects }: FtrProviderContext) { ); await kibanaServer.uiSettings.replace({ defaultIndex: 'logstash-*', - 'bfetch:disable': true, - enableESQL: true, }); await timePicker.setDefaultAbsoluteRangeViaUiSettings(); await common.navigateToApp('discover'); - await header.waitUntilLoadingHasFinished(); }); after(async () => { @@ -114,14 +111,19 @@ export default function ({ getService, getPageObjects }: FtrProviderContext) { expectedRefreshRequest?: number; }) => { it(`should send no more than ${expectedRequests} search requests (documents + chart) on page load`, async () => { - await browser.refresh(); + if (type === 'ese') { + await browser.refresh(); + } await browser.execute(async () => { performance.setResourceTimingBufferSize(Number.MAX_SAFE_INTEGER); }); - await waitForLoadingToFinish(); - // one more requests for fields in ESQL mode - const actualExpectedRequests = type === 'esql' ? expectedRequests + 1 : expectedRequests; - await expectSearchCount(type, actualExpectedRequests); + if (type === 'esql') { + await expectSearches(type, expectedRequests, async () => { + await queryBar.clickQuerySubmitButton(); + }); + } else { + await expectSearchCount(type, expectedRequests); + } }); it(`should send no more than ${expectedRequests} requests (documents + chart) when refreshing`, async () => { @@ -173,9 +175,12 @@ export default function ({ getService, getPageObjects }: FtrProviderContext) { log.debug('Clearing saved search'); await expectSearches( type, - type === 'esql' ? actualExpectedRequests + 2 : actualExpectedRequests, + type === 'esql' ? actualExpectedRequests + 1 : actualExpectedRequests, async () => { await testSubjects.click('discoverNewButton'); + if (type === 'esql') { + await queryBar.clickQuerySubmitButton(); + } await waitForLoadingToFinish(); } ); @@ -256,21 +261,18 @@ export default function ({ getService, getPageObjects }: FtrProviderContext) { }); }); }); - // Currently ES|QL checks are disabled due to various flakiness - // Note that ES|QL also checks for different number of requests due to the fields request triggered - // by the ES|QL Editor - describe.skip('ES|QL mode', () => { + describe('ES|QL mode', () => { const type = 'esql'; before(async () => { + await kibanaServer.uiSettings.update({ + 'discover:searchOnPageLoad': false, + }); await common.navigateToApp('discover'); - await header.waitUntilLoadingHasFinished(); await discover.selectTextBaseLang(); }); beforeEach(async () => { await monacoEditor.setCodeEditorValue('from logstash-* | where bytes > 1000 '); - await queryBar.clickQuerySubmitButton(); - await waitForLoadingToFinish(); }); getSharedTests({