From b5bdf48b98b163e26f077ae5c1ebb53c0bd0c5f0 Mon Sep 17 00:00:00 2001 From: Junqiu Lei Date: Wed, 20 Sep 2023 12:55:34 -0500 Subject: [PATCH] Ignore the flaky test of opensearchMapLayer when security enabled (#884) Ignore the flaky test of opensearchMapLayer when security enabled Issues Resolved #883 Signed-off-by: Junqiu Lei --- .../opensearchMapLayer.spec.js | 82 ++++++++++--------- 1 file changed, 43 insertions(+), 39 deletions(-) diff --git a/cypress/integration/plugins/custom-import-map-dashboards/opensearchMapLayer.spec.js b/cypress/integration/plugins/custom-import-map-dashboards/opensearchMapLayer.spec.js index 4792af2a6..f27ea1829 100644 --- a/cypress/integration/plugins/custom-import-map-dashboards/opensearchMapLayer.spec.js +++ b/cypress/integration/plugins/custom-import-map-dashboards/opensearchMapLayer.spec.js @@ -5,47 +5,51 @@ import { BASE_PATH } from '../../../utils/constants'; -describe('Default OpenSearch base map layer', () => { - before(() => { - cy.visit(`${BASE_PATH}/app/home#/tutorial_directory/sampleData`, { - retryOnStatusCodeFailure: true, - timeout: 60000, +if (!Cypress.env('SECURITY_ENABLED')) { + describe('Default OpenSearch base map layer', () => { + before(() => { + cy.visit(`${BASE_PATH}/app/home#/tutorial_directory/sampleData`, { + retryOnStatusCodeFailure: true, + timeout: 60000, + }); + cy.get('div[data-test-subj="sampleDataSetCardflights"]', { + timeout: 60000, + }) + .contains(/(Add|View) data/) + .click(); + cy.wait(60000); }); - cy.get('div[data-test-subj="sampleDataSetCardflights"]', { timeout: 60000 }) - .contains(/(Add|View) data/) - .click(); - cy.wait(60000); - }); - it('check if default OpenSearch map layer can be open', () => { - cy.visit(`${BASE_PATH}/app/maps-dashboards`); - cy.contains('Create map').click(); - cy.get('[data-test-subj="layerControlPanel"]').should( - 'contain', - 'Default map' - ); - cy.get('canvas.maplibregl-canvas').trigger('mousemove', { - x: 100, - y: 100, - force: true, - }); - cy.get('canvas.maplibregl-canvas').trigger('mousemove', { - x: 200, - y: 200, - force: true, + it('check if default OpenSearch map layer can be open', () => { + cy.visit(`${BASE_PATH}/app/maps-dashboards`); + cy.contains('Create map').click(); + cy.get('[data-test-subj="layerControlPanel"]').should( + 'contain', + 'Default map' + ); + cy.get('canvas.maplibregl-canvas').trigger('mousemove', { + x: 100, + y: 100, + force: true, + }); + cy.get('canvas.maplibregl-canvas').trigger('mousemove', { + x: 200, + y: 200, + force: true, + }); + for (let i = 0; i < 21; i++) { + cy.wait(1000) + .get('canvas.maplibregl-canvas') + .trigger('dblclick', { force: true }); + } + cy.get('[data-test-subj="mapStatusBar"]').should('contain', 'zoom: 22'); }); - for (let i = 0; i < 21; i++) { - cy.wait(1000) - .get('canvas.maplibregl-canvas') - .trigger('dblclick', { force: true }); - } - cy.get('[data-test-subj="mapStatusBar"]').should('contain', 'zoom: 22'); - }); - after(() => { - cy.visit(`${BASE_PATH}/app/home#/tutorial_directory`); - cy.get('button[data-test-subj="removeSampleDataSetflights"]') - .should('be.visible') - .click(); + after(() => { + cy.visit(`${BASE_PATH}/app/home#/tutorial_directory`); + cy.get('button[data-test-subj="removeSampleDataSetflights"]') + .should('be.visible') + .click(); + }); }); -}); +}