diff --git a/test/examples/search/warnings.ts b/test/examples/search/warnings.ts index 3f2166447f6520..5ec4f59586a13d 100644 --- a/test/examples/search/warnings.ts +++ b/test/examples/search/warnings.ts @@ -26,8 +26,7 @@ export default function ({ getService, getPageObjects }: FtrProviderContext) { const kibanaServer = getService('kibanaServer'); const esArchiver = getService('esArchiver'); - // Failing: See https://github.com/elastic/kibana/issues/139879 - describe.skip('handling warnings with search source fetch', function () { + describe('handling warnings with search source fetch', function () { const dataViewTitle = 'sample-01,sample-01-rollup'; const fromTime = 'Jun 17, 2022 @ 00:00:00.000'; const toTime = 'Jun 23, 2022 @ 00:00:00.000'; @@ -122,8 +121,12 @@ export default function ({ getService, getPageObjects }: FtrProviderContext) { // click "see full error" button in the toast const [openShardModalButton] = await testSubjects.findAll('openShardFailureModalBtn'); await openShardModalButton.click(); - const modalHeader = await testSubjects.find('shardFailureModalTitle'); - expect(await modalHeader.getVisibleText()).to.be('2 of 4 shards failed'); + + await retry.waitFor('modal title visible', async () => { + const modalHeader = await testSubjects.find('shardFailureModalTitle'); + return (await modalHeader.getVisibleText()) === '2 of 4 shards failed'; + }); + // request await testSubjects.click('shardFailuresModalRequestButton'); const requestBlock = await testSubjects.find('shardsFailedModalRequestBlock'); @@ -169,8 +172,12 @@ export default function ({ getService, getPageObjects }: FtrProviderContext) { const [openShardModalButton] = await testSubjects.findAll('openShardFailureModalBtn'); await openShardModalButton.click(); await testSubjects.exists('shardFailureModalTitle'); - const modalHeader = await testSubjects.find('shardFailureModalTitle'); - expect(await modalHeader.getVisibleText()).to.be('2 of 4 shards failed'); + + await retry.waitFor('modal title visible', async () => { + const modalHeader = await testSubjects.find('shardFailureModalTitle'); + return (await modalHeader.getVisibleText()) === '2 of 4 shards failed'; + }); + // request await testSubjects.click('shardFailuresModalRequestButton'); const requestBlock = await testSubjects.find('shardsFailedModalRequestBlock'); diff --git a/x-pack/test_serverless/functional/test_suites/common/examples/search/warnings.ts b/x-pack/test_serverless/functional/test_suites/common/examples/search/warnings.ts index 01808d0a3175ba..a98cc05f0bfd3c 100644 --- a/x-pack/test_serverless/functional/test_suites/common/examples/search/warnings.ts +++ b/x-pack/test_serverless/functional/test_suites/common/examples/search/warnings.ts @@ -125,8 +125,12 @@ export default function ({ getService, getPageObjects }: FtrProviderContext) { // click "see full error" button in the toast const [openShardModalButton] = await testSubjects.findAll('openShardFailureModalBtn'); await openShardModalButton.click(); - const modalHeader = await testSubjects.find('shardFailureModalTitle'); - expect(await modalHeader.getVisibleText()).to.be('2 of 4 shards failed'); + + await retry.waitFor('modal title visible', async () => { + const modalHeader = await testSubjects.find('shardFailureModalTitle'); + return (await modalHeader.getVisibleText()) === '2 of 4 shards failed'; + }); + // request await testSubjects.click('shardFailuresModalRequestButton'); const requestBlock = await testSubjects.find('shardsFailedModalRequestBlock'); @@ -171,8 +175,12 @@ export default function ({ getService, getPageObjects }: FtrProviderContext) { // click "see full error" button in the toast const [openShardModalButton] = await testSubjects.findAll('openShardFailureModalBtn'); await openShardModalButton.click(); - const modalHeader = await testSubjects.find('shardFailureModalTitle'); - expect(await modalHeader.getVisibleText()).to.be('2 of 4 shards failed'); + + await retry.waitFor('modal title visible', async () => { + const modalHeader = await testSubjects.find('shardFailureModalTitle'); + return (await modalHeader.getVisibleText()) === '2 of 4 shards failed'; + }); + // request await testSubjects.click('shardFailuresModalRequestButton'); const requestBlock = await testSubjects.find('shardsFailedModalRequestBlock'); diff --git a/x-pack/test_serverless/tsconfig.json b/x-pack/test_serverless/tsconfig.json index de711146da7ec1..3950afef67928a 100644 --- a/x-pack/test_serverless/tsconfig.json +++ b/x-pack/test_serverless/tsconfig.json @@ -45,7 +45,6 @@ "@kbn/cases-plugin", "@kbn/test-subj-selector", "@kbn/core-http-common", - "@kbn/std", "@kbn/data-views-plugin", "@kbn/core-saved-objects-server", "@kbn/security-api-integration-helpers", @@ -54,5 +53,6 @@ "@kbn/dev-utils", "@kbn/bfetch-plugin", "@kbn/rison", + "@kbn/std", ] }