Fix test/functional/apps/management/_index_patterns_empty.ts for Cloud & X-Pack (#82736)

Co-authored-by: Rashmi Kulkarni <rashmi.kulkarni@elastic.co>
Co-authored-by: Kibana Machine <42973632+kibanamachine@users.noreply.github.com>
This commit is contained in:
Lee Drengenberg 2020-11-10 15:43:42 -06:00 committed by GitHub
parent 096acb4da8
commit 5dde31a7fe
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

@ -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');
// @ts-expect-error
await es.transport.request({
path: '/logstash-a',
method: 'DELETE',
});
});
// create index pattern and return to verify list
it(`shows empty views`, async () => {
// @ts-expect-error
await es.transport.request({
path: '/_all',
method: 'DELETE',
});
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({