From 889d1bad23d9c130f8275ee8234e26afd972f184 Mon Sep 17 00:00:00 2001 From: Robert Oskamp Date: Wed, 3 May 2023 10:19:44 +0200 Subject: [PATCH] [ML] Functional tests - stabilize and re-enable export jobs tests (#152334) This PR re-enables the export job tests and the reporting download tests after the underlying issues has been fixed by switching to the new headless browser mode. (cherry picked from commit a90f4c24dac8d6d23105e1a5119c36634aa27f42) --- .../apps/dashboard/group3/reporting/download_csv.ts | 7 +------ .../apps/ml/stack_management_jobs/export_jobs.ts | 5 +++-- .../test/functional/services/ml/stack_management_jobs.ts | 2 +- 3 files changed, 5 insertions(+), 9 deletions(-) diff --git a/x-pack/test/functional/apps/dashboard/group3/reporting/download_csv.ts b/x-pack/test/functional/apps/dashboard/group3/reporting/download_csv.ts index 3ce3f9a7b9f36..d062eb8feb432 100644 --- a/x-pack/test/functional/apps/dashboard/group3/reporting/download_csv.ts +++ b/x-pack/test/functional/apps/dashboard/group3/reporting/download_csv.ts @@ -67,12 +67,7 @@ export default function ({ getService, getPageObjects }: FtrProviderContext) { await testSubjects.existOrFail('csvDownloadStarted'); // validate toast panel }; - // Failing: See https://github.com/elastic/kibana/issues/150561 - // Failing: See https://github.com/elastic/kibana/issues/150562 - // Failing: See https://github.com/elastic/kibana/issues/148314 - // Failing: See https://github.com/elastic/kibana/issues/150563 - // Failing: See https://github.com/elastic/kibana/issues/150561 - describe.skip('Download CSV', () => { + describe('Download CSV', () => { before('initialize tests', async () => { log.debug('ReportingPage:initTests'); await browser.setWindowSize(1600, 850); diff --git a/x-pack/test/functional/apps/ml/stack_management_jobs/export_jobs.ts b/x-pack/test/functional/apps/ml/stack_management_jobs/export_jobs.ts index 6ec33c155a813..1a95d0cb9caab 100644 --- a/x-pack/test/functional/apps/ml/stack_management_jobs/export_jobs.ts +++ b/x-pack/test/functional/apps/ml/stack_management_jobs/export_jobs.ts @@ -251,9 +251,9 @@ export default function ({ getService }: FtrProviderContext) { const esArchiver = getService('esArchiver'); const ml = getService('ml'); - // Failing: See https://github.com/elastic/kibana/issues/150557 - describe.skip('export jobs', function () { + describe('export jobs', function () { this.tags(['ml']); + before(async () => { await ml.api.cleanMlIndices(); await esArchiver.loadIfNeeded('x-pack/test/functional/es_archives/ml/farequote'); @@ -282,6 +282,7 @@ export default function ({ getService }: FtrProviderContext) { await ml.navigation.navigateToStackManagement(); await ml.navigation.navigateToStackManagementJobsListPage(); }); + after(async () => { await ml.api.cleanMlIndices(); ml.stackManagementJobs.deleteExportedFiles([ diff --git a/x-pack/test/functional/services/ml/stack_management_jobs.ts b/x-pack/test/functional/services/ml/stack_management_jobs.ts index 48a783de58389..67daafb108868 100644 --- a/x-pack/test/functional/services/ml/stack_management_jobs.ts +++ b/x-pack/test/functional/services/ml/stack_management_jobs.ts @@ -327,7 +327,7 @@ export function MachineLearningStackManagementJobsProvider({ async getDownload(filePath: string) { return retry.tryForTime(5000, async () => { - expect(fs.existsSync(filePath)).to.be(true); + expect(fs.existsSync(filePath)).to.eql(true, `File path ${filePath} should exist`); return fs.readFileSync(filePath).toString(); }); },