Skip to content

Commit

Permalink
Merge branch 'main' into main
Browse files Browse the repository at this point in the history
  • Loading branch information
SuZhou-Joe authored Sep 3, 2024
2 parents 5c89d4b + 34ba5be commit 4828655
Show file tree
Hide file tree
Showing 27 changed files with 358 additions and 95 deletions.
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
{
"type": "FeatureCollection",
"name": "sample",
"features": [
{ "type": "Feature", "properties": { "iso2": "IN", "iso3": "IND", "name": "Abc" }, "geometry": { "type": "MultiPolygon", "coordinates": [[[[70.6640625,39.639537564366684],[69.78515625,37.020098201368114],[69.60937499999999,33.7243396617476],[69.9609375,29.99300228455108],[69.2578125,27.839076094777816],[69.60937499999999,26.588527147308614],[70.6640625,25.799891182088334],[70.13671875,24.206889622398023],[67.67578124999999,23.885837699862005],[69.78515625,21.616579336740603],[73.30078125,17.644022027872726],[75.76171875,13.581920900545844],[76.2890625,10.487811882056695],[77.51953125,8.233237111274565],[79.453125,11.178401873711785],[80.15625,16.97274101999902],[85.78125,19.973348786110602],[90.703125,21.616579336740603],[95.80078125,21.616579336740603],[96.85546875,26.27371402440643],[97.3828125,28.613459424004414],[92.98828125,30.14512718337613],[88.9453125,29.6880527498568],[83.84765625,30.14512718337613],[80.33203125,34.161818161230386],[81.2109375,37.020098201368114],[76.2890625,38.272688535980976],[71.54296874999999,39.774769485295465],[70.6640625,39.639537564366684]]]] } },
{ "type": "Feature", "properties": { "iso2": "CN", "iso3": "CHN", "name": "Xyz" }, "geometry": { "type": "MultiPolygon", "coordinates": [[ [ [ 113.36476, 22.1579 ], [ 113.35401, 22.13085 ], [ 113.33619, 22.10049 ], [ 113.31365, 22.0764 ], [ 113.28907, 22.06851 ], [ 113.27914, 22.07469 ], [ 113.26881, 22.08832 ], [ 113.26417, 22.10493 ], [ 113.27174, 22.12002 ], [ 113.27914, 22.1232 ], [ 113.28972, 22.12547 ], [ 113.29868, 22.12857 ], [ 113.30274, 22.13398 ], [ 113.30421, 22.14183 ], [ 113.30844, 22.14863 ], [ 113.31495, 22.154 ], [ 113.32309, 22.1579 ], [ 113.32797, 22.14582 ], [ 113.33546, 22.14887 ], [ 113.34718, 22.15644 ], [ 113.36476, 22.1579 ] ] ], [ [ [ 113.59352, 22.78482 ], [ 113.60288, 22.77245 ], [ 113.60279, 22.76264 ], [ 113.59457, 22.75609 ], [ 113.57984, 22.75373 ], [ 113.55828, 22.75788 ], [ 113.54461, 22.76878 ], [ 113.53566, 22.78433 ], [ 113.52858, 22.80215 ], [ 113.52117, 22.78791 ], [ 113.50611, 22.79804 ], [ 113.49529, 22.81387 ], [ 113.4808, 22.84931 ], [ 113.47397, 22.84931 ], [ 113.47316, 22.82538 ], [ 113.4559, 22.83076 ], [ 113.43409, 22.84907 ], [ 113.40211, 22.88288 ], [ 113.39617, 22.8981 ], [ 113.40512, 22.90811 ], [ 113.43295, 22.91201 ], [ 113.4756, 22.9007 ], [ 113.4878, 22.89281 ], [ 113.52703, 22.84663 ], [ 113.54672, 22.83487 ], [ 113.57301, 22.83006 ], [ 113.57643, 22.82392 ], [ 113.58766, 22.79462 ], [ 113.59352, 22.78482 ] ] ] ] } }
]
}
Original file line number Diff line number Diff line change
Expand Up @@ -11,11 +11,5 @@
"type": "text"
}
}
},
"settings": {
"index": {
"number_of_shards": "1",
"number_of_replicas": "1"
}
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -8,11 +8,5 @@
"type": "text"
}
}
},
"settings": {
"index": {
"number_of_shards": "1",
"number_of_replicas": "1"
}
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -11,11 +11,5 @@
"type": "text"
}
}
},
"settings": {
"index": {
"number_of_shards": "1",
"number_of_replicas": "1"
}
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -29,11 +29,5 @@
"type": "text"
}
}
},
"settings": {
"index": {
"number_of_shards": "1",
"number_of_replicas": "1"
}
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -8,11 +8,5 @@
"type": "text"
}
}
},
"settings": {
"index": {
"number_of_shards": "1",
"number_of_replicas": "1"
}
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,7 @@ context('Create detector workflow', () => {

// Index some sample data first
beforeEach(() => {
cy.visit(AD_URL.OVERVIEW, { timeout: 10000 });
cy.deleteAllIndices();
cy.deleteADSystemIndices();
cy.fixture(AD_FIXTURE_BASE_PATH + 'sample_test_data.txt').then((data) => {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,7 @@ context('Detector configuration page', () => {
// Creating a sample detector and visiting the config page. Stopping the detector
// for easier checks when editing detector
before(() => {
cy.visit(AD_URL.OVERVIEW, { timeout: 10000 });
cy.deleteAllIndices();
cy.deleteADSystemIndices();
cy.visit(AD_URL.OVERVIEW);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -52,10 +52,12 @@ describe('Historical results page', () => {

// Creating a sample detector and visiting the config page
before(() => {
cy.visit(AD_URL.OVERVIEW, { timeout: 10000 });
cy.deleteAllIndices();
cy.deleteADSystemIndices();
cy.wait(5000);
cy.visit(AD_URL.OVERVIEW);
cy.visit(AD_URL.OVERVIEW, { timeout: 10000 });
cy.wait(2000);
cy.get('[data-test-subj=createHttpSampleDetectorButton]').then(() => {
cy.getElementByTestId('createHttpSampleDetectorButton').click();
cy.wait(10000);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
* SPDX-License-Identifier: Apache-2.0
*/

import { AD_URL } from '../../../utils/constants';
import { AD_URL } from '../../../utils/plugins/anomaly-detection-dashboards-plugin/constants';

context('Overview page', () => {
function validatePageElements() {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -4,8 +4,12 @@
*/

import { createSampleDetector } from '../../../utils/helpers';
import { AD_URL } from '../../../utils/plugins/anomaly-detection-dashboards-plugin/constants';

context('Sample detectors', () => {
before(() => {
cy.visit(AD_URL.OVERVIEW, { timeout: 10000 });
});
beforeEach(() => {
cy.deleteAllIndices();
cy.deleteADSystemIndices();
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,7 @@ import {
INDEX_SETTINGS_FILEPATH_SIMPLE,
SAMPLE_DATA_FILEPATH_SIMPLE,
} from '../../../../utils/constants';
import { AD_URL } from '../../../../utils/plugins/anomaly-detection-dashboards-plugin/constants';

describe('Anomaly detection integration with vis augmenter', () => {
const indexName = 'ad-vis-augmenter-sample-index';
Expand Down Expand Up @@ -51,6 +52,7 @@ describe('Anomaly detection integration with vis augmenter', () => {
dashboardName,
[visualizationSpec]
);
cy.visit(AD_URL.OVERVIEW, { timeout: 10000 });
});

after(() => {
Expand Down Expand Up @@ -88,7 +90,7 @@ describe('Anomaly detection integration with vis augmenter', () => {
it('Associate existing detector - creation flow', () => {
openAddAnomalyDetectorFlyout(dashboardName, visualizationName);

cy.get('.euiFlyout').find('.euiTitle').contains('Add anomaly detector');
cy.get('.euiFlyout').find('.euiText').contains('Add anomaly detector');
// ensuring the flyout is defaulting to detector creation vs. association
cy.getElementByTestId('adAnywhereCreateDetectorButton');
cy.get('[id="add-anomaly-detector__existing"]').click();
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,7 @@ import {
INDEX_SETTINGS_FILEPATH_SIMPLE,
SAMPLE_DATA_FILEPATH_SIMPLE,
} from '../../../../utils/constants';
import { AD_URL } from '../../../../utils/plugins/anomaly-detection-dashboards-plugin/constants';

describe('AD augment-vis saved objects', () => {
const commonUI = new CommonUI(cy);
Expand Down Expand Up @@ -50,6 +51,7 @@ describe('AD augment-vis saved objects', () => {
dashboardName,
[visualizationSpec]
);
cy.visit(AD_URL.OVERVIEW, { timeout: 10000 });
});

after(() => {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,7 @@ import {
INDEX_SETTINGS_FILEPATH_SIMPLE,
SAMPLE_DATA_FILEPATH_SIMPLE,
} from '../../../../utils/constants';
import { AD_URL } from '../../../../utils/plugins/anomaly-detection-dashboards-plugin/constants';

describe('View anomaly events in flyout', () => {
const indexName = 'ad-vis-augmenter-sample-index';
Expand Down Expand Up @@ -48,6 +49,7 @@ describe('View anomaly events in flyout', () => {
dashboardName,
[visualizationSpec]
);
cy.visit(AD_URL.OVERVIEW, { timeout: 10000 });
});

after(() => {
Expand Down
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'
);
});
});
Original file line number Diff line number Diff line change
Expand Up @@ -6,15 +6,17 @@
/// <reference types="cypress" />

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

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();
cy.wait(15000);

// Load region map visualization with sample data opensearch_dashboards_sample_data_flights
cy.visit(
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -5,21 +5,16 @@

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('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,
})
.contains(/(Add|View) data/)
.click();
cy.wait(60000);
cy.deleteAllIndices();
miscUtils.addSampleData();
cy.wait(15000);
});

it('check if default OpenSearch map layer can be open', () => {
Expand Down Expand Up @@ -49,10 +44,6 @@ 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();
miscUtils.removeSampleData();
});
});
Original file line number Diff line number Diff line change
Expand Up @@ -5,31 +5,20 @@

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('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,
})
.contains(/Add data/)
.click();
cy.wait(60000);
cy.deleteAllIndices();
miscUtils.addSampleData();
cy.wait(15000);
});

after(() => {
cy.visit(`${BASE_PATH}/app/home#/tutorial_directory`);
cy.wait(5000);
cy.get('button[data-test-subj="removeSampleDataSetflights"]', {
timeout: 120000,
})
.should('be.visible')
.click();
miscUtils.removeSampleData();
});

it('check if maps saved object of flights dataset can be found and open', () => {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -5,21 +5,16 @@

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('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,
})
.contains(/(Add|View) data/)
.click();
cy.wait(60000);
cy.deleteAllIndices();
miscUtils.addSampleData();
cy.wait(15000);
});

const uniqueName = 'saved-map-' + Date.now().toString();
Expand Down Expand Up @@ -76,10 +71,6 @@ describe('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
);
cy.contains(uniqueName).click();
cy.get('[data-test-subj="layerControlPanel"]').should(
'contain',
Expand All @@ -88,10 +79,6 @@ 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();
miscUtils.removeSampleData();
});
});
Loading

0 comments on commit 4828655

Please sign in to comment.