-
Notifications
You must be signed in to change notification settings - Fork 114
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Signed-off-by: Junqiu Lei <[email protected]>
- Loading branch information
1 parent
1ceb4c9
commit 14aaac3
Showing
7 changed files
with
142 additions
and
55 deletions.
There are no files selected for viewing
34 changes: 34 additions & 0 deletions
34
cypress/integration/plugins/custom-import-map-dashboards/0_add_saved_object.js
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,34 @@ | ||
/* | ||
* Copyright OpenSearch Contributors | ||
* SPDX-License-Identifier: Apache-2.0 | ||
*/ | ||
|
||
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('Add flights dataset saved object', () => { | ||
before(() => { | ||
CURRENT_TENANT.newTenant = 'global'; | ||
cy.deleteAllIndices(); | ||
miscUtils.addSampleData(); | ||
cy.wait(10000); | ||
}); | ||
|
||
after(() => { | ||
miscUtils.removeSampleData(); | ||
}); | ||
|
||
it('check if maps saved object of flights dataset can be found and open', () => { | ||
cy.visit(`${BASE_PATH}/app/maps-dashboards`); | ||
cy.contains( | ||
'[Flights] Flights Status on Maps Destination Location' | ||
).click(); | ||
cy.get('[data-test-subj="layerControlPanel"]').should( | ||
'contain', | ||
'Flights On Time' | ||
); | ||
}); | ||
}); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
37 changes: 37 additions & 0 deletions
37
cypress/integration/plugins/custom-import-map-dashboards/5_add_map_to_dashboard.spec.js
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,37 @@ | ||
/* | ||
* Copyright OpenSearch Contributors | ||
* SPDX-License-Identifier: Apache-2.0 | ||
*/ | ||
|
||
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('Add map to dashboard', () => { | ||
before(() => { | ||
CURRENT_TENANT.newTenant = 'global'; | ||
cy.deleteAllIndices(); | ||
miscUtils.addSampleData(); | ||
cy.wait(15000); | ||
}); | ||
|
||
it('Add new map to dashboard', () => { | ||
const testMapName = 'saved-map-' + Date.now().toString(); | ||
cy.visit(`${BASE_PATH}/app/dashboards`); | ||
cy.get('[data-test-subj="newItemButton"]').click(); | ||
cy.get('button[data-test-subj="dashboardAddNewPanelButton"]').click(); | ||
cy.get('button[data-test-subj="visType-customImportMap"]').click(); | ||
cy.wait(5000).get('button[data-test-subj="mapSaveButton"]').click(); | ||
cy.wait(5000).get('[data-test-subj="savedObjectTitle"]').type(testMapName); | ||
cy.wait(5000) | ||
.get('[data-test-subj="confirmSaveSavedObjectButton"]') | ||
.click(); | ||
cy.get('.embPanel__titleText').should('contain', testMapName); | ||
}); | ||
|
||
after(() => { | ||
miscUtils.removeSampleData(); | ||
}); | ||
}); |
47 changes: 47 additions & 0 deletions
47
cypress/integration/plugins/custom-import-map-dashboards/6_geojson_file_upload.spec.js
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,47 @@ | ||
/* | ||
* Copyright OpenSearch Contributors | ||
* SPDX-License-Identifier: Apache-2.0 | ||
*/ | ||
|
||
import { BASE_PATH } from '../../../utils/constants'; | ||
import { CURRENT_TENANT } from '../../../utils/commands'; | ||
import { MiscUtils } from '@opensearch-dashboards-test/opensearch-dashboards-test-library'; | ||
|
||
const miscUtils = new MiscUtils(cy); | ||
|
||
describe('Verify successful custom geojson file upload', () => { | ||
before(() => { | ||
CURRENT_TENANT.newTenant = 'global'; | ||
cy.deleteAllIndices(); | ||
miscUtils.addSampleData(); | ||
cy.wait(15000); | ||
|
||
cy.visit(`${BASE_PATH}/app/visualize#/`); | ||
|
||
// Click on "Create Visualization" tab | ||
cy.contains('Create visualization').click({ force: true }); | ||
|
||
// Click on "Region Map" icon | ||
cy.contains('Region Map').click({ force: true }); | ||
|
||
// Select index source - [Flights] Flight Log | ||
cy.contains('[Flights] Flight Log').click({ force: true }); | ||
}); | ||
|
||
it('checks if the file uploaded successfully', () => { | ||
// Click on "Import Vector Map" tab, which is part of customImportMap plugin | ||
cy.contains('Import Vector Map').click({ force: true }); | ||
|
||
cy.get('[data-testId="filePicker"]').attachFile('sample_geojson.json'); | ||
cy.get('[data-testId="customIndex"]').type('sample'); | ||
cy.contains('Import file').click({ force: true }); | ||
cy.contains( | ||
'Successfully added 2 features to sample-map. Refresh to visualize the uploaded map.', | ||
{ timeout: 240000 } | ||
); | ||
}); | ||
|
||
after(() => { | ||
miscUtils.removeSampleData(); | ||
}); | ||
}); |