diff --git a/cypress/fixtures/plugins/security-analytics-dashboards-plugin/integration_tests/rule/create_dns_rule_with_type_selection.json b/cypress/fixtures/plugins/security-analytics-dashboards-plugin/integration_tests/rule/create_dns_rule_with_type_selection.json index e447a30d5..f332a4868 100644 --- a/cypress/fixtures/plugins/security-analytics-dashboards-plugin/integration_tests/rule/create_dns_rule_with_type_selection.json +++ b/cypress/fixtures/plugins/security-analytics-dashboards-plugin/integration_tests/rule/create_dns_rule_with_type_selection.json @@ -1,5 +1,5 @@ { - "id": "25b9c01c-350d-4b95-bed1-836d04a4f325", + "id": "25b9c01c-350d-4b95-bed1-836d04a4f324", "category": "dns", "title": "Cypress DNS Type Rule", "description": "Detects DNS type as QWE", diff --git a/cypress/integration/core-opensearch-dashboards/opensearch-dashboards/apps/data_explorer/discover.spec.js b/cypress/integration/core-opensearch-dashboards/opensearch-dashboards/apps/data_explorer/discover.spec.js index 9fccc0265..a8b0a349f 100644 --- a/cypress/integration/core-opensearch-dashboards/opensearch-dashboards/apps/data_explorer/discover.spec.js +++ b/cypress/integration/core-opensearch-dashboards/opensearch-dashboards/apps/data_explorer/discover.spec.js @@ -63,6 +63,32 @@ describe('discover app', { scrollBehavior: false }, () => { after(() => {}); + describe('filters and queries', () => { + after(() => { + cy.get('[data-test-subj~="filter-key-extension.raw"]').click(); + cy.getElementByTestId(`deleteFilter`).click(); + cy.switchDiscoverTable('legacy'); + }); + it('should persist across refresh', function () { + // Set up query and filter + cy.setTopNavQuery('response:200'); + cy.submitFilterFromDropDown('extension.raw', 'is one of', 'jpg'); + cy.reload(); + cy.getElementByTestId(`queryInput`).should('have.text', 'response:200'); + cy.get('[data-test-subj~="filter-key-extension.raw"]').should( + 'be.visible' + ); + }); + + it('should persist across switching table', function () { + cy.switchDiscoverTable('new'); + cy.getElementByTestId(`queryInput`).should('have.text', 'response:200'); + cy.get('[data-test-subj~="filter-key-extension.raw"]').should( + 'be.visible' + ); + }); + }); + describe('save search', () => { const saveSearch1 = 'Save Search # 1'; const saveSearch2 = 'Modified Save Search # 1'; diff --git a/cypress/integration/plugins/custom-import-map-dashboards/7_enable_new_home_ui.spec.js b/cypress/integration/plugins/custom-import-map-dashboards/7_enable_new_home_ui.spec.js index ec1d1d5ff..75015bbdd 100644 --- a/cypress/integration/plugins/custom-import-map-dashboards/7_enable_new_home_ui.spec.js +++ b/cypress/integration/plugins/custom-import-map-dashboards/7_enable_new_home_ui.spec.js @@ -9,19 +9,22 @@ import { CURRENT_TENANT } from '../../../utils/commands'; const miscUtils = new MiscUtils(cy); -describe('Add flights dataset saved object', () => { - before(() => { +describe('Add flights dataset saved object', function () { + before(function () { CURRENT_TENANT.newTenant = 'global'; cy.deleteAllIndices(); miscUtils.addSampleData(); cy.wait(10000); - // Enable the new home UI + // Enable the new home UI if possible cy.visit(`${BASE_PATH}/app/settings`); cy.get( '[data-test-subj="advancedSetting-editField-home:useNewHomePage"]' ).then(($switch) => { - if ($switch.attr('aria-checked') === 'false') { + if ($switch.attr('disabled') === 'disabled') { + cy.log('Switch is disabled and cannot be changed.'); + this.skip(); // Skip all tests in this suite + } else if ($switch.attr('aria-checked') === 'false') { cy.wrap($switch).click(); cy.get('[data-test-subj="advancedSetting-saveButton"]').click(); cy.get('button.euiButton--primary.euiButton--small', { @@ -35,12 +38,14 @@ describe('Add flights dataset saved object', () => { after(() => { miscUtils.removeSampleData(); - // Disable the new home UI + // Disable the new home UI if possible cy.visit(`${BASE_PATH}/app/settings`); cy.get( '[data-test-subj="advancedSetting-editField-home:useNewHomePage"]' ).then(($switch) => { - if ($switch.attr('aria-checked') === 'true') { + if ($switch.attr('disabled') === 'disabled') { + cy.log('Switch is disabled and cannot be changed.'); + } else if ($switch.attr('aria-checked') === 'true') { cy.wrap($switch).click(); cy.get('[data-test-subj="advancedSetting-saveButton"]').click(); cy.get('button.euiButton--primary.euiButton--small', { diff --git a/cypress/utils/plugins/security-analytics-dashboards-plugin/commands.js b/cypress/utils/plugins/security-analytics-dashboards-plugin/commands.js index 708b1e8bc..3bf1e0cf0 100644 --- a/cypress/utils/plugins/security-analytics-dashboards-plugin/commands.js +++ b/cypress/utils/plugins/security-analytics-dashboards-plugin/commands.js @@ -198,6 +198,9 @@ Cypress.Commands.add( Cypress.log({ message: `Select combobox items: ${items.join(' | ')}` }); items.map((item) => { cy.wrap(subject).type(item); + + // Short wait to reduce flakiness + cy.wait(3000); cy.get(`[title="${item}"]`).click({ force: true }); }); } diff --git a/package.json b/package.json index 2a61ff896..024e3877c 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "opensearch-dashboards-functional-test", - "version": "2.17.0", + "version": "2.18.0", "description": "Maintains functional tests for OpenSearch Dashboards and Dashboards plugins", "main": "index.js", "scripts": {