From 028a47d627875fd7f3ad4210f05199540b506e30 Mon Sep 17 00:00:00 2001 From: Naveen Tatikonda Date: Wed, 19 Apr 2023 11:26:22 -0500 Subject: [PATCH] Add Cypress test for Default Saved Map (#552) * Add Cypress test for Default Saved Map Signed-off-by: Naveen Tatikonda * Address Review Comments Signed-off-by: Naveen Tatikonda --------- Signed-off-by: Naveen Tatikonda (cherry picked from commit 61766e78a08b377ff1d625921d7b0cb286786f0f) --- .../add_saved_object.spec.js | 39 +++++++++++++++++++ 1 file changed, 39 insertions(+) create mode 100644 cypress/integration/plugins/custom-import-map-dashboards/add_saved_object.spec.js diff --git a/cypress/integration/plugins/custom-import-map-dashboards/add_saved_object.spec.js b/cypress/integration/plugins/custom-import-map-dashboards/add_saved_object.spec.js new file mode 100644 index 000000000..8e79777a5 --- /dev/null +++ b/cypress/integration/plugins/custom-import-map-dashboards/add_saved_object.spec.js @@ -0,0 +1,39 @@ +/* + * Copyright OpenSearch Contributors + * SPDX-License-Identifier: Apache-2.0 + */ + +import { BASE_PATH } from '../../../utils/constants'; + +describe('Add flights dataset saved object', () => { + before(() => { + cy.visit(`${BASE_PATH}/app/maps-dashboards`, { + retryOnStatusCodeFailure: true, + timeout: 60000, + }); + cy.get('div[data-test-subj="indexPatternEmptyState"]', { timeout: 60000 }) + .contains(/Add sample data/) + .click(); + cy.get('div[data-test-subj="sampleDataSetCardflights"]', { timeout: 60000 }) + .contains(/Add data/) + .click(); + }); + + after(() => { + cy.visit(`${BASE_PATH}/app/home#/tutorial_directory`); + cy.get('button[data-test-subj="removeSampleDataSetflights"]') + .should('be.visible') + .click(); + }); + + it('check if maps saved object of flights dataset can be found and open', () => { + cy.visit(`${BASE_PATH}/app/maps-dashboards`); + cy.contains( + '[Flights] Flights Status on Maps Destination Location' + ).click(); + cy.get('[data-test-subj="layerControlPanel"]').should( + 'contain', + 'Flights On Time' + ); + }); +});