Skip to content

Commit

Permalink
update data source name and rebase code in maps
Browse files Browse the repository at this point in the history
Signed-off-by: Junqiu Lei <[email protected]>
  • Loading branch information
junqiu-lei committed Mar 15, 2024
1 parent 736a788 commit 00eb393
Show file tree
Hide file tree
Showing 4 changed files with 60 additions and 19 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,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(() => {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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'
Expand All @@ -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();
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -4,34 +4,45 @@
*/

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);
});

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

0 comments on commit 00eb393

Please sign in to comment.