From 29eed87adffe9641f781c39c9821f42cf1353d56 Mon Sep 17 00:00:00 2001 From: Lee Drengenberg Date: Tue, 10 Nov 2020 15:43:42 -0600 Subject: [PATCH] Fix test/functional/apps/management/_index_patterns_empty.ts for Cloud & X-Pack (#82736) Co-authored-by: Rashmi Kulkarni Co-authored-by: Kibana Machine <42973632+kibanamachine@users.noreply.github.com> --- .../apps/management/_index_patterns_empty.ts | 23 +++++++++++++++---- 1 file changed, 18 insertions(+), 5 deletions(-) diff --git a/test/functional/apps/management/_index_patterns_empty.ts b/test/functional/apps/management/_index_patterns_empty.ts index 4ae2e7836ac37..2a1d723f1a06e 100644 --- a/test/functional/apps/management/_index_patterns_empty.ts +++ b/test/functional/apps/management/_index_patterns_empty.ts @@ -22,6 +22,7 @@ import { FtrProviderContext } from '../../ftr_provider_context'; export default function ({ getPageObjects, getService }: FtrProviderContext) { const esArchiver = getService('esArchiver'); const kibanaServer = getService('kibanaServer'); + const log = getService('log'); const PageObjects = getPageObjects(['common', 'settings']); const testSubjects = getService('testSubjects'); const globalNav = getService('globalNav'); @@ -30,6 +31,8 @@ export default function ({ getPageObjects, getService }: FtrProviderContext) { describe('index pattern empty view', () => { before(async () => { await esArchiver.load('empty_kibana'); + await esArchiver.unload('logstash_functional'); + await esArchiver.unload('makelogs'); await kibanaServer.uiSettings.replace({}); await PageObjects.settings.navigateTo(); }); @@ -37,16 +40,26 @@ export default function ({ getPageObjects, getService }: FtrProviderContext) { after(async () => { await esArchiver.unload('empty_kibana'); await esArchiver.loadIfNeeded('makelogs'); - }); - - // create index pattern and return to verify list - it(`shows empty views`, async () => { // @ts-expect-error await es.transport.request({ - path: '/_all', + path: '/logstash-a', method: 'DELETE', }); + }); + + // create index pattern and return to verify list + it(`shows empty views`, async () => { await PageObjects.settings.clickKibanaIndexPatterns(); + log.debug( + `\n\nNOTE: If this test fails make sure there aren't any non-system indices in the _cat/indices output (use esArchiver.unload on them)` + ); + log.debug( + // @ts-expect-error + await es.transport.request({ + path: '/_cat/indices', + method: 'GET', + }) + ); await testSubjects.existOrFail('createAnyway'); // @ts-expect-error await es.transport.request({