diff --git a/.github/workflows/cypress-workflow.yml b/.github/workflows/cypress-workflow.yml index ea311bd20..45d21f968 100644 --- a/.github/workflows/cypress-workflow.yml +++ b/.github/workflows/cypress-workflow.yml @@ -7,9 +7,9 @@ on: branches: - "*" env: - OPENSEARCH_DASHBOARDS_VERSION: '2.4.0' - OPENSEARCH_VERSION: '2.4.0-SNAPSHOT' - SECURITY_ANALYTICS_BRANCH: '2.4' + OPENSEARCH_DASHBOARDS_VERSION: '2.5' + OPENSEARCH_VERSION: '2.5.0-SNAPSHOT' + SECURITY_ANALYTICS_BRANCH: '2.5' jobs: tests: name: Run Cypress E2E tests @@ -90,7 +90,7 @@ jobs: - name: Sleep until OSD server starts run: sleep 300 shell: bash - + - name: Install Cypress run: | cd OpenSearch-Dashboards/plugins/security-analytics-dashboards-plugin @@ -111,7 +111,7 @@ jobs: with: path: ${{ matrix.cypress_cache_folder }} key: cypress-cache-v2-${{ runner.os }}-${{ hashFiles('**/package.json') }} - + # for now just chrome, use matrix to do all browsers later - name: Cypress tests uses: cypress-io/github-action@v2 @@ -121,7 +121,7 @@ jobs: wait-on: 'http://localhost:5601' browser: chrome env: - CYPRESS_CACHE_FOLDER: ${{ matrix.cypress_cache_folder }} + CYPRESS_CACHE_FOLDER: ${{ matrix.cypress_cache_folder }} # Screenshots are only captured on failure, will change this once we do visual regression tests - uses: actions/upload-artifact@v1 diff --git a/.github/workflows/unit-tests-workflow.yml b/.github/workflows/unit-tests-workflow.yml index 06dca2613..7f631dbb1 100644 --- a/.github/workflows/unit-tests-workflow.yml +++ b/.github/workflows/unit-tests-workflow.yml @@ -7,7 +7,7 @@ on: branches: - "*" env: - OPENSEARCH_DASHBOARDS_VERSION: '2.4.0' + OPENSEARCH_DASHBOARDS_VERSION: '2.5' jobs: tests: name: Run unit tests diff --git a/cypress/integration/1_detectors.spec.js b/cypress/integration/1_detectors.spec.js index 41cfb7f67..4e1514f5c 100644 --- a/cypress/integration/1_detectors.spec.js +++ b/cypress/integration/1_detectors.spec.js @@ -4,9 +4,33 @@ */ import { OPENSEARCH_DASHBOARDS_URL } from '../support/constants'; -import sample_field_mappings from '../fixtures/sample_field_mappings.json'; import sample_index_settings from '../fixtures/sample_index_settings.json'; +const testMappings = { + properties: { + 'host-hostname': { + type: 'alias', + path: 'HostName', + }, + 'windows-message': { + type: 'alias', + path: 'Message', + }, + 'winlog-provider_name': { + type: 'alias', + path: 'Provider_Name', + }, + 'winlog-event_data-ServiceName': { + type: 'alias', + path: 'ServiceName', + }, + 'winlog-event_id': { + path: 'EventID', + type: 'alias', + }, + }, +}; + describe('Detectors', () => { const indexName = 'cypress-test-windows'; const detectorName = 'test detector'; @@ -71,9 +95,17 @@ describe('Detectors', () => { // Check that correct page now showing cy.contains('Configure field mapping'); + // Show 50 rows per page + cy.contains('Rows per page').click({ force: true }); + cy.contains('50 rows').click({ force: true }); + + // Show 50 rows per page + cy.contains('Rows per page').click({ force: true }); + cy.contains('50 rows').click({ force: true }); + // Select appropriate names to map fields to - for (let field_name in sample_field_mappings.properties) { - const mappedTo = sample_field_mappings.properties[field_name].path; + for (let field_name in testMappings.properties) { + const mappedTo = testMappings.properties[field_name].path; cy.contains('tr', field_name).within(() => { cy.get(`[data-test-subj="detector-field-mappings-select"]`).click().type(mappedTo); @@ -105,8 +137,12 @@ describe('Detectors', () => { // Confirm field mappings registered cy.contains('Field mapping'); - for (let field in sample_field_mappings.properties) { - const mappedTo = sample_field_mappings.properties[field].path; + // Show 50 rows per page + cy.contains('Rows per page').click({ force: true }); + cy.contains('50 rows').click({ force: true }); + + for (let field in testMappings.properties) { + const mappedTo = testMappings.properties[field].path; cy.contains(field); cy.contains(mappedTo); diff --git a/opensearch_dashboards.json b/opensearch_dashboards.json index 011678ca0..452892870 100644 --- a/opensearch_dashboards.json +++ b/opensearch_dashboards.json @@ -1,7 +1,7 @@ { "id": "securityAnalyticsDashboards", - "version": "2.4.0.0", - "opensearchDashboardsVersion": "2.4.0", + "version": "2.5.0.0", + "opensearchDashboardsVersion": "2.5.0", "configPath": ["opensearch_security_analytics"], "requiredPlugins": [], "server": true, diff --git a/package.json b/package.json index 8f4acfd86..f198df660 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "opensearch_security_analytics_dashboards", - "version": "2.4.0.0", + "version": "2.5.0.0", "description": "OpenSearch Dashboards plugin for Security Analytics", "main": "index.js", "license": "Apache-2.0",