From 76ccafbace841cd948ade083620d78dce13918e5 Mon Sep 17 00:00:00 2001 From: Samiul Monir Date: Mon, 18 Nov 2024 09:48:07 -0500 Subject: [PATCH] Updating tests --- .../svl_search_inference_management_page.ts | 4 +++ .../functional/test_suites/search/index.ts | 34 +++++++++---------- .../search/inference_management.ts | 10 +++--- 3 files changed, 27 insertions(+), 21 deletions(-) diff --git a/x-pack/test_serverless/functional/page_objects/svl_search_inference_management_page.ts b/x-pack/test_serverless/functional/page_objects/svl_search_inference_management_page.ts index a21e677877a63..48c6a859de097 100644 --- a/x-pack/test_serverless/functional/page_objects/svl_search_inference_management_page.ts +++ b/x-pack/test_serverless/functional/page_objects/svl_search_inference_management_page.ts @@ -70,6 +70,8 @@ export function SvlSearchInferenceManagementPageProvider({ getService }: FtrProv .then(() => true) .catch(() => false) ); + + await testSubjects.existOrFail('createFirstInferenceEndpointDescription'); }, async expectEndpointWithUsageTobeDelete() { @@ -99,6 +101,8 @@ export function SvlSearchInferenceManagementPageProvider({ getService }: FtrProv .then(() => true) .catch(() => false) ); + + await testSubjects.existOrFail('createFirstInferenceEndpointDescription'); }, async expectToCopyEndpoint() { diff --git a/x-pack/test_serverless/functional/test_suites/search/index.ts b/x-pack/test_serverless/functional/test_suites/search/index.ts index 4a491697c9fca..dd7021aebe800 100644 --- a/x-pack/test_serverless/functional/test_suites/search/index.ts +++ b/x-pack/test_serverless/functional/test_suites/search/index.ts @@ -11,23 +11,23 @@ export default function ({ loadTestFile }: FtrProviderContext) { describe('serverless search UI', function () { this.tags(['esGate']); - // loadTestFile(require.resolve('./navigation')); - // loadTestFile(require.resolve('./elasticsearch_start.ts')); - // loadTestFile(require.resolve('./search_index_detail.ts')); - // loadTestFile(require.resolve('./getting_started')); - // loadTestFile(require.resolve('./index_management')); - // loadTestFile(require.resolve('./connectors/connectors_overview')); - // loadTestFile(require.resolve('./default_dataview')); - // loadTestFile(require.resolve('./pipelines')); - // loadTestFile(require.resolve('./cases/attachment_framework')); - // loadTestFile(require.resolve('./dashboards/build_dashboard')); - // loadTestFile(require.resolve('./dashboards/import_dashboard')); - // loadTestFile(require.resolve('./advanced_settings')); - // loadTestFile(require.resolve('./rules/rule_details')); - // loadTestFile(require.resolve('./console_notebooks')); - // loadTestFile(require.resolve('./search_playground/playground_overview')); - // loadTestFile(require.resolve('./ml')); - // loadTestFile(require.resolve('./custom_role_access')); + loadTestFile(require.resolve('./navigation')); + loadTestFile(require.resolve('./elasticsearch_start.ts')); + loadTestFile(require.resolve('./search_index_detail.ts')); + loadTestFile(require.resolve('./getting_started')); + loadTestFile(require.resolve('./index_management')); + loadTestFile(require.resolve('./connectors/connectors_overview')); + loadTestFile(require.resolve('./default_dataview')); + loadTestFile(require.resolve('./pipelines')); + loadTestFile(require.resolve('./cases/attachment_framework')); + loadTestFile(require.resolve('./dashboards/build_dashboard')); + loadTestFile(require.resolve('./dashboards/import_dashboard')); + loadTestFile(require.resolve('./advanced_settings')); + loadTestFile(require.resolve('./rules/rule_details')); + loadTestFile(require.resolve('./console_notebooks')); + loadTestFile(require.resolve('./search_playground/playground_overview')); + loadTestFile(require.resolve('./ml')); + loadTestFile(require.resolve('./custom_role_access')); loadTestFile(require.resolve('./inference_management')); }); } diff --git a/x-pack/test_serverless/functional/test_suites/search/inference_management.ts b/x-pack/test_serverless/functional/test_suites/search/inference_management.ts index bcdad28e3cb6d..49a0dee5cee4d 100644 --- a/x-pack/test_serverless/functional/test_suites/search/inference_management.ts +++ b/x-pack/test_serverless/functional/test_suites/search/inference_management.ts @@ -36,7 +36,9 @@ export default function ({ getPageObjects, getService }: FtrProviderContext) { await pageObjects.svlCommonPage.loginWithRole('developer'); }); - after(async () => {}); + after(async () => { + await ml.api.cleanMlIndices(); + }); beforeEach(async () => { await svlSearchNavigation.navigateToInferenceManagementPage(); @@ -80,15 +82,15 @@ export default function ({ getPageObjects, getService }: FtrProviderContext) { }); describe('delete action', () => { + const usageIndex = 'elser_index'; beforeEach(async () => { await ml.api.createInferenceEndpoint(endpoint, taskType, modelConfig); await browser.refresh(); }); after(async () => { - await ml.api.deleteIndices('elser_index'); + await ml.api.deleteIndices(usageIndex); await ml.api.deleteIngestPipeline(endpoint); - await ml.api.cleanMlIndices(); }); it('deletes modal successfully without any usage', async () => { @@ -108,7 +110,7 @@ export default function ({ getPageObjects, getService }: FtrProviderContext) { }, }; await ml.api.createIngestPipeline(endpoint); - await ml.api.createIndex('elser_index', indexMapping); + await ml.api.createIndex(usageIndex, indexMapping); await pageObjects.svlSearchInferenceManagementPage.InferenceTabularPage.expectEndpointWithUsageTobeDelete(); });