From 08bc81f1d6e0be66e92530e2df1cacd33f51374d Mon Sep 17 00:00:00 2001 From: Miki Date: Mon, 13 Jan 2025 13:50:16 -0800 Subject: [PATCH] Prepare tests for isolation Signed-off-by: Miki --- .../field_display_filtering.spec.js | 21 ++++++++++--------- .../apps/query_enhancements/queries.spec.js | 18 +++++++++------- 2 files changed, 22 insertions(+), 17 deletions(-) diff --git a/cypress/integration/core-opensearch-dashboards/opensearch-dashboards/apps/query_enhancements/field_display_filtering.spec.js b/cypress/integration/core-opensearch-dashboards/opensearch-dashboards/apps/query_enhancements/field_display_filtering.spec.js index 52a991fdb14..924c8d2ccbf 100644 --- a/cypress/integration/core-opensearch-dashboards/opensearch-dashboards/apps/query_enhancements/field_display_filtering.spec.js +++ b/cypress/integration/core-opensearch-dashboards/opensearch-dashboards/apps/query_enhancements/field_display_filtering.spec.js @@ -221,16 +221,6 @@ ifEnabled(['WORKSPACE', '!SECURITY']).describe('filter for value spec', () => { }); }); - beforeEach(() => { - cy.navigateToWorkSpaceSpecificPage({ - url: BASE_PATH, - workspaceName: `${workspace}`, - page: 'discover', - isEnhancement: true, - }); - cy.getElementByTestId(NEW_SEARCH_BUTTON).click(); - }); - after(() => { cy.deleteWorkspaceByName(`${WORKSPACE_NAME}`); cy.deleteDataSourceByName(`${DATASOURCE_NAME}`); @@ -247,6 +237,17 @@ ifEnabled(['WORKSPACE', '!SECURITY']).describe('filter for value spec', () => { describe(`filter actions in ${name}`, () => { Object.entries(DATASET_CONFIGS).forEach(([type, config]) => { describe(`${type} dataset`, () => { + beforeEach(() => { + cy.navigateToWorkSpaceSpecificPage({ + url: BASE_PATH, + workspaceName: `${workspace}`, + page: 'discover', + isEnhancement: true, + }); + cy.reload(true); + cy.getElementByTestId(NEW_SEARCH_BUTTON).click(); + }); + config.languages.forEach(({ name: language, isFilterButtonsEnabled }) => { it(`${language}`, () => { verifyFn(type, language, isFilterButtonsEnabled); diff --git a/cypress/integration/core-opensearch-dashboards/opensearch-dashboards/apps/query_enhancements/queries.spec.js b/cypress/integration/core-opensearch-dashboards/opensearch-dashboards/apps/query_enhancements/queries.spec.js index b73c811de0c..486317bb58c 100644 --- a/cypress/integration/core-opensearch-dashboards/opensearch-dashboards/apps/query_enhancements/queries.spec.js +++ b/cypress/integration/core-opensearch-dashboards/opensearch-dashboards/apps/query_enhancements/queries.spec.js @@ -47,13 +47,6 @@ ifEnabled(['WORKSPACE', '!SECURITY']).describe( dataSource: DATASOURCE_NAME, isEnhancement: true, }); - - // Go to discover page - cy.navigateToWorkSpaceSpecificPage({ - workspaceName: workspace, - page: 'discover', - isEnhancement: true, - }); }); after(() => { @@ -63,6 +56,17 @@ ifEnabled(['WORKSPACE', '!SECURITY']).describe( }); describe('send queries', () => { + beforeEach(() => { + // Go to discover page + cy.navigateToWorkSpaceSpecificPage({ + workspaceName: workspace, + page: 'discover', + isEnhancement: true, + }); + + cy.reload(true); + }); + it('with DQL', function () { cy.setQueryLanguage('DQL'); cy.setTopNavDate(START_TIME, END_TIME);