diff --git a/cypress/integration/plugins/custom-import-map-dashboards/import_vector_map_tab.spec.js b/cypress/integration/plugins/custom-import-map-dashboards/1_import_vector_map_tab.spec.js similarity index 80% rename from cypress/integration/plugins/custom-import-map-dashboards/import_vector_map_tab.spec.js rename to cypress/integration/plugins/custom-import-map-dashboards/1_import_vector_map_tab.spec.js index 9fb5bb5be..0099d7960 100644 --- a/cypress/integration/plugins/custom-import-map-dashboards/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,8 +27,11 @@ describe('Verify the presence of import custom map tab in region map plugin', () }); it('checks import custom map tab is present', () => { + cy.wait(10000); // Click on "Import Vector Map" tab, which is part of customImportMap plugin - cy.contains('Import Vector Map').click({ force: true }); + cy.contains('Import Vector Map', { timeout: 120000 }) + .should('be.visible') + .click({ force: true }); }); after(() => { diff --git a/cypress/integration/plugins/custom-import-map-dashboards/opensearchMapLayer.spec.js b/cypress/integration/plugins/custom-import-map-dashboards/2_opensearchMapLayer.spec.js similarity index 79% rename from cypress/integration/plugins/custom-import-map-dashboards/opensearchMapLayer.spec.js rename to cypress/integration/plugins/custom-import-map-dashboards/2_opensearchMapLayer.spec.js index 4792af2a6..f2536f73b 100644 --- a/cypress/integration/plugins/custom-import-map-dashboards/opensearchMapLayer.spec.js +++ b/cypress/integration/plugins/custom-import-map-dashboards/2_opensearchMapLayer.spec.js @@ -4,22 +4,28 @@ */ 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.get('div[data-test-subj="sampleDataSetCardflights"]', { timeout: 60000 }) + cy.wait(5000); + 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.wait(10000); + cy.visit(`${BASE_PATH}/app/maps-dashboards/create`); + cy.wait(10000); cy.get('[data-test-subj="layerControlPanel"]').should( 'contain', 'Default map' @@ -44,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/add_saved_object.spec.js b/cypress/integration/plugins/custom-import-map-dashboards/3_add_saved_object.spec.js similarity index 64% rename from cypress/integration/plugins/custom-import-map-dashboards/add_saved_object.spec.js rename to cypress/integration/plugins/custom-import-map-dashboards/3_add_saved_object.spec.js index 61c172821..2d8b29495 100644 --- a/cypress/integration/plugins/custom-import-map-dashboards/add_saved_object.spec.js +++ b/cypress/integration/plugins/custom-import-map-dashboards/3_add_saved_object.spec.js @@ -4,14 +4,19 @@ */ 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.get('div[data-test-subj="sampleDataSetCardflights"]', { timeout: 60000 }) + cy.wait(5000); + cy.get('div[data-test-subj="sampleDataSetCardflights"]', { + timeout: 60000, + }) .contains(/Add data/) .click(); cy.wait(60000); @@ -19,19 +24,25 @@ describe('Add flights dataset saved object', () => { after(() => { cy.visit(`${BASE_PATH}/app/home#/tutorial_directory`); - cy.get('button[data-test-subj="removeSampleDataSetflights"]') + cy.wait(5000); + cy.get('button[data-test-subj="removeSampleDataSetflights"]', { + timeout: 120000, + }) .should('be.visible') .click(); }); 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.contains( - '[Flights] Flights Status on Maps Destination Location' - ).click(); + cy.wait(10000); + cy.contains('[Flights] Flights Status on Maps Destination Location', { + timeout: 120000, + }).click(); cy.get('[data-test-subj="layerControlPanel"]').should( 'contain', - 'Flights On Time' + 'Flights On Time', + { timeout: 120000 } ); }); }); diff --git a/cypress/integration/plugins/custom-import-map-dashboards/documentsLayer.spec.js b/cypress/integration/plugins/custom-import-map-dashboards/4_documentsLayer.spec.js similarity index 71% rename from cypress/integration/plugins/custom-import-map-dashboards/documentsLayer.spec.js rename to cypress/integration/plugins/custom-import-map-dashboards/4_documentsLayer.spec.js index 55ee30aeb..7ac02ac2c 100644 --- a/cypress/integration/plugins/custom-import-map-dashboards/documentsLayer.spec.js +++ b/cypress/integration/plugins/custom-import-map-dashboards/4_documentsLayer.spec.js @@ -4,14 +4,19 @@ */ 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.get('div[data-test-subj="sampleDataSetCardflights"]', { timeout: 60000 }) + cy.wait(5000); + cy.get('div[data-test-subj="sampleDataSetCardflights"]', { + timeout: 60000, + }) .contains(/(Add|View) data/) .click(); cy.wait(60000); @@ -20,15 +25,22 @@ 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.contains('Create map').click(); - cy.get("button[data-test-subj='addLayerButton']").click(); - cy.contains('Documents').click(); - cy.contains('Select data source', { timeout: 60000 }).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(); + cy.contains('Documents', { timeout: 120000 }).click(); + cy.contains('Select index pattern', { timeout: 120000 }).click({ + force: true, + }); + cy.contains('opensearch_dashboards_sample_data_flights', { + timeout: 120000, + }).click(); + cy.contains('Select data field', { timeout: 120000 }).click({ force: true, }); - cy.wait(5000).contains('opensearch_dashboards_sample_data_flights').click(); - cy.contains('Select data field', { timeout: 60000 }).click({ force: true }); cy.wait(5000).contains('DestLocation').click(); cy.get('[data-test-subj="indexPatternSelect"]').should( 'contain', @@ -61,8 +73,13 @@ describe('Documents layer', () => { }); it('Open saved map with documents layer', () => { + cy.wait(30000); cy.visit(`${BASE_PATH}/app/maps-dashboards`); - cy.get('[data-test-subj="mapListingPage"]').should('contain', uniqueName); + cy.wait(10000); + cy.get('[data-test-subj="mapListingPage"]', { timeout: 120000 }).should( + 'contain', + uniqueName + ); cy.contains(uniqueName).click(); cy.get('[data-test-subj="layerControlPanel"]').should( 'contain', @@ -72,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();