Skip to content

Commit 00eb393

Browse files
committed
update data source name and rebase code in maps
Signed-off-by: Junqiu Lei <junqiu@amazon.com>
1 parent 736a788 commit 00eb393

File tree

4 files changed

+60
-19
lines changed

4 files changed

+60
-19
lines changed

cypress/integration/plugins/custom-import-map-dashboards/import_vector_map_tab.spec.js cypress/integration/plugins/custom-import-map-dashboards/1_import_vector_map_tab.spec.js

+6-1
Original file line numberDiff line numberDiff line change
@@ -7,10 +7,12 @@
77

88
import { BASE_PATH } from '../../../utils/constants';
99
import { MiscUtils } from '@opensearch-dashboards-test/opensearch-dashboards-test-library';
10+
import { CURRENT_TENANT } from '../../../utils/commands';
1011

1112
const miscUtils = new MiscUtils(cy);
1213
describe('Verify the presence of import custom map tab in region map plugin', () => {
1314
before(() => {
15+
CURRENT_TENANT.newTenant = 'global';
1416
cy.deleteAllIndices();
1517
miscUtils.addSampleData();
1618

@@ -25,8 +27,11 @@ describe('Verify the presence of import custom map tab in region map plugin', ()
2527
});
2628

2729
it('checks import custom map tab is present', () => {
30+
cy.wait(10000);
2831
// Click on "Import Vector Map" tab, which is part of customImportMap plugin
29-
cy.contains('Import Vector Map').click({ force: true });
32+
cy.contains('Import Vector Map', { timeout: 120000 })
33+
.should('be.visible')
34+
.click({ force: true });
3035
});
3136

3237
after(() => {

cypress/integration/plugins/custom-import-map-dashboards/opensearchMapLayer.spec.js cypress/integration/plugins/custom-import-map-dashboards/2_opensearchMapLayer.spec.js

+10-3
Original file line numberDiff line numberDiff line change
@@ -4,22 +4,28 @@
44
*/
55

66
import { BASE_PATH } from '../../../utils/constants';
7+
import { CURRENT_TENANT } from '../../../utils/commands';
78

89
describe('Default OpenSearch base map layer', () => {
910
before(() => {
11+
CURRENT_TENANT.newTenant = 'global';
1012
cy.visit(`${BASE_PATH}/app/home#/tutorial_directory/sampleData`, {
1113
retryOnStatusCodeFailure: true,
1214
timeout: 60000,
1315
});
14-
cy.get('div[data-test-subj="sampleDataSetCardflights"]', { timeout: 60000 })
16+
cy.wait(5000);
17+
cy.get('div[data-test-subj="sampleDataSetCardflights"]', {
18+
timeout: 60000,
19+
})
1520
.contains(/(Add|View) data/)
1621
.click();
1722
cy.wait(60000);
1823
});
1924

2025
it('check if default OpenSearch map layer can be open', () => {
21-
cy.visit(`${BASE_PATH}/app/maps-dashboards`);
22-
cy.contains('Create map').click();
26+
cy.wait(10000);
27+
cy.visit(`${BASE_PATH}/app/maps-dashboards/create`);
28+
cy.wait(10000);
2329
cy.get('[data-test-subj="layerControlPanel"]').should(
2430
'contain',
2531
'Default map'
@@ -44,6 +50,7 @@ describe('Default OpenSearch base map layer', () => {
4450

4551
after(() => {
4652
cy.visit(`${BASE_PATH}/app/home#/tutorial_directory`);
53+
cy.wait(5000);
4754
cy.get('button[data-test-subj="removeSampleDataSetflights"]')
4855
.should('be.visible')
4956
.click();

cypress/integration/plugins/custom-import-map-dashboards/add_saved_object.spec.js cypress/integration/plugins/custom-import-map-dashboards/3_add_saved_object.spec.js

+17-6
Original file line numberDiff line numberDiff line change
@@ -4,34 +4,45 @@
44
*/
55

66
import { BASE_PATH } from '../../../utils/constants';
7+
import { CURRENT_TENANT } from '../../../utils/commands';
78

89
describe('Add flights dataset saved object', () => {
910
before(() => {
11+
CURRENT_TENANT.newTenant = 'global';
1012
cy.visit(`${BASE_PATH}/app/home#/tutorial_directory/sampleData`, {
1113
retryOnStatusCodeFailure: true,
1214
timeout: 60000,
1315
});
14-
cy.get('div[data-test-subj="sampleDataSetCardflights"]', { timeout: 60000 })
16+
cy.wait(5000);
17+
cy.get('div[data-test-subj="sampleDataSetCardflights"]', {
18+
timeout: 60000,
19+
})
1520
.contains(/Add data/)
1621
.click();
1722
cy.wait(60000);
1823
});
1924

2025
after(() => {
2126
cy.visit(`${BASE_PATH}/app/home#/tutorial_directory`);
22-
cy.get('button[data-test-subj="removeSampleDataSetflights"]')
27+
cy.wait(5000);
28+
cy.get('button[data-test-subj="removeSampleDataSetflights"]', {
29+
timeout: 120000,
30+
})
2331
.should('be.visible')
2432
.click();
2533
});
2634

2735
it('check if maps saved object of flights dataset can be found and open', () => {
36+
cy.wait(10000);
2837
cy.visit(`${BASE_PATH}/app/maps-dashboards`);
29-
cy.contains(
30-
'[Flights] Flights Status on Maps Destination Location'
31-
).click();
38+
cy.wait(10000);
39+
cy.contains('[Flights] Flights Status on Maps Destination Location', {
40+
timeout: 120000,
41+
}).click();
3242
cy.get('[data-test-subj="layerControlPanel"]').should(
3343
'contain',
34-
'Flights On Time'
44+
'Flights On Time',
45+
{ timeout: 120000 }
3546
);
3647
});
3748
});

cypress/integration/plugins/custom-import-map-dashboards/documentsLayer.spec.js cypress/integration/plugins/custom-import-map-dashboards/4_documentsLayer.spec.js

+27-9
Original file line numberDiff line numberDiff line change
@@ -4,14 +4,19 @@
44
*/
55

66
import { BASE_PATH } from '../../../utils/constants';
7+
import { CURRENT_TENANT } from '../../../utils/commands';
78

89
describe('Documents layer', () => {
910
before(() => {
11+
CURRENT_TENANT.newTenant = 'global';
1012
cy.visit(`${BASE_PATH}/app/home#/tutorial_directory/sampleData`, {
1113
retryOnStatusCodeFailure: true,
1214
timeout: 60000,
1315
});
14-
cy.get('div[data-test-subj="sampleDataSetCardflights"]', { timeout: 60000 })
16+
cy.wait(5000);
17+
cy.get('div[data-test-subj="sampleDataSetCardflights"]', {
18+
timeout: 60000,
19+
})
1520
.contains(/(Add|View) data/)
1621
.click();
1722
cy.wait(60000);
@@ -20,15 +25,22 @@ describe('Documents layer', () => {
2025
const uniqueName = 'saved-map-' + Date.now().toString();
2126

2227
it('Add new documents layer with configuration', () => {
23-
cy.visit(`${BASE_PATH}/app/maps-dashboards`);
24-
cy.contains('Create map').click();
25-
cy.get("button[data-test-subj='addLayerButton']").click();
26-
cy.contains('Documents').click();
27-
cy.contains('Select data source', { timeout: 60000 }).click({
28+
cy.wait(10000);
29+
cy.visit(`${BASE_PATH}/app/maps-dashboards/create`);
30+
cy.wait(10000);
31+
cy.get("button[data-test-subj='addLayerButton']", {
32+
timeout: 120000,
33+
}).click();
34+
cy.contains('Documents', { timeout: 120000 }).click();
35+
cy.contains('Select index pattern', { timeout: 120000 }).click({
36+
force: true,
37+
});
38+
cy.contains('opensearch_dashboards_sample_data_flights', {
39+
timeout: 120000,
40+
}).click();
41+
cy.contains('Select data field', { timeout: 120000 }).click({
2842
force: true,
2943
});
30-
cy.wait(5000).contains('opensearch_dashboards_sample_data_flights').click();
31-
cy.contains('Select data field', { timeout: 60000 }).click({ force: true });
3244
cy.wait(5000).contains('DestLocation').click();
3345
cy.get('[data-test-subj="indexPatternSelect"]').should(
3446
'contain',
@@ -61,8 +73,13 @@ describe('Documents layer', () => {
6173
});
6274

6375
it('Open saved map with documents layer', () => {
76+
cy.wait(30000);
6477
cy.visit(`${BASE_PATH}/app/maps-dashboards`);
65-
cy.get('[data-test-subj="mapListingPage"]').should('contain', uniqueName);
78+
cy.wait(10000);
79+
cy.get('[data-test-subj="mapListingPage"]', { timeout: 120000 }).should(
80+
'contain',
81+
uniqueName
82+
);
6683
cy.contains(uniqueName).click();
6784
cy.get('[data-test-subj="layerControlPanel"]').should(
6885
'contain',
@@ -72,6 +89,7 @@ describe('Documents layer', () => {
7289

7390
after(() => {
7491
cy.visit(`${BASE_PATH}/app/home#/tutorial_directory`);
92+
cy.wait(5000);
7593
cy.get('button[data-test-subj="removeSampleDataSetflights"]')
7694
.should('be.visible')
7795
.click();

0 commit comments

Comments
 (0)