From ca4f02899eb29b7ec9228f2571efe345b7b31b04 Mon Sep 17 00:00:00 2001 From: Shivam Dhar Date: Thu, 4 Aug 2022 14:21:14 -0700 Subject: [PATCH] adds integration test for customImportMap plugin (#272) adds integration test for customImportMap plugin Signed-off-by: Shivam Dhar Signed-off-by: Jakub Przybylski --- ...rt-map-dashboards-release-e2e-workflow.yml | 26 +++++++++++++ .../import_vector_map_tab.spec.js | 39 +++++++++++++++++++ test_finder.sh | 1 + 3 files changed, 66 insertions(+) create mode 100644 .github/workflows/custom-import-map-dashboards-release-e2e-workflow.yml create mode 100644 cypress/integration/plugins/custom-import-map-dashboards/import_vector_map_tab.spec.js diff --git a/.github/workflows/custom-import-map-dashboards-release-e2e-workflow.yml b/.github/workflows/custom-import-map-dashboards-release-e2e-workflow.yml new file mode 100644 index 000000000..72fa44457 --- /dev/null +++ b/.github/workflows/custom-import-map-dashboards-release-e2e-workflow.yml @@ -0,0 +1,26 @@ +name: customImportMapDashboards Release tests workflow in Bundled OpenSearch Dashboards +on: + pull_request: + branches: + - main + - dev-* +jobs: + changes: + runs-on: ubuntu-latest + outputs: + tests: ${{ steps.filter.outputs.tests }} + steps: + - uses: dorny/paths-filter@v2 + id: filter + with: + filters: | + tests: + - 'cypress/**/custom-import-map-dashboards/**' + + tests: + needs: changes + if: ${{ needs.changes.outputs.tests == 'true' }} + uses: ./.github/workflows/release-e2e-workflow-template.yml + with: + test-name: Observability + test-command: yarn cypress:run-with-security --browser chromium --spec 'cypress/integration/plugins/custom-import-map-dashboards/*' diff --git a/cypress/integration/plugins/custom-import-map-dashboards/import_vector_map_tab.spec.js b/cypress/integration/plugins/custom-import-map-dashboards/import_vector_map_tab.spec.js new file mode 100644 index 000000000..41bbdbe39 --- /dev/null +++ b/cypress/integration/plugins/custom-import-map-dashboards/import_vector_map_tab.spec.js @@ -0,0 +1,39 @@ +/* + * 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'; + +const miscUtils = new MiscUtils(cy); +describe('Verify the presence of import custom map tab in region map plugin', () => { + before(() => { + cy.deleteAllIndices(); + miscUtils.addSampleData(); + + 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 import custom map tab is present', () => { + // Click on "Import Vector Map" tab, which is part of customImportMap plugin + cy.contains('Import Vector Map').click({ force: true }); + }) + + after(() => { + miscUtils.removeSampleData(); + }) +}); diff --git a/test_finder.sh b/test_finder.sh index c1ce35bb7..66382152f 100755 --- a/test_finder.sh +++ b/test_finder.sh @@ -17,6 +17,7 @@ OSD_COMPONENT_TEST_MAP=( "OpenSearch-Dashboards:opensearch-dashboards" "reportsDashboards:reports-dashboards" "securityDashboards:security" "notificationsDashboards:notifications-dashboards" + "customImportMapDashboards:custom-import-map-dashboards" ) [ -f $OSD_BUILD_MANIFEST ] && TEST_TYPE="manifest" || TEST_TYPE="default"