From e785ea6eff15e8adc2b72fda146b4468a9574334 Mon Sep 17 00:00:00 2001 From: Junqiu Lei Date: Tue, 6 Feb 2024 12:14:14 -0800 Subject: [PATCH] Add more timeout and wait to maps-dashboards Signed-off-by: Junqiu Lei --- .../1_import_vector_map_tab.spec.js | 4 +++- .../2_opensearchMapLayer.spec.js | 9 +++++++-- .../3_add_saved_object.spec.js | 6 ++++++ .../4_documentsLayer.spec.js | 12 +++++++++--- 4 files changed, 25 insertions(+), 6 deletions(-) diff --git a/cypress/integration/plugins/custom-import-map-dashboards/1_import_vector_map_tab.spec.js b/cypress/integration/plugins/custom-import-map-dashboards/1_import_vector_map_tab.spec.js index 1a6589675..0099d7960 100644 --- a/cypress/integration/plugins/custom-import-map-dashboards/1_import_vector_map_tab.spec.js +++ b/cypress/integration/plugins/custom-import-map-dashboards/1_import_vector_map_tab.spec.js @@ -7,10 +7,12 @@ import { BASE_PATH } from '../../../utils/constants'; import { MiscUtils } from '@opensearch-dashboards-test/opensearch-dashboards-test-library'; +import { CURRENT_TENANT } from '../../../utils/commands'; const miscUtils = new MiscUtils(cy); describe('Verify the presence of import custom map tab in region map plugin', () => { before(() => { + CURRENT_TENANT.newTenant = 'global'; cy.deleteAllIndices(); miscUtils.addSampleData(); @@ -25,7 +27,7 @@ describe('Verify the presence of import custom map tab in region map plugin', () }); it('checks import custom map tab is present', () => { - cy.wait(5000); + cy.wait(10000); // Click on "Import Vector Map" tab, which is part of customImportMap plugin cy.contains('Import Vector Map', { timeout: 120000 }) .should('be.visible') diff --git a/cypress/integration/plugins/custom-import-map-dashboards/2_opensearchMapLayer.spec.js b/cypress/integration/plugins/custom-import-map-dashboards/2_opensearchMapLayer.spec.js index 97fd52e2d..f2536f73b 100644 --- a/cypress/integration/plugins/custom-import-map-dashboards/2_opensearchMapLayer.spec.js +++ b/cypress/integration/plugins/custom-import-map-dashboards/2_opensearchMapLayer.spec.js @@ -4,13 +4,16 @@ */ import { BASE_PATH } from '../../../utils/constants'; +import { CURRENT_TENANT } from '../../../utils/commands'; describe('Default OpenSearch base map layer', () => { before(() => { + CURRENT_TENANT.newTenant = 'global'; cy.visit(`${BASE_PATH}/app/home#/tutorial_directory/sampleData`, { retryOnStatusCodeFailure: true, timeout: 60000, }); + cy.wait(5000); cy.get('div[data-test-subj="sampleDataSetCardflights"]', { timeout: 60000, }) @@ -20,8 +23,9 @@ describe('Default OpenSearch base map layer', () => { }); it('check if default OpenSearch map layer can be open', () => { - cy.visit(`${BASE_PATH}/app/maps-dashboards`); - cy.contains('Create map', { timeout: 120000 }).click(); + cy.wait(10000); + cy.visit(`${BASE_PATH}/app/maps-dashboards/create`); + cy.wait(10000); cy.get('[data-test-subj="layerControlPanel"]').should( 'contain', 'Default map' @@ -46,6 +50,7 @@ describe('Default OpenSearch base map layer', () => { after(() => { cy.visit(`${BASE_PATH}/app/home#/tutorial_directory`); + cy.wait(5000); cy.get('button[data-test-subj="removeSampleDataSetflights"]') .should('be.visible') .click(); diff --git a/cypress/integration/plugins/custom-import-map-dashboards/3_add_saved_object.spec.js b/cypress/integration/plugins/custom-import-map-dashboards/3_add_saved_object.spec.js index ff5e868e8..2d8b29495 100644 --- a/cypress/integration/plugins/custom-import-map-dashboards/3_add_saved_object.spec.js +++ b/cypress/integration/plugins/custom-import-map-dashboards/3_add_saved_object.spec.js @@ -4,13 +4,16 @@ */ import { BASE_PATH } from '../../../utils/constants'; +import { CURRENT_TENANT } from '../../../utils/commands'; describe('Add flights dataset saved object', () => { before(() => { + CURRENT_TENANT.newTenant = 'global'; cy.visit(`${BASE_PATH}/app/home#/tutorial_directory/sampleData`, { retryOnStatusCodeFailure: true, timeout: 60000, }); + cy.wait(5000); cy.get('div[data-test-subj="sampleDataSetCardflights"]', { timeout: 60000, }) @@ -21,6 +24,7 @@ describe('Add flights dataset saved object', () => { after(() => { cy.visit(`${BASE_PATH}/app/home#/tutorial_directory`); + cy.wait(5000); cy.get('button[data-test-subj="removeSampleDataSetflights"]', { timeout: 120000, }) @@ -29,7 +33,9 @@ describe('Add flights dataset saved object', () => { }); it('check if maps saved object of flights dataset can be found and open', () => { + cy.wait(10000); cy.visit(`${BASE_PATH}/app/maps-dashboards`); + cy.wait(10000); cy.contains('[Flights] Flights Status on Maps Destination Location', { timeout: 120000, }).click(); diff --git a/cypress/integration/plugins/custom-import-map-dashboards/4_documentsLayer.spec.js b/cypress/integration/plugins/custom-import-map-dashboards/4_documentsLayer.spec.js index 9659ef190..65b637d18 100644 --- a/cypress/integration/plugins/custom-import-map-dashboards/4_documentsLayer.spec.js +++ b/cypress/integration/plugins/custom-import-map-dashboards/4_documentsLayer.spec.js @@ -4,13 +4,16 @@ */ import { BASE_PATH } from '../../../utils/constants'; +import { CURRENT_TENANT } from '../../../utils/commands'; describe('Documents layer', () => { before(() => { + CURRENT_TENANT.newTenant = 'global'; cy.visit(`${BASE_PATH}/app/home#/tutorial_directory/sampleData`, { retryOnStatusCodeFailure: true, timeout: 60000, }); + cy.wait(5000); cy.get('div[data-test-subj="sampleDataSetCardflights"]', { timeout: 60000, }) @@ -22,9 +25,9 @@ describe('Documents layer', () => { const uniqueName = 'saved-map-' + Date.now().toString(); it('Add new documents layer with configuration', () => { - cy.visit(`${BASE_PATH}/app/maps-dashboards`); - cy.wait(5000); - cy.contains('Create map', { timeout: 120000 }).click(); + cy.wait(10000); + cy.visit(`${BASE_PATH}/app/maps-dashboards/create`); + cy.wait(10000); cy.get("button[data-test-subj='addLayerButton']", { timeout: 120000, }).click(); @@ -70,7 +73,9 @@ describe('Documents layer', () => { }); it('Open saved map with documents layer', () => { + cy.wait(30000); cy.visit(`${BASE_PATH}/app/maps-dashboards`); + cy.wait(10000); cy.get('[data-test-subj="mapListingPage"]', { timeout: 120000 }).should( 'contain', uniqueName @@ -84,6 +89,7 @@ describe('Documents layer', () => { after(() => { cy.visit(`${BASE_PATH}/app/home#/tutorial_directory`); + cy.wait(5000); cy.get('button[data-test-subj="removeSampleDataSetflights"]') .should('be.visible') .click();