From 1edc80d027e76b9c2138dc37414765cc54131ea4 Mon Sep 17 00:00:00 2001 From: pgayvallet Date: Tue, 5 Jul 2022 13:43:55 +0200 Subject: [PATCH] adapt the functional suite --- .../functional/tests/bulk_actions.ts | 16 +++++++--------- .../functional/tests/create.ts | 11 ++++++----- .../functional/tests/dashboard_integration.ts | 10 ++++++---- .../functional/tests/edit.ts | 10 +++++----- .../functional/tests/feature_control.ts | 10 +++++----- .../functional/tests/listing.ts | 13 ++++++------- .../functional/tests/maps_integration.ts | 11 ++++++++--- .../functional/tests/som_integration.ts | 13 ++++++------- .../functional/tests/visualize_integration.ts | 10 ++++++---- 9 files changed, 55 insertions(+), 49 deletions(-) diff --git a/x-pack/test/saved_object_tagging/functional/tests/bulk_actions.ts b/x-pack/test/saved_object_tagging/functional/tests/bulk_actions.ts index ffb0fb7e09ee6a..f0f2d3aa980ace 100644 --- a/x-pack/test/saved_object_tagging/functional/tests/bulk_actions.ts +++ b/x-pack/test/saved_object_tagging/functional/tests/bulk_actions.ts @@ -10,26 +10,24 @@ import { FtrProviderContext } from '../ftr_provider_context'; // eslint-disable-next-line import/no-default-export export default function ({ getPageObjects, getService }: FtrProviderContext) { - const esArchiver = getService('esArchiver'); + const kibanaServer = getService('kibanaServer'); const PageObjects = getPageObjects(['common', 'security', 'savedObjects', 'tagManagement']); const tagManagementPage = PageObjects.tagManagement; - // FLAKY: https://github.com/elastic/kibana/issues/135348 - describe.skip('table bulk actions', () => { + describe('table bulk actions', () => { beforeEach(async () => { - await esArchiver.load( - 'x-pack/test/saved_object_tagging/common/fixtures/es_archiver/functional_base' + await kibanaServer.importExport.load( + 'x-pack/test/saved_object_tagging/common/fixtures/es_archiver/functional_base/data.json' ); await tagManagementPage.navigateTo(); }); afterEach(async () => { - await esArchiver.unload( - 'x-pack/test/saved_object_tagging/common/fixtures/es_archiver/functional_base' + await kibanaServer.importExport.unload( + 'x-pack/test/saved_object_tagging/common/fixtures/es_archiver/functional_base/data.json' ); }); - // FLAKY: https://github.com/elastic/kibana/issues/135347 - describe.skip('bulk delete', () => { + describe('bulk delete', () => { it('deletes multiple tags', async () => { await tagManagementPage.selectTagByName('tag-1'); await tagManagementPage.selectTagByName('tag-3'); diff --git a/x-pack/test/saved_object_tagging/functional/tests/create.ts b/x-pack/test/saved_object_tagging/functional/tests/create.ts index ea2697bf37b75b..16c8958c0fa622 100644 --- a/x-pack/test/saved_object_tagging/functional/tests/create.ts +++ b/x-pack/test/saved_object_tagging/functional/tests/create.ts @@ -10,7 +10,7 @@ import { FtrProviderContext } from '../ftr_provider_context'; // eslint-disable-next-line import/no-default-export export default function ({ getPageObjects, getService }: FtrProviderContext) { - const esArchiver = getService('esArchiver'); + const kibanaServer = getService('kibanaServer'); const PageObjects = getPageObjects(['common', 'security', 'savedObjects', 'tagManagement']); const tagManagementPage = PageObjects.tagManagement; @@ -20,15 +20,16 @@ export default function ({ getPageObjects, getService }: FtrProviderContext) { before(async () => { tagModal = tagManagementPage.tagModal; - await esArchiver.load( - 'x-pack/test/saved_object_tagging/common/fixtures/es_archiver/functional_base' + await kibanaServer.importExport.load( + 'x-pack/test/saved_object_tagging/common/fixtures/es_archiver/functional_base/data.json' ); await tagManagementPage.navigateTo(); }); after(async () => { - await esArchiver.unload( - 'x-pack/test/saved_object_tagging/common/fixtures/es_archiver/functional_base' + await kibanaServer.importExport.unload( + 'x-pack/test/saved_object_tagging/common/fixtures/es_archiver/functional_base/data.json' ); + await kibanaServer.savedObjects.clean({ types: ['tag'] }); }); afterEach(async () => { diff --git a/x-pack/test/saved_object_tagging/functional/tests/dashboard_integration.ts b/x-pack/test/saved_object_tagging/functional/tests/dashboard_integration.ts index dbcb520c2a5f5c..2a31c0518798e9 100644 --- a/x-pack/test/saved_object_tagging/functional/tests/dashboard_integration.ts +++ b/x-pack/test/saved_object_tagging/functional/tests/dashboard_integration.ts @@ -11,6 +11,7 @@ import { FtrProviderContext } from '../ftr_provider_context'; // eslint-disable-next-line import/no-default-export export default function ({ getPageObjects, getService }: FtrProviderContext) { const esArchiver = getService('esArchiver'); + const kibanaServer = getService('kibanaServer'); const listingTable = getService('listingTable'); const testSubjects = getService('testSubjects'); const find = getService('find'); @@ -38,17 +39,18 @@ export default function ({ getPageObjects, getService }: FtrProviderContext) { describe('dashboard integration', () => { before(async () => { - await esArchiver.load( - 'x-pack/test/saved_object_tagging/common/fixtures/es_archiver/dashboard' + await kibanaServer.importExport.load( + 'x-pack/test/saved_object_tagging/common/fixtures/es_archiver/dashboard/data.json' ); await esArchiver.loadIfNeeded( 'x-pack/test/saved_object_tagging/common/fixtures/es_archiver/logstash_functional' ); }); after(async () => { - await esArchiver.unload( - 'x-pack/test/saved_object_tagging/common/fixtures/es_archiver/dashboard' + await kibanaServer.importExport.unload( + 'x-pack/test/saved_object_tagging/common/fixtures/es_archiver/dashboard/data.json' ); + await kibanaServer.savedObjects.clean({ types: ['tag'] }); await esArchiver.unload( 'x-pack/test/saved_object_tagging/common/fixtures/es_archiver/logstash_functional' ); diff --git a/x-pack/test/saved_object_tagging/functional/tests/edit.ts b/x-pack/test/saved_object_tagging/functional/tests/edit.ts index f5d3f11e25b6e6..0ba39bc3a8743d 100644 --- a/x-pack/test/saved_object_tagging/functional/tests/edit.ts +++ b/x-pack/test/saved_object_tagging/functional/tests/edit.ts @@ -10,7 +10,7 @@ import { FtrProviderContext } from '../ftr_provider_context'; // eslint-disable-next-line import/no-default-export export default function ({ getPageObjects, getService }: FtrProviderContext) { - const esArchiver = getService('esArchiver'); + const kibanaServer = getService('kibanaServer'); const PageObjects = getPageObjects(['common', 'security', 'savedObjects', 'tagManagement']); const tagManagementPage = PageObjects.tagManagement; @@ -20,14 +20,14 @@ export default function ({ getPageObjects, getService }: FtrProviderContext) { before(async () => { tagModal = tagManagementPage.tagModal; - await esArchiver.load( - 'x-pack/test/saved_object_tagging/common/fixtures/es_archiver/functional_base' + await kibanaServer.importExport.load( + 'x-pack/test/saved_object_tagging/common/fixtures/es_archiver/functional_base/data.json' ); await tagManagementPage.navigateTo(); }); after(async () => { - await esArchiver.unload( - 'x-pack/test/saved_object_tagging/common/fixtures/es_archiver/functional_base' + await kibanaServer.importExport.unload( + 'x-pack/test/saved_object_tagging/common/fixtures/es_archiver/functional_base/data.json' ); }); diff --git a/x-pack/test/saved_object_tagging/functional/tests/feature_control.ts b/x-pack/test/saved_object_tagging/functional/tests/feature_control.ts index 0dbc3fae3e9c66..90b6e1d360d4e4 100644 --- a/x-pack/test/saved_object_tagging/functional/tests/feature_control.ts +++ b/x-pack/test/saved_object_tagging/functional/tests/feature_control.ts @@ -25,7 +25,7 @@ interface FeatureControlUserSuite { // eslint-disable-next-line import/no-default-export export default function ({ getPageObjects, getService }: FtrProviderContext) { - const esArchiver = getService('esArchiver'); + const kibanaServer = getService('kibanaServer'); const PageObjects = getPageObjects(['common', 'security', 'savedObjects', 'tagManagement']); const tagManagementPage = PageObjects.tagManagement; @@ -89,13 +89,13 @@ export default function ({ getPageObjects, getService }: FtrProviderContext) { describe('feature controls', () => { before(async () => { - await esArchiver.load( - 'x-pack/test/saved_object_tagging/common/fixtures/es_archiver/functional_base' + await kibanaServer.importExport.load( + 'x-pack/test/saved_object_tagging/common/fixtures/es_archiver/functional_base/data.json' ); }); after(async () => { - await esArchiver.unload( - 'x-pack/test/saved_object_tagging/common/fixtures/es_archiver/functional_base' + await kibanaServer.importExport.unload( + 'x-pack/test/saved_object_tagging/common/fixtures/es_archiver/functional_base/data.json' ); }); diff --git a/x-pack/test/saved_object_tagging/functional/tests/listing.ts b/x-pack/test/saved_object_tagging/functional/tests/listing.ts index f417e47b33231d..7b2d19095359e1 100644 --- a/x-pack/test/saved_object_tagging/functional/tests/listing.ts +++ b/x-pack/test/saved_object_tagging/functional/tests/listing.ts @@ -10,21 +10,20 @@ import { FtrProviderContext } from '../ftr_provider_context'; // eslint-disable-next-line import/no-default-export export default function ({ getPageObjects, getService }: FtrProviderContext) { - const esArchiver = getService('esArchiver'); + const kibanaServer = getService('kibanaServer'); const PageObjects = getPageObjects(['common', 'security', 'savedObjects', 'tagManagement']); const tagManagementPage = PageObjects.tagManagement; - // Failing: See https://github.com/elastic/kibana/issues/90578 - describe.skip('table listing', () => { + describe('table listing', () => { before(async () => { - await esArchiver.load( - 'x-pack/test/saved_object_tagging/common/fixtures/es_archiver/functional_base' + await kibanaServer.importExport.load( + 'x-pack/test/saved_object_tagging/common/fixtures/es_archiver/functional_base/data.json' ); await tagManagementPage.navigateTo(); }); after(async () => { - await esArchiver.unload( - 'x-pack/test/saved_object_tagging/common/fixtures/es_archiver/functional_base' + await kibanaServer.importExport.unload( + 'x-pack/test/saved_object_tagging/common/fixtures/es_archiver/functional_base/data.json' ); }); diff --git a/x-pack/test/saved_object_tagging/functional/tests/maps_integration.ts b/x-pack/test/saved_object_tagging/functional/tests/maps_integration.ts index 11783bdc04a0c4..13440b3d0cc741 100644 --- a/x-pack/test/saved_object_tagging/functional/tests/maps_integration.ts +++ b/x-pack/test/saved_object_tagging/functional/tests/maps_integration.ts @@ -10,7 +10,7 @@ import { FtrProviderContext } from '../ftr_provider_context'; // eslint-disable-next-line import/no-default-export export default function ({ getPageObjects, getService }: FtrProviderContext) { - const esArchiver = getService('esArchiver'); + const kibanaServer = getService('kibanaServer'); const listingTable = getService('listingTable'); const testSubjects = getService('testSubjects'); const find = getService('find'); @@ -37,10 +37,15 @@ export default function ({ getPageObjects, getService }: FtrProviderContext) { // Failing: See https://github.com/elastic/kibana/issues/89073 describe.skip('maps integration', () => { before(async () => { - await esArchiver.load('x-pack/test/saved_object_tagging/common/fixtures/es_archiver/maps'); + await kibanaServer.importExport.load( + 'x-pack/test/saved_object_tagging/common/fixtures/es_archiver/maps/data.json' + ); }); after(async () => { - await esArchiver.unload('x-pack/test/saved_object_tagging/common/fixtures/es_archiver/maps'); + await kibanaServer.importExport.unload( + 'x-pack/test/saved_object_tagging/common/fixtures/es_archiver/maps/data.json' + ); + await kibanaServer.savedObjects.clean({ types: ['tag'] }); }); describe('listing', () => { diff --git a/x-pack/test/saved_object_tagging/functional/tests/som_integration.ts b/x-pack/test/saved_object_tagging/functional/tests/som_integration.ts index 79f7c74db2a0da..5af0369bff1807 100644 --- a/x-pack/test/saved_object_tagging/functional/tests/som_integration.ts +++ b/x-pack/test/saved_object_tagging/functional/tests/som_integration.ts @@ -10,7 +10,7 @@ import { FtrProviderContext } from '../ftr_provider_context'; // eslint-disable-next-line import/no-default-export export default function ({ getPageObjects, getService }: FtrProviderContext) { - const esArchiver = getService('esArchiver'); + const kibanaServer = getService('kibanaServer'); const testSubjects = getService('testSubjects'); const find = getService('find'); const PageObjects = getPageObjects(['settings', 'tagManagement', 'savedObjects', 'common']); @@ -36,16 +36,15 @@ export default function ({ getPageObjects, getService }: FtrProviderContext) { await testSubjects.click('savedObjectSearchBar'); }; - // FLAKY: https://github.com/elastic/kibana/issues/115320 - describe.skip('saved objects management integration', () => { + describe('saved objects management integration', () => { before(async () => { - await esArchiver.load( - 'x-pack/test/saved_object_tagging/common/fixtures/es_archiver/so_management' + await kibanaServer.importExport.load( + 'x-pack/test/saved_object_tagging/common/fixtures/es_archiver/so_management/data.json' ); }); after(async () => { - await esArchiver.unload( - 'x-pack/test/saved_object_tagging/common/fixtures/es_archiver/so_management' + await kibanaServer.importExport.unload( + 'x-pack/test/saved_object_tagging/common/fixtures/es_archiver/so_management/data.json' ); }); diff --git a/x-pack/test/saved_object_tagging/functional/tests/visualize_integration.ts b/x-pack/test/saved_object_tagging/functional/tests/visualize_integration.ts index 4bd95cd9a7f427..a1059331e33123 100644 --- a/x-pack/test/saved_object_tagging/functional/tests/visualize_integration.ts +++ b/x-pack/test/saved_object_tagging/functional/tests/visualize_integration.ts @@ -11,6 +11,7 @@ import { FtrProviderContext } from '../ftr_provider_context'; // eslint-disable-next-line import/no-default-export export default function ({ getPageObjects, getService }: FtrProviderContext) { const esArchiver = getService('esArchiver'); + const kibanaServer = getService('kibanaServer'); const listingTable = getService('listingTable'); const testSubjects = getService('testSubjects'); const find = getService('find'); @@ -49,17 +50,18 @@ export default function ({ getPageObjects, getService }: FtrProviderContext) { // Failing: See https://github.com/elastic/kibana/issues/89958 describe.skip('visualize integration', () => { before(async () => { - await esArchiver.load( - 'x-pack/test/saved_object_tagging/common/fixtures/es_archiver/visualize' + await kibanaServer.importExport.load( + 'x-pack/test/saved_object_tagging/common/fixtures/es_archiver/visualize/data.json' ); await esArchiver.loadIfNeeded( 'x-pack/test/saved_object_tagging/common/fixtures/es_archiver/logstash_functional' ); }); after(async () => { - await esArchiver.unload( - 'x-pack/test/saved_object_tagging/common/fixtures/es_archiver/visualize' + await kibanaServer.importExport.unload( + 'x-pack/test/saved_object_tagging/common/fixtures/es_archiver/visualize/data.json' ); + await kibanaServer.savedObjects.clean({ types: ['tag'] }); await esArchiver.unload( 'x-pack/test/saved_object_tagging/common/fixtures/es_archiver/logstash_functional' );