Skip to content

Commit

Permalink
Add more timeout and wait to maps-dashboards (#1073)
Browse files Browse the repository at this point in the history
Signed-off-by: Junqiu Lei <[email protected]>
(cherry picked from commit 09f9f3e)
  • Loading branch information
junqiu-lei authored and github-actions[bot] committed Feb 7, 2024
1 parent 9bd0504 commit 000a99d
Show file tree
Hide file tree
Showing 4 changed files with 25 additions and 6 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -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();

Expand All @@ -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')
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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,
})
Expand All @@ -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'
Expand All @@ -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();
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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,
})
Expand All @@ -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,
})
Expand All @@ -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();
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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,
})
Expand All @@ -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();
Expand Down Expand Up @@ -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
Expand All @@ -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();
Expand Down

0 comments on commit 000a99d

Please sign in to comment.