From d9dbe42c84944c5164c6a6611e9a59d7b1fce4f8 Mon Sep 17 00:00:00 2001 From: "Qingyang(Abby) Hu" Date: Fri, 25 Oct 2024 02:04:29 -0700 Subject: [PATCH] fix one more test Signed-off-by: Qingyang(Abby) Hu --- .../query_enhancement/dataset_navigator.spec.js | 16 ++++++++++------ 1 file changed, 10 insertions(+), 6 deletions(-) diff --git a/cypress/integration/core-opensearch-dashboards/opensearch-dashboards/apps/query_enhancement/dataset_navigator.spec.js b/cypress/integration/core-opensearch-dashboards/opensearch-dashboards/apps/query_enhancement/dataset_navigator.spec.js index 7b75aef35..a1b2065a0 100644 --- a/cypress/integration/core-opensearch-dashboards/opensearch-dashboards/apps/query_enhancement/dataset_navigator.spec.js +++ b/cypress/integration/core-opensearch-dashboards/opensearch-dashboards/apps/query_enhancement/dataset_navigator.spec.js @@ -45,14 +45,14 @@ describe('dataset navigator', { scrollBehavior: false }, () => { testFixtureHandler.importJSONMapping( 'cypress/fixtures/dashboard/opensearch_dashboards/query_enhancement/mappings.json.txt' ); - + testFixtureHandler.importJSONDoc( 'cypress/fixtures/dashboard/opensearch_dashboards/query_enhancement/data.json.txt' ); - + // Go to the Discover page miscUtils.visitPage(`app/data-explorer/discover#/`); - + cy.waitForLoaderNewHeader(); }); @@ -80,14 +80,12 @@ describe('dataset navigator', { scrollBehavior: false }, () => { cy.waitForLoaderNewHeader(); // Selected language in the language picker should be SQL + // bug: SQL won't be selected in cypress; manually click SQL in language selector // cy.getElementByTestId('queryEditorLanguageSelector').should( // 'contain', // 'SQL' // ); - // The following steps are needed because when selecting SQL, discover loaded with data but the - // multi-line query editor are not loaded properly(it renders a single line query bar) unless we select SQL again - // This bug only exist in cypress test; can not reproduce manually cy.get(`[data-test-subj="queryEditorLanguageSelector"]`).click(); cy.get(`[class~="languageSelector__menuItem"]`) .should('have.length', 2) @@ -168,6 +166,12 @@ describe('dataset navigator', { scrollBehavior: false }, () => { describe('index pattern', () => { it('create index pattern and select it', function () { + // import logstash functional + testFixtureHandler.importJSONDocIfNeeded( + indexSet, + 'cypress/fixtures/dashboard/opensearch_dashboards/data_explorer/logstash/logstash.mappings.json.txt', + 'cypress/fixtures/dashboard/opensearch_dashboards/data_explorer/logstash/logstash.json.txt' + ); testFixtureHandler.importJSONMapping( 'cypress/fixtures/dashboard/opensearch_dashboards/data_explorer/discover/discover.mappings.json.txt' );