-
Notifications
You must be signed in to change notification settings - Fork 46
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
5cf86b5
commit b75cf16
Showing
17 changed files
with
538 additions
and
95 deletions.
There are no files selected for viewing
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,56 @@ | ||
/* | ||
* Copyright OpenSearch Contributors | ||
* SPDX-License-Identifier: Apache-2.0 | ||
*/ | ||
|
||
import { BASE_PATH } from '../utils/constants'; | ||
|
||
describe('Documents layer', () => { | ||
before(() => { | ||
cy.visit(`${BASE_PATH}/app/home#/tutorial_directory/sampleData`, { | ||
retryOnStatusCodeFailure: true, | ||
timeout: 60000, | ||
}); | ||
cy.get('div[data-test-subj="sampleDataSetCardflights"]', { timeout: 60000 }) | ||
.contains(/(Add|View) data/) | ||
.click(); | ||
cy.wait(60000); | ||
}); | ||
|
||
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({ force: true }); | ||
cy.contains('opensearch_dashboards_sample_data_flights').click(); | ||
cy.contains('Select data field', { timeout: 60000 }).click({ force: true }); | ||
cy.contains('DestLocation').click(); | ||
cy.get('[data-test-subj="indexPatternSelect"]').should( | ||
'contain', | ||
'opensearch_dashboards_sample_data_flights' | ||
); | ||
cy.get('[data-test-subj="geoFieldSelect"]').should('contain', 'DestLocation'); | ||
cy.get(`button[testSubj="styleTab"]`).click(); | ||
cy.contains('Fill color').click(); | ||
cy.get(`button[aria-label="Select #E7664C as the color"]`).click(); | ||
cy.contains('Border color').click(); | ||
cy.get(`button[aria-label="Select #DA8B45 as the color"]`).click(); | ||
cy.get(`button[testSubj="settingsTab"]`).click(); | ||
cy.get('[name="layerName"]').clear().type('Documents layer 1'); | ||
cy.get(`button[data-test-subj="updateButton"]`).click(); | ||
cy.get('[data-test-subj="layerControlPanel"]').should('contain', 'Documents layer 1'); | ||
cy.wait(5000).get('[data-test-subj="top-nav"]').click(); | ||
cy.wait(5000).get('[data-test-subj="savedObjectTitle"]').type(uniqueName); | ||
cy.wait(5000).get('[data-test-subj="confirmSaveSavedObjectButton"]').click(); | ||
}); | ||
|
||
it('Open saved map with documents layer', () => { | ||
cy.visit(`${BASE_PATH}/app/maps-dashboards`); | ||
cy.get('[data-test-subj="mapListingPage"]').should('contain', uniqueName); | ||
cy.contains(uniqueName).click(); | ||
cy.get('[data-test-subj="layerControlPanel"]').should('contain', 'Documents layer 1'); | ||
}); | ||
}); |
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
Oops, something went wrong.