From 0c7d76bc66043f2e6bcde6a5309e9374e74d53f9 Mon Sep 17 00:00:00 2001 From: Georgii Gorbachev Date: Thu, 7 Sep 2023 14:19:26 +0200 Subject: [PATCH] Skip all Detection & Response Cypress tests in Serverless --- .../cypress/README.md | 7 +- .../cypress/cypress_ci_serverless.config.ts | 2 +- .../cypress/cypress_serverless.config.ts | 2 +- .../data_sources/create_runtime_field.cy.ts | 1 + .../cypress/e2e/data_sources/sourcerer.cy.ts | 5 +- .../e2e/data_sources/sourcerer_timeline.cy.ts | 3 +- .../e2e/data_sources/sourcerer_timeline.ts | 3 +- .../e2e/detection_alerts/alert_tags.cy.ts | 1 + .../e2e/detection_alerts/alerts_charts.cy.ts | 1 + ...ts_detection_callouts_index_outdated.cy.ts | 3 +- .../detection_alerts/cti_enrichments.cy.ts | 2 + .../e2e/detection_alerts/enrichments.cy.ts | 1 + .../missing_privileges_callout.cy.ts | 3 +- .../ransomware_detection.cy.ts | 1 + .../ransomware_prevention.cy.ts | 1 + ...t_rules_install_update_authorization.cy.ts | 4 +- ..._rules_install_update_error_handling.cy.ts | 3 +- ...built_rules_install_update_workflows.cy.ts | 3 +- .../prebuilt_rules_management.cy.ts | 3 +- .../prebuilt_rules_notifications.cy.ts | 3 +- .../rule_actions/rule_actions.cy.ts | 3 +- .../rule_creation/custom_query_rule.cy.ts | 3 +- .../custom_query_rule_data_view.cy.ts | 3 +- .../custom_saved_query_rule.cy.ts | 289 +++--- .../event_correlation_rule.cy.ts | 3 +- .../rule_creation/indicator_match_rule.cy.ts | 3 +- .../rule_creation/machine_learning_rule.cy.ts | 129 +-- .../rule_creation/new_terms_rule.cy.ts | 3 +- .../rule_creation/override.cy.ts | 162 ++-- .../rule_creation/threshold_rule.cy.ts | 150 ++-- .../authorization/all_rules_read_only.cy.ts | 4 +- .../maintenance_window_callout.cy.ts | 85 +- .../related_integrations.cy.ts | 4 +- .../bulk_actions/bulk_duplicate_rules.cy.ts | 3 +- .../bulk_actions/bulk_edit_rules.cy.ts | 840 +++++++++--------- .../bulk_edit_rules_actions.cy.ts | 3 +- .../bulk_edit_rules_data_view.cy.ts | 3 +- .../import_export/export_rule.cy.ts | 3 +- .../import_export/import_rules.cy.ts | 3 +- .../rule_actions/snoozing/rule_snoozing.cy.ts | 3 +- .../rules_table_auto_refresh.cy.ts | 119 +-- .../rules_table/rules_table_filtering.cy.ts | 4 +- .../rules_table/rules_table_links.cy.ts | 3 +- .../rules_table_persistent_state.cy.ts | 478 +++++----- .../rules_table/rules_table_selection.cy.ts | 99 ++- .../rules_table/rules_table_sorting.cy.ts | 1 + .../value_lists/value_lists.cy.ts | 27 +- .../entity_analytics_management_page.cy.ts | 3 +- .../endpoint_exceptions.cy.ts | 3 +- .../auto_populate_with_alert_data.cy.ts | 3 +- .../closing_all_matching_alerts.cy.ts | 3 +- .../exceptions/entry/flyout_validation.cy.ts | 3 +- .../entry/multiple_conditions.cy.ts | 3 +- .../e2e/exceptions/entry/use_value_list.cy.ts | 3 +- .../add_edit_endpoint_exception.cy.ts | 3 +- .../add_edit_exception.cy.ts | 440 ++++----- .../add_edit_exception_data_view.cy.ts | 3 +- .../rule_details_flow/read_only_view.cy.ts | 3 +- .../list_detail_page/list_details.cy.ts | 3 +- .../manage_exceptions.cy.ts | 130 +-- .../duplicate_lists.cy.ts | 3 +- .../filter_table.cy.ts | 4 +- .../import_lists.cy.ts | 3 +- .../manage_lists.cy.ts | 3 +- .../read_only.cy.ts | 3 +- .../cypress/e2e/overview/cti_link_panel.cy.ts | 60 +- 66 files changed, 1656 insertions(+), 1505 deletions(-) diff --git a/x-pack/test/security_solution_cypress/cypress/README.md b/x-pack/test/security_solution_cypress/cypress/README.md index 21a6a8a9db493..aa749344201fa 100644 --- a/x-pack/test/security_solution_cypress/cypress/README.md +++ b/x-pack/test/security_solution_cypress/cypress/README.md @@ -40,7 +40,12 @@ of data for your test, [**Running the tests**](#running-the-tests) to know how t Please, before opening a PR with the new test, please make sure that the test fails. If you never see your test fail you don’t know if your test is actually testing the right thing, or testing anything at all. -Note that we use tags in order to select which tests we want to execute: @serverless, @ess and @brokenInServerless +Note that we use tags in order to select which tests we want to execute: + +- `@serverless` includes a test in the Serverless test suite. You need to explicitly add this tag to any test you want to run against a Serverless environment. +- `@ess` includes a test in the normal, non-Serverless test suite. You need to explicitly add this tag to any test you want to run against a non-Serverless environment. +- `@brokenInServerless` excludes a test from the Serverless test suite (even if it's tagged as `@serverless`). Indicates that a test should run in Serverless, but currently is broken. +- `@skipInServerless` excludes a test from the Serverless test suite (even if it's tagged as `@serverless`). Could indicate many things, e.g. "the test is flaky in Serverless", "the test is Flaky in any type of environemnt", "the test has been temporarily excluded, see the comment above why". Please, before opening a PR with a new test, make sure that the test fails. If you never see your test fail you don’t know if your test is actually testing the right thing, or testing anything at all. diff --git a/x-pack/test/security_solution_cypress/cypress/cypress_ci_serverless.config.ts b/x-pack/test/security_solution_cypress/cypress/cypress_ci_serverless.config.ts index 5ce5af4e639f6..eafcd67682a68 100644 --- a/x-pack/test/security_solution_cypress/cypress/cypress_ci_serverless.config.ts +++ b/x-pack/test/security_solution_cypress/cypress/cypress_ci_serverless.config.ts @@ -18,7 +18,7 @@ export default defineCypressConfig({ env: { grepFilterSpecs: true, grepOmitFiltered: true, - grepTags: '@serverless --@brokenInServerless', + grepTags: '@serverless --@brokenInServerless --@skipInServerless', }, execTimeout: 150000, pageLoadTimeout: 150000, diff --git a/x-pack/test/security_solution_cypress/cypress/cypress_serverless.config.ts b/x-pack/test/security_solution_cypress/cypress/cypress_serverless.config.ts index d0a89bb34a68a..d172248fb406a 100644 --- a/x-pack/test/security_solution_cypress/cypress/cypress_serverless.config.ts +++ b/x-pack/test/security_solution_cypress/cypress/cypress_serverless.config.ts @@ -23,7 +23,7 @@ export default defineCypressConfig({ numTestsKeptInMemory: 10, env: { grepFilterSpecs: true, - grepTags: '@serverless --@brokenInServerless', + grepTags: '@serverless --@brokenInServerless --@skipInServerless', }, e2e: { experimentalRunAllSpecs: true, diff --git a/x-pack/test/security_solution_cypress/cypress/e2e/data_sources/create_runtime_field.cy.ts b/x-pack/test/security_solution_cypress/cypress/e2e/data_sources/create_runtime_field.cy.ts index b9a514b8c2215..f78670bc14b4f 100644 --- a/x-pack/test/security_solution_cypress/cypress/e2e/data_sources/create_runtime_field.cy.ts +++ b/x-pack/test/security_solution_cypress/cypress/e2e/data_sources/create_runtime_field.cy.ts @@ -25,6 +25,7 @@ import { GET_TIMELINE_HEADER } from '../../screens/timeline'; const alertRunTimeField = 'field.name.alert.page'; const timelineRuntimeField = 'field.name.timeline'; +// TODO: https://github.com/elastic/kibana/issues/161539 describe( 'Create DataView runtime field', { tags: ['@ess', '@serverless', '@brokenInServerless'] }, diff --git a/x-pack/test/security_solution_cypress/cypress/e2e/data_sources/sourcerer.cy.ts b/x-pack/test/security_solution_cypress/cypress/e2e/data_sources/sourcerer.cy.ts index 7ea130b0230d3..77206d714c960 100644 --- a/x-pack/test/security_solution_cypress/cypress/e2e/data_sources/sourcerer.cy.ts +++ b/x-pack/test/security_solution_cypress/cypress/e2e/data_sources/sourcerer.cy.ts @@ -35,12 +35,14 @@ const rolesToCreate = [secReadCasesAll]; const siemDataViewTitle = 'Security Default Data View'; const dataViews = ['auditbeat-*,fakebeat-*', 'auditbeat-*,*beat*,siem-read*,.kibana*,fakebeat-*']; -describe('Sourcerer', () => { +// TODO: https://github.com/elastic/kibana/issues/161539 +describe('Sourcerer', { tags: ['@ess', '@serverless', '@skipInServerless'] }, () => { before(() => { cy.task('esArchiverResetKibana'); dataViews.forEach((dataView: string) => postDataView(dataView)); }); + // TODO: https://github.com/elastic/kibana/issues/161539 describe('permissions', { tags: ['@ess', '@brokenInServerless'] }, () => { before(() => { createUsersAndRoles(usersToCreate, rolesToCreate); @@ -52,6 +54,7 @@ describe('Sourcerer', () => { }); }); + // TODO: https://github.com/elastic/kibana/issues/161539 // FLAKY: https://github.com/elastic/kibana/issues/165766 describe('Default scope', { tags: ['@ess', '@serverless', '@brokenInServerless'] }, () => { beforeEach(() => { diff --git a/x-pack/test/security_solution_cypress/cypress/e2e/data_sources/sourcerer_timeline.cy.ts b/x-pack/test/security_solution_cypress/cypress/e2e/data_sources/sourcerer_timeline.cy.ts index 1476e82421cda..979cf8c657b12 100644 --- a/x-pack/test/security_solution_cypress/cypress/e2e/data_sources/sourcerer_timeline.cy.ts +++ b/x-pack/test/security_solution_cypress/cypress/e2e/data_sources/sourcerer_timeline.cy.ts @@ -38,7 +38,8 @@ import { closeTimeline, openTimelineById } from '../../tasks/timeline'; const siemDataViewTitle = 'Security Default Data View'; const dataViews = ['auditbeat-*,fakebeat-*', 'auditbeat-*,*beat*,siem-read*,.kibana*,fakebeat-*']; -describe('Timeline scope', { tags: '@brokenInServerless' }, () => { +// TODO: https://github.com/elastic/kibana/issues/161539 +describe('Timeline scope', { tags: ['@ess', '@serverless', '@brokenInServerless'] }, () => { beforeEach(() => { cy.clearLocalStorage(); login(); diff --git a/x-pack/test/security_solution_cypress/cypress/e2e/data_sources/sourcerer_timeline.ts b/x-pack/test/security_solution_cypress/cypress/e2e/data_sources/sourcerer_timeline.ts index 1476e82421cda..979cf8c657b12 100644 --- a/x-pack/test/security_solution_cypress/cypress/e2e/data_sources/sourcerer_timeline.ts +++ b/x-pack/test/security_solution_cypress/cypress/e2e/data_sources/sourcerer_timeline.ts @@ -38,7 +38,8 @@ import { closeTimeline, openTimelineById } from '../../tasks/timeline'; const siemDataViewTitle = 'Security Default Data View'; const dataViews = ['auditbeat-*,fakebeat-*', 'auditbeat-*,*beat*,siem-read*,.kibana*,fakebeat-*']; -describe('Timeline scope', { tags: '@brokenInServerless' }, () => { +// TODO: https://github.com/elastic/kibana/issues/161539 +describe('Timeline scope', { tags: ['@ess', '@serverless', '@brokenInServerless'] }, () => { beforeEach(() => { cy.clearLocalStorage(); login(); diff --git a/x-pack/test/security_solution_cypress/cypress/e2e/detection_alerts/alert_tags.cy.ts b/x-pack/test/security_solution_cypress/cypress/e2e/detection_alerts/alert_tags.cy.ts index 1013a4d7d53d4..48c7f49c14868 100644 --- a/x-pack/test/security_solution_cypress/cypress/e2e/detection_alerts/alert_tags.cy.ts +++ b/x-pack/test/security_solution_cypress/cypress/e2e/detection_alerts/alert_tags.cy.ts @@ -24,6 +24,7 @@ import { UNSELECTED_ALERT_TAG, } from '../../screens/alerts'; +// TODO: https://github.com/elastic/kibana/issues/161539 describe('Alert tagging', { tags: ['@ess', '@serverless', '@brokenInServerless'] }, () => { before(() => { cleanKibana(); diff --git a/x-pack/test/security_solution_cypress/cypress/e2e/detection_alerts/alerts_charts.cy.ts b/x-pack/test/security_solution_cypress/cypress/e2e/detection_alerts/alerts_charts.cy.ts index 313d2a625ad9f..2c00882fb15db 100644 --- a/x-pack/test/security_solution_cypress/cypress/e2e/detection_alerts/alerts_charts.cy.ts +++ b/x-pack/test/security_solution_cypress/cypress/e2e/detection_alerts/alerts_charts.cy.ts @@ -24,6 +24,7 @@ import { } from '../../screens/search_bar'; import { TOASTER } from '../../screens/alerts_detection_rules'; +// TODO: https://github.com/elastic/kibana/issues/161539 describe( 'Histogram legend hover actions', { tags: ['@ess', '@serverless', '@brokenInServerless'] }, diff --git a/x-pack/test/security_solution_cypress/cypress/e2e/detection_alerts/alerts_detection_callouts_index_outdated.cy.ts b/x-pack/test/security_solution_cypress/cypress/e2e/detection_alerts/alerts_detection_callouts_index_outdated.cy.ts index f9aa9d08c2954..c8733ef94ff37 100644 --- a/x-pack/test/security_solution_cypress/cypress/e2e/detection_alerts/alerts_detection_callouts_index_outdated.cy.ts +++ b/x-pack/test/security_solution_cypress/cypress/e2e/detection_alerts/alerts_detection_callouts_index_outdated.cy.ts @@ -30,9 +30,10 @@ const waitForPageTitleToBeShown = () => { cy.get(PAGE_TITLE).should('be.visible'); }; +// TODO: https://github.com/elastic/kibana/issues/161539 Does it need to run in Serverless? describe( 'Detections > Need Admin Callouts indicating an admin is needed to migrate the alert data set', - { tags: '@ess' }, + { tags: ['@ess', '@skipInServerless'] }, () => { before(() => { // First, we have to open the app on behalf of a privileged user in order to initialize it. diff --git a/x-pack/test/security_solution_cypress/cypress/e2e/detection_alerts/cti_enrichments.cy.ts b/x-pack/test/security_solution_cypress/cypress/e2e/detection_alerts/cti_enrichments.cy.ts index 2057a7db3363f..db34adeb10cac 100644 --- a/x-pack/test/security_solution_cypress/cypress/e2e/detection_alerts/cti_enrichments.cy.ts +++ b/x-pack/test/security_solution_cypress/cypress/e2e/detection_alerts/cti_enrichments.cy.ts @@ -28,6 +28,7 @@ import { openJsonView, openThreatIndicatorDetails } from '../../tasks/alerts_det import { DETECTIONS_RULE_MANAGEMENT_URL } from '../../urls/navigation'; import { addsFieldsToTimeline } from '../../tasks/rule_details'; +// TODO: https://github.com/elastic/kibana/issues/161539 describe('CTI Enrichment', { tags: ['@ess', '@serverless', '@brokenInServerless'] }, () => { before(() => { cleanKibana(); @@ -50,6 +51,7 @@ describe('CTI Enrichment', { tags: ['@ess', '@serverless', '@brokenInServerless' goToRuleDetails(); }); + // TODO: https://github.com/elastic/kibana/issues/161539 // Skipped: https://github.com/elastic/kibana/issues/162818 it.skip('Displays enrichment matched.* fields on the timeline', () => { const expectedFields = { diff --git a/x-pack/test/security_solution_cypress/cypress/e2e/detection_alerts/enrichments.cy.ts b/x-pack/test/security_solution_cypress/cypress/e2e/detection_alerts/enrichments.cy.ts index 102405eb95a61..393123650c388 100644 --- a/x-pack/test/security_solution_cypress/cypress/e2e/detection_alerts/enrichments.cy.ts +++ b/x-pack/test/security_solution_cypress/cypress/e2e/detection_alerts/enrichments.cy.ts @@ -30,6 +30,7 @@ import { login, visit } from '../../tasks/login'; import { ALERTS_URL } from '../../urls/navigation'; +// TODO: https://github.com/elastic/kibana/issues/161539 describe('Enrichment', { tags: ['@ess', '@serverless', '@brokenInServerless'] }, () => { before(() => { cleanKibana(); diff --git a/x-pack/test/security_solution_cypress/cypress/e2e/detection_alerts/missing_privileges_callout.cy.ts b/x-pack/test/security_solution_cypress/cypress/e2e/detection_alerts/missing_privileges_callout.cy.ts index 0568037b5c693..bad8c1c071c9e 100644 --- a/x-pack/test/security_solution_cypress/cypress/e2e/detection_alerts/missing_privileges_callout.cy.ts +++ b/x-pack/test/security_solution_cypress/cypress/e2e/detection_alerts/missing_privileges_callout.cy.ts @@ -42,7 +42,8 @@ const waitForPageTitleToBeShown = () => { cy.get(PAGE_TITLE).should('be.visible'); }; -describe('Detections > Callouts', { tags: '@ess' }, () => { +// TODO: https://github.com/elastic/kibana/issues/161539 +describe('Detections > Callouts', { tags: ['@ess', '@skipInServerless'] }, () => { before(() => { // First, we have to open the app on behalf of a privileged user in order to initialize it. // Otherwise the app will be disabled and show a "welcome"-like page. diff --git a/x-pack/test/security_solution_cypress/cypress/e2e/detection_alerts/ransomware_detection.cy.ts b/x-pack/test/security_solution_cypress/cypress/e2e/detection_alerts/ransomware_detection.cy.ts index a38ac3b2fb842..7c7cd582baa3b 100644 --- a/x-pack/test/security_solution_cypress/cypress/e2e/detection_alerts/ransomware_detection.cy.ts +++ b/x-pack/test/security_solution_cypress/cypress/e2e/detection_alerts/ransomware_detection.cy.ts @@ -14,6 +14,7 @@ import { TIMELINE_QUERY, TIMELINE_VIEW_IN_ANALYZER } from '../../screens/timelin import { selectAlertsHistogram } from '../../tasks/alerts'; import { createTimeline } from '../../tasks/timelines'; +// TODO: https://github.com/elastic/kibana/issues/161539 describe( 'Ransomware Detection Alerts', { tags: ['@ess', '@serverless', '@brokenInServerless'] }, diff --git a/x-pack/test/security_solution_cypress/cypress/e2e/detection_alerts/ransomware_prevention.cy.ts b/x-pack/test/security_solution_cypress/cypress/e2e/detection_alerts/ransomware_prevention.cy.ts index c71c3634246a7..8c62fb1929317 100644 --- a/x-pack/test/security_solution_cypress/cypress/e2e/detection_alerts/ransomware_prevention.cy.ts +++ b/x-pack/test/security_solution_cypress/cypress/e2e/detection_alerts/ransomware_prevention.cy.ts @@ -15,6 +15,7 @@ import { selectAlertsHistogram } from '../../tasks/alerts'; import { createTimeline } from '../../tasks/timelines'; import { cleanKibana } from '../../tasks/common'; +// TODO: https://github.com/elastic/kibana/issues/161539 describe( 'Ransomware Prevention Alerts', { tags: ['@ess', '@serverless', '@brokenInServerless'] }, diff --git a/x-pack/test/security_solution_cypress/cypress/e2e/detection_response/prebuilt_rules/prebuilt_rules_install_update_authorization.cy.ts b/x-pack/test/security_solution_cypress/cypress/e2e/detection_response/prebuilt_rules/prebuilt_rules_install_update_authorization.cy.ts index 30059c9ad5855..19684d539c287 100644 --- a/x-pack/test/security_solution_cypress/cypress/e2e/detection_response/prebuilt_rules/prebuilt_rules_install_update_authorization.cy.ts +++ b/x-pack/test/security_solution_cypress/cypress/e2e/detection_response/prebuilt_rules/prebuilt_rules_install_update_authorization.cy.ts @@ -55,9 +55,11 @@ const loadPageAsReadOnlyUser = (url: string) => { waitForPageWithoutDateRange(url, ROLES.reader); }; +// TODO: https://github.com/elastic/kibana/issues/164451 We should find a way to make this spec work in Serverless +// TODO: https://github.com/elastic/kibana/issues/161540 describe( 'Detection rules, Prebuilt Rules Installation and Update - Authorization/RBAC', - { tags: '@ess' }, + { tags: ['@ess', '@serverless', '@skipInServerless'] }, () => { beforeEach(() => { login(); diff --git a/x-pack/test/security_solution_cypress/cypress/e2e/detection_response/prebuilt_rules/prebuilt_rules_install_update_error_handling.cy.ts b/x-pack/test/security_solution_cypress/cypress/e2e/detection_response/prebuilt_rules/prebuilt_rules_install_update_error_handling.cy.ts index c9fe54f66f0be..b1bdae3ae49f5 100644 --- a/x-pack/test/security_solution_cypress/cypress/e2e/detection_response/prebuilt_rules/prebuilt_rules_install_update_error_handling.cy.ts +++ b/x-pack/test/security_solution_cypress/cypress/e2e/detection_response/prebuilt_rules/prebuilt_rules_install_update_error_handling.cy.ts @@ -22,9 +22,10 @@ import { ruleUpdatesTabClick, } from '../../../tasks/prebuilt_rules'; +// TODO: https://github.com/elastic/kibana/issues/161540 describe( 'Detection rules, Prebuilt Rules Installation and Update - Error handling', - { tags: '@ess' }, + { tags: ['@ess', '@serverless', '@skipInServerless'] }, () => { beforeEach(() => { login(); diff --git a/x-pack/test/security_solution_cypress/cypress/e2e/detection_response/prebuilt_rules/prebuilt_rules_install_update_workflows.cy.ts b/x-pack/test/security_solution_cypress/cypress/e2e/detection_response/prebuilt_rules/prebuilt_rules_install_update_workflows.cy.ts index b6852c698e635..a4fb84d557d3f 100644 --- a/x-pack/test/security_solution_cypress/cypress/e2e/detection_response/prebuilt_rules/prebuilt_rules_install_update_workflows.cy.ts +++ b/x-pack/test/security_solution_cypress/cypress/e2e/detection_response/prebuilt_rules/prebuilt_rules_install_update_workflows.cy.ts @@ -39,9 +39,10 @@ import { ruleUpdatesTabClick, } from '../../../tasks/prebuilt_rules'; +// TODO: https://github.com/elastic/kibana/issues/161540 describe( 'Detection rules, Prebuilt Rules Installation and Update workflow', - { tags: ['@ess', '@brokenInServerless'] }, + { tags: ['@ess', '@serverless', '@brokenInServerless'] }, () => { beforeEach(() => { login(); diff --git a/x-pack/test/security_solution_cypress/cypress/e2e/detection_response/prebuilt_rules/prebuilt_rules_management.cy.ts b/x-pack/test/security_solution_cypress/cypress/e2e/detection_response/prebuilt_rules/prebuilt_rules_management.cy.ts index b172b84b76953..00e38335792ce 100644 --- a/x-pack/test/security_solution_cypress/cypress/e2e/detection_response/prebuilt_rules/prebuilt_rules_management.cy.ts +++ b/x-pack/test/security_solution_cypress/cypress/e2e/detection_response/prebuilt_rules/prebuilt_rules_management.cy.ts @@ -50,7 +50,8 @@ const rules = Array.from(Array(5)).map((_, i) => { }); }); -describe('Prebuilt rules', { tags: ['@ess', '@serverless'] }, () => { +// TODO: https://github.com/elastic/kibana/issues/161540 +describe('Prebuilt rules', { tags: ['@ess', '@serverless', '@skipInServerless'] }, () => { before(() => { cleanKibana(); }); diff --git a/x-pack/test/security_solution_cypress/cypress/e2e/detection_response/prebuilt_rules/prebuilt_rules_notifications.cy.ts b/x-pack/test/security_solution_cypress/cypress/e2e/detection_response/prebuilt_rules/prebuilt_rules_notifications.cy.ts index 9202b77044e93..3ee378f12f3d3 100644 --- a/x-pack/test/security_solution_cypress/cypress/e2e/detection_response/prebuilt_rules/prebuilt_rules_notifications.cy.ts +++ b/x-pack/test/security_solution_cypress/cypress/e2e/detection_response/prebuilt_rules/prebuilt_rules_notifications.cy.ts @@ -29,9 +29,10 @@ const RULE_1 = createRuleAssetSavedObject({ rule_id: 'rule_1', }); +// TODO: https://github.com/elastic/kibana/issues/161540 describe( 'Detection rules, Prebuilt Rules Installation and Update Notifications', - { tags: ['@ess', '@brokenInServerless'] }, + { tags: ['@ess', '@serverless', '@brokenInServerless'] }, () => { beforeEach(() => { login(); diff --git a/x-pack/test/security_solution_cypress/cypress/e2e/detection_response/rule_actions/rule_actions.cy.ts b/x-pack/test/security_solution_cypress/cypress/e2e/detection_response/rule_actions/rule_actions.cy.ts index a4b15f68cdcb9..76ea3a63a949f 100644 --- a/x-pack/test/security_solution_cypress/cypress/e2e/detection_response/rule_actions/rule_actions.cy.ts +++ b/x-pack/test/security_solution_cypress/cypress/e2e/detection_response/rule_actions/rule_actions.cy.ts @@ -27,9 +27,10 @@ import { login, visit } from '../../../tasks/login'; import { RULE_CREATION } from '../../../urls/navigation'; +// TODO: https://github.com/elastic/kibana/issues/161539 describe( 'Rule actions during detection rule creation', - { tags: ['@ess', '@brokenInServerless'] }, + { tags: ['@ess', '@serverless', '@brokenInServerless'] }, () => { const indexConnector = getIndexConnector(); diff --git a/x-pack/test/security_solution_cypress/cypress/e2e/detection_response/rule_creation/custom_query_rule.cy.ts b/x-pack/test/security_solution_cypress/cypress/e2e/detection_response/rule_creation/custom_query_rule.cy.ts index 7bb89b35ca83a..4acbbb6c816e9 100644 --- a/x-pack/test/security_solution_cypress/cypress/e2e/detection_response/rule_creation/custom_query_rule.cy.ts +++ b/x-pack/test/security_solution_cypress/cypress/e2e/detection_response/rule_creation/custom_query_rule.cy.ts @@ -113,7 +113,8 @@ import { enablesRule, getDetails, waitForTheRuleToBeExecuted } from '../../../ta import { RULE_CREATION } from '../../../urls/navigation'; -describe('Custom query rules', { tags: ['@ess', '@brokenInServerless'] }, () => { +// TODO: https://github.com/elastic/kibana/issues/161539 +describe('Custom query rules', { tags: ['@ess', '@serverless', '@brokenInServerless'] }, () => { beforeEach(() => { deleteAlertsAndRules(); }); diff --git a/x-pack/test/security_solution_cypress/cypress/e2e/detection_response/rule_creation/custom_query_rule_data_view.cy.ts b/x-pack/test/security_solution_cypress/cypress/e2e/detection_response/rule_creation/custom_query_rule_data_view.cy.ts index 2c2f44024e7a2..0f4271802f06a 100644 --- a/x-pack/test/security_solution_cypress/cypress/e2e/detection_response/rule_creation/custom_query_rule_data_view.cy.ts +++ b/x-pack/test/security_solution_cypress/cypress/e2e/detection_response/rule_creation/custom_query_rule_data_view.cy.ts @@ -67,7 +67,8 @@ import { getDetails, waitForTheRuleToBeExecuted } from '../../../tasks/rule_deta import { RULE_CREATION } from '../../../urls/navigation'; -describe('Custom query rules', { tags: ['@ess', '@brokenInServerless'] }, () => { +// TODO: https://github.com/elastic/kibana/issues/161539 +describe('Custom query rules', { tags: ['@ess', '@serverless', '@brokenInServerless'] }, () => { describe('Custom detection rules creation with data views', () => { const rule = getDataViewRule(); const expectedUrls = rule.references?.join(''); diff --git a/x-pack/test/security_solution_cypress/cypress/e2e/detection_response/rule_creation/custom_saved_query_rule.cy.ts b/x-pack/test/security_solution_cypress/cypress/e2e/detection_response/rule_creation/custom_saved_query_rule.cy.ts index fc9dd511aa21f..1e76946d4aba5 100644 --- a/x-pack/test/security_solution_cypress/cypress/e2e/detection_response/rule_creation/custom_saved_query_rule.cy.ts +++ b/x-pack/test/security_solution_cypress/cypress/e2e/detection_response/rule_creation/custom_saved_query_rule.cy.ts @@ -45,204 +45,209 @@ const savedQueryName = 'custom saved query'; const savedQueryQuery = 'process.name: test'; const savedQueryFilterKey = 'testAgent.value'; -describe('Custom saved_query rules', { tags: ['@ess', '@brokenInServerless'] }, () => { - before(() => { - cleanKibana(); - }); - - describe('Custom saved_query detection rule creation', () => { - beforeEach(() => { - login(); - deleteAlertsAndRules(); - deleteSavedQueries(); +// TODO: https://github.com/elastic/kibana/issues/161539 +describe( + 'Custom saved_query rules', + { tags: ['@ess', '@serverless', '@brokenInServerless'] }, + () => { + before(() => { + cleanKibana(); }); - it('Creates saved query rule', function () { - const rule = getSavedQueryRule(); - createSavedQuery(savedQueryName, savedQueryQuery, savedQueryFilterKey); - visit(RULE_CREATION); + describe('Custom saved_query detection rule creation', () => { + beforeEach(() => { + login(); + deleteAlertsAndRules(); + deleteSavedQueries(); + }); - selectAndLoadSavedQuery(savedQueryName, savedQueryQuery); + it('Creates saved query rule', function () { + const rule = getSavedQueryRule(); + createSavedQuery(savedQueryName, savedQueryQuery, savedQueryFilterKey); + visit(RULE_CREATION); - // edit loaded saved query - getCustomQueryInput() - .type(' AND random query') - .should('have.value', [savedQueryQuery, ' AND random query'].join('')); + selectAndLoadSavedQuery(savedQueryName, savedQueryQuery); - // when clicking load query dynamically checkbox, saved query should be shown in query input and input should be disabled - checkLoadQueryDynamically(); - getCustomQueryInput().should('have.value', savedQueryQuery).should('be.disabled'); - cy.get(QUERY_BAR).should('contain', savedQueryFilterKey); + // edit loaded saved query + getCustomQueryInput() + .type(' AND random query') + .should('have.value', [savedQueryQuery, ' AND random query'].join('')); - cy.get(DEFINE_CONTINUE_BUTTON).should('exist').click(); + // when clicking load query dynamically checkbox, saved query should be shown in query input and input should be disabled + checkLoadQueryDynamically(); + getCustomQueryInput().should('have.value', savedQueryQuery).should('be.disabled'); + cy.get(QUERY_BAR).should('contain', savedQueryFilterKey); - fillAboutRuleAndContinue(rule); - fillScheduleRuleAndContinue(rule); - cy.intercept('POST', '/api/detection_engine/rules').as('savedQueryRule'); - createAndEnableRule(); + cy.get(DEFINE_CONTINUE_BUTTON).should('exist').click(); - cy.wait('@savedQueryRule').then(({ response }) => { - // created rule should have saved_query type - cy.wrap(response?.body.type).should('equal', 'saved_query'); - }); + fillAboutRuleAndContinue(rule); + fillScheduleRuleAndContinue(rule); + cy.intercept('POST', '/api/detection_engine/rules').as('savedQueryRule'); + createAndEnableRule(); - goToRuleDetails(); + cy.wait('@savedQueryRule').then(({ response }) => { + // created rule should have saved_query type + cy.wrap(response?.body.type).should('equal', 'saved_query'); + }); - cy.get(RULE_NAME_HEADER).should('contain', `${rule.name}`); + goToRuleDetails(); - cy.get(DEFINE_RULE_PANEL_PROGRESS).should('not.exist'); + cy.get(RULE_NAME_HEADER).should('contain', `${rule.name}`); - getDetails(SAVED_QUERY_NAME_DETAILS).should('contain', savedQueryName); - getDetails(SAVED_QUERY_DETAILS).should('contain', savedQueryQuery); - getDetails(SAVED_QUERY_FILTERS_DETAILS).should('contain', savedQueryFilterKey); - }); + cy.get(DEFINE_RULE_PANEL_PROGRESS).should('not.exist'); - context('Non existent saved query', () => { - const FAILED_TO_LOAD_ERROR = 'Failed to load the saved query'; - beforeEach(() => { - createRule(getSavedQueryRule({ saved_id: 'non-existent', query: undefined })); - visit(SECURITY_DETECTIONS_RULES_URL); + getDetails(SAVED_QUERY_NAME_DETAILS).should('contain', savedQueryName); + getDetails(SAVED_QUERY_DETAILS).should('contain', savedQueryQuery); + getDetails(SAVED_QUERY_FILTERS_DETAILS).should('contain', savedQueryFilterKey); }); - it('Shows error toast on details page when saved query can not be loaded', function () { - goToRuleDetails(); - cy.get(TOASTER).should('contain', FAILED_TO_LOAD_ERROR); - }); + context('Non existent saved query', () => { + const FAILED_TO_LOAD_ERROR = 'Failed to load the saved query'; + beforeEach(() => { + createRule(getSavedQueryRule({ saved_id: 'non-existent', query: undefined })); + visit(SECURITY_DETECTIONS_RULES_URL); + }); + it('Shows error toast on details page when saved query can not be loaded', function () { + goToRuleDetails(); - it('Shows validation error on rule edit when saved query can not be loaded', function () { - editFirstRule(); + cy.get(TOASTER).should('contain', FAILED_TO_LOAD_ERROR); + }); - cy.get(TOASTER).should('contain', FAILED_TO_LOAD_ERROR); - }); + it('Shows validation error on rule edit when saved query can not be loaded', function () { + editFirstRule(); - it('Allows to update saved_query rule with non-existent query', () => { - editFirstRule(); + cy.get(TOASTER).should('contain', FAILED_TO_LOAD_ERROR); + }); - cy.get(LOAD_QUERY_DYNAMICALLY_CHECKBOX).should('exist'); + it('Allows to update saved_query rule with non-existent query', () => { + editFirstRule(); - cy.intercept('PUT', '/api/detection_engine/rules').as('editedRule'); - saveEditedRule(); + cy.get(LOAD_QUERY_DYNAMICALLY_CHECKBOX).should('exist'); - cy.wait('@editedRule').then(({ response }) => { - // updated rule type shouldn't change - cy.wrap(response?.body.type).should('equal', 'saved_query'); - }); + cy.intercept('PUT', '/api/detection_engine/rules').as('editedRule'); + saveEditedRule(); - cy.get(DEFINE_RULE_PANEL_PROGRESS).should('not.exist'); + cy.wait('@editedRule').then(({ response }) => { + // updated rule type shouldn't change + cy.wrap(response?.body.type).should('equal', 'saved_query'); + }); - assertDetailsNotExist(SAVED_QUERY_NAME_DETAILS); - assertDetailsNotExist(SAVED_QUERY_DETAILS); - }); - }); + cy.get(DEFINE_RULE_PANEL_PROGRESS).should('not.exist'); - context('Editing', () => { - it('Allows to update query rule as saved_query rule type', () => { - createSavedQuery(savedQueryName, savedQueryQuery); - createRule(getNewRule()); + assertDetailsNotExist(SAVED_QUERY_NAME_DETAILS); + assertDetailsNotExist(SAVED_QUERY_DETAILS); + }); + }); - visit(SECURITY_DETECTIONS_RULES_URL); + context('Editing', () => { + it('Allows to update query rule as saved_query rule type', () => { + createSavedQuery(savedQueryName, savedQueryQuery); + createRule(getNewRule()); - editFirstRule(); + visit(SECURITY_DETECTIONS_RULES_URL); - selectAndLoadSavedQuery(savedQueryName, savedQueryQuery); - checkLoadQueryDynamically(); + editFirstRule(); - cy.intercept('PUT', '/api/detection_engine/rules').as('editedRule'); - saveEditedRule(); + selectAndLoadSavedQuery(savedQueryName, savedQueryQuery); + checkLoadQueryDynamically(); - cy.wait('@editedRule').then(({ response }) => { - // updated rule should be saved as saved_query type once Load query dynamically checkbox was checked - cy.wrap(response?.body.type).should('equal', 'saved_query'); - }); + cy.intercept('PUT', '/api/detection_engine/rules').as('editedRule'); + saveEditedRule(); - cy.get(DEFINE_RULE_PANEL_PROGRESS).should('not.exist'); + cy.wait('@editedRule').then(({ response }) => { + // updated rule should be saved as saved_query type once Load query dynamically checkbox was checked + cy.wrap(response?.body.type).should('equal', 'saved_query'); + }); - getDetails(SAVED_QUERY_NAME_DETAILS).should('contain', savedQueryName); - getDetails(SAVED_QUERY_DETAILS).should('contain', savedQueryQuery); - }); + cy.get(DEFINE_RULE_PANEL_PROGRESS).should('not.exist'); - it('Allows to update saved_query rule as query rule type', () => { - const expectedCustomTestQuery = 'random test query'; - createSavedQuery(savedQueryName, savedQueryQuery).then((response) => { - cy.log(JSON.stringify(response.body, null, 2)); - createRule(getSavedQueryRule({ saved_id: response.body.id, query: undefined })); + getDetails(SAVED_QUERY_NAME_DETAILS).should('contain', savedQueryName); + getDetails(SAVED_QUERY_DETAILS).should('contain', savedQueryQuery); }); - visit(SECURITY_DETECTIONS_RULES_URL); + it('Allows to update saved_query rule as query rule type', () => { + const expectedCustomTestQuery = 'random test query'; + createSavedQuery(savedQueryName, savedQueryQuery).then((response) => { + cy.log(JSON.stringify(response.body, null, 2)); + createRule(getSavedQueryRule({ saved_id: response.body.id, query: undefined })); + }); - editFirstRule(); + visit(SECURITY_DETECTIONS_RULES_URL); - // query input should be disabled and has value of saved query - getCustomQueryInput().should('have.value', savedQueryQuery).should('be.disabled'); + editFirstRule(); + + // query input should be disabled and has value of saved query + getCustomQueryInput().should('have.value', savedQueryQuery).should('be.disabled'); - // after unchecking Load Query Dynamically checkbox, query input becomes enabled, type custom query - uncheckLoadQueryDynamically(); - getCustomQueryInput().should('be.enabled').clear().type(expectedCustomTestQuery); + // after unchecking Load Query Dynamically checkbox, query input becomes enabled, type custom query + uncheckLoadQueryDynamically(); + getCustomQueryInput().should('be.enabled').clear().type(expectedCustomTestQuery); - cy.intercept('PUT', '/api/detection_engine/rules').as('editedRule'); - saveEditedRule(); + cy.intercept('PUT', '/api/detection_engine/rules').as('editedRule'); + saveEditedRule(); - cy.wait('@editedRule').then(({ response }) => { - // updated rule should be saved as query type once Load query dynamically checkbox was unchecked - cy.wrap(response?.body.type).should('equal', 'query'); + cy.wait('@editedRule').then(({ response }) => { + // updated rule should be saved as query type once Load query dynamically checkbox was unchecked + cy.wrap(response?.body.type).should('equal', 'query'); + }); + + getDetails(CUSTOM_QUERY_DETAILS).should('contain', expectedCustomTestQuery); }); - getDetails(CUSTOM_QUERY_DETAILS).should('contain', expectedCustomTestQuery); - }); + it('Allows to update saved_query rule with non-existent query by adding custom query', () => { + const expectedCustomTestQuery = 'random test query'; + createRule(getSavedQueryRule({ saved_id: 'non-existent', query: undefined })); - it('Allows to update saved_query rule with non-existent query by adding custom query', () => { - const expectedCustomTestQuery = 'random test query'; - createRule(getSavedQueryRule({ saved_id: 'non-existent', query: undefined })); + visit(SECURITY_DETECTIONS_RULES_URL); - visit(SECURITY_DETECTIONS_RULES_URL); + editFirstRule(); + uncheckLoadQueryDynamically(); - editFirstRule(); - uncheckLoadQueryDynamically(); + // type custom query, ensure Load dynamically checkbox is absent, as rule can't be saved win non valid saved query + getCustomQueryInput().type(expectedCustomTestQuery); + cy.get(LOAD_QUERY_DYNAMICALLY_CHECKBOX).should('not.visible'); - // type custom query, ensure Load dynamically checkbox is absent, as rule can't be saved win non valid saved query - getCustomQueryInput().type(expectedCustomTestQuery); - cy.get(LOAD_QUERY_DYNAMICALLY_CHECKBOX).should('not.visible'); + cy.intercept('PUT', '/api/detection_engine/rules').as('editedRule'); + saveEditedRule(); - cy.intercept('PUT', '/api/detection_engine/rules').as('editedRule'); - saveEditedRule(); + cy.wait('@editedRule').then(({ response }) => { + // updated rule should be saved as query type once Load query dynamically checkbox was unchecked + cy.wrap(response?.body.type).should('equal', 'query'); + }); - cy.wait('@editedRule').then(({ response }) => { - // updated rule should be saved as query type once Load query dynamically checkbox was unchecked - cy.wrap(response?.body.type).should('equal', 'query'); + getDetails(CUSTOM_QUERY_DETAILS).should('contain', expectedCustomTestQuery); }); - getDetails(CUSTOM_QUERY_DETAILS).should('contain', expectedCustomTestQuery); - }); - - it('Allows to update saved_query rule with non-existent query by selecting another saved query', () => { - createSavedQuery(savedQueryName, savedQueryQuery); - createRule(getSavedQueryRule({ saved_id: 'non-existent', query: undefined })); + it('Allows to update saved_query rule with non-existent query by selecting another saved query', () => { + createSavedQuery(savedQueryName, savedQueryQuery); + createRule(getSavedQueryRule({ saved_id: 'non-existent', query: undefined })); - visit(SECURITY_DETECTIONS_RULES_URL); + visit(SECURITY_DETECTIONS_RULES_URL); - editFirstRule(); - uncheckLoadQueryDynamically(); + editFirstRule(); + uncheckLoadQueryDynamically(); - // select another saved query, edit query input, which later should be dismissed once Load query dynamically checkbox checked - selectAndLoadSavedQuery(savedQueryName, savedQueryQuery); - getCustomQueryInput().type('AND this part wil be dismissed'); + // select another saved query, edit query input, which later should be dismissed once Load query dynamically checkbox checked + selectAndLoadSavedQuery(savedQueryName, savedQueryQuery); + getCustomQueryInput().type('AND this part wil be dismissed'); - checkLoadQueryDynamically(); - getCustomQueryInput().should('have.value', savedQueryQuery); + checkLoadQueryDynamically(); + getCustomQueryInput().should('have.value', savedQueryQuery); - cy.intercept('PUT', '/api/detection_engine/rules').as('editedRule'); - saveEditedRule(); + cy.intercept('PUT', '/api/detection_engine/rules').as('editedRule'); + saveEditedRule(); - cy.wait('@editedRule').then(({ response }) => { - // updated rule type shouldn't change - cy.wrap(response?.body.type).should('equal', 'saved_query'); - }); + cy.wait('@editedRule').then(({ response }) => { + // updated rule type shouldn't change + cy.wrap(response?.body.type).should('equal', 'saved_query'); + }); - cy.get(DEFINE_RULE_PANEL_PROGRESS).should('not.exist'); + cy.get(DEFINE_RULE_PANEL_PROGRESS).should('not.exist'); - getDetails(SAVED_QUERY_NAME_DETAILS).should('contain', savedQueryName); - getDetails(SAVED_QUERY_DETAILS).should('contain', savedQueryQuery); + getDetails(SAVED_QUERY_NAME_DETAILS).should('contain', savedQueryName); + getDetails(SAVED_QUERY_DETAILS).should('contain', savedQueryQuery); + }); }); }); - }); -}); + } +); diff --git a/x-pack/test/security_solution_cypress/cypress/e2e/detection_response/rule_creation/event_correlation_rule.cy.ts b/x-pack/test/security_solution_cypress/cypress/e2e/detection_response/rule_creation/event_correlation_rule.cy.ts index a558ac6ccedb7..c5402563fff46 100644 --- a/x-pack/test/security_solution_cypress/cypress/e2e/detection_response/rule_creation/event_correlation_rule.cy.ts +++ b/x-pack/test/security_solution_cypress/cypress/e2e/detection_response/rule_creation/event_correlation_rule.cy.ts @@ -60,7 +60,8 @@ import { login, visit } from '../../../tasks/login'; import { RULE_CREATION } from '../../../urls/navigation'; -describe('EQL rules', { tags: ['@ess', '@brokenInServerless'] }, () => { +// TODO: https://github.com/elastic/kibana/issues/161539 +describe('EQL rules', { tags: ['@ess', '@serverless', '@brokenInServerless'] }, () => { before(() => { cleanKibana(); }); diff --git a/x-pack/test/security_solution_cypress/cypress/e2e/detection_response/rule_creation/indicator_match_rule.cy.ts b/x-pack/test/security_solution_cypress/cypress/e2e/detection_response/rule_creation/indicator_match_rule.cy.ts index 9e896fa6861fd..21b6421f35d6c 100644 --- a/x-pack/test/security_solution_cypress/cypress/e2e/detection_response/rule_creation/indicator_match_rule.cy.ts +++ b/x-pack/test/security_solution_cypress/cypress/e2e/detection_response/rule_creation/indicator_match_rule.cy.ts @@ -111,7 +111,8 @@ import { DETECTIONS_RULE_MANAGEMENT_URL, RULE_CREATION } from '../../../urls/nav const DEFAULT_THREAT_MATCH_QUERY = '@timestamp >= "now-30d/d"'; -describe('indicator match', { tags: ['@ess', '@brokenInServerless'] }, () => { +// TODO: https://github.com/elastic/kibana/issues/161539 +describe('indicator match', { tags: ['@ess', '@serverless', '@brokenInServerless'] }, () => { describe('Detection rules, Indicator Match', () => { const expectedUrls = getNewThreatIndicatorRule().references?.join(''); const expectedFalsePositives = getNewThreatIndicatorRule().false_positives?.join(''); diff --git a/x-pack/test/security_solution_cypress/cypress/e2e/detection_response/rule_creation/machine_learning_rule.cy.ts b/x-pack/test/security_solution_cypress/cypress/e2e/detection_response/rule_creation/machine_learning_rule.cy.ts index e65764dff6203..569be1fb7d7b9 100644 --- a/x-pack/test/security_solution_cypress/cypress/e2e/detection_response/rule_creation/machine_learning_rule.cy.ts +++ b/x-pack/test/security_solution_cypress/cypress/e2e/detection_response/rule_creation/machine_learning_rule.cy.ts @@ -53,76 +53,81 @@ import { login, visitWithoutDateRange } from '../../../tasks/login'; import { RULE_CREATION } from '../../../urls/navigation'; -describe('Detection rules, machine learning', { tags: ['@ess', '@brokenInServerless'] }, () => { - const expectedUrls = (getMachineLearningRule().references ?? []).join(''); - const expectedFalsePositives = (getMachineLearningRule().false_positives ?? []).join(''); - const expectedTags = (getMachineLearningRule().tags ?? []).join(''); - const expectedMitre = formatMitreAttackDescription(getMachineLearningRule().threat ?? []); - const expectedNumberOfRules = 1; +// TODO: https://github.com/elastic/kibana/issues/161539 +describe( + 'Detection rules, machine learning', + { tags: ['@ess', '@serverless', '@brokenInServerless'] }, + () => { + const expectedUrls = (getMachineLearningRule().references ?? []).join(''); + const expectedFalsePositives = (getMachineLearningRule().false_positives ?? []).join(''); + const expectedTags = (getMachineLearningRule().tags ?? []).join(''); + const expectedMitre = formatMitreAttackDescription(getMachineLearningRule().threat ?? []); + const expectedNumberOfRules = 1; - before(() => { - cleanKibana(); - }); + before(() => { + cleanKibana(); + }); - beforeEach(() => { - login(); - visitWithoutDateRange(RULE_CREATION); - }); + beforeEach(() => { + login(); + visitWithoutDateRange(RULE_CREATION); + }); - it('Creates and enables a new ml rule', () => { - const mlRule = getMachineLearningRule(); - selectMachineLearningRuleType(); - fillDefineMachineLearningRuleAndContinue(mlRule); - fillAboutRuleAndContinue(mlRule); - fillScheduleRuleAndContinue(mlRule); - createAndEnableRule(); + it('Creates and enables a new ml rule', () => { + const mlRule = getMachineLearningRule(); + selectMachineLearningRuleType(); + fillDefineMachineLearningRuleAndContinue(mlRule); + fillAboutRuleAndContinue(mlRule); + fillScheduleRuleAndContinue(mlRule); + createAndEnableRule(); - cy.get(CUSTOM_RULES_BTN).should('have.text', 'Custom rules (1)'); + cy.get(CUSTOM_RULES_BTN).should('have.text', 'Custom rules (1)'); - expectNumberOfRules(RULES_MANAGEMENT_TABLE, expectedNumberOfRules); + expectNumberOfRules(RULES_MANAGEMENT_TABLE, expectedNumberOfRules); - cy.get(RULE_NAME).should('have.text', mlRule.name); - cy.get(RISK_SCORE).should('have.text', mlRule.risk_score); - cy.get(SEVERITY).should('have.text', 'Critical'); - cy.get(RULE_SWITCH).should('have.attr', 'aria-checked', 'true'); + cy.get(RULE_NAME).should('have.text', mlRule.name); + cy.get(RISK_SCORE).should('have.text', mlRule.risk_score); + cy.get(SEVERITY).should('have.text', 'Critical'); + cy.get(RULE_SWITCH).should('have.attr', 'aria-checked', 'true'); - goToRuleDetails(); + goToRuleDetails(); - cy.get(RULE_NAME_HEADER).should('contain', `${mlRule.name}`); - cy.get(ABOUT_RULE_DESCRIPTION).should('have.text', mlRule.description); - cy.get(ABOUT_DETAILS).within(() => { - getDetails(SEVERITY_DETAILS).should('have.text', 'Critical'); - getDetails(RISK_SCORE_DETAILS).should('have.text', mlRule.risk_score); - getDetails(REFERENCE_URLS_DETAILS).should((details) => { - expect(removeExternalLinkText(details.text())).equal(expectedUrls); + cy.get(RULE_NAME_HEADER).should('contain', `${mlRule.name}`); + cy.get(ABOUT_RULE_DESCRIPTION).should('have.text', mlRule.description); + cy.get(ABOUT_DETAILS).within(() => { + getDetails(SEVERITY_DETAILS).should('have.text', 'Critical'); + getDetails(RISK_SCORE_DETAILS).should('have.text', mlRule.risk_score); + getDetails(REFERENCE_URLS_DETAILS).should((details) => { + expect(removeExternalLinkText(details.text())).equal(expectedUrls); + }); + getDetails(FALSE_POSITIVES_DETAILS).should('have.text', expectedFalsePositives); + getDetails(MITRE_ATTACK_DETAILS).should((mitre) => { + expect(removeExternalLinkText(mitre.text())).equal(expectedMitre); + }); + getDetails(TAGS_DETAILS).should('have.text', expectedTags); }); - getDetails(FALSE_POSITIVES_DETAILS).should('have.text', expectedFalsePositives); - getDetails(MITRE_ATTACK_DETAILS).should((mitre) => { - expect(removeExternalLinkText(mitre.text())).equal(expectedMitre); + cy.get(DEFINITION_DETAILS).within(() => { + getDetails(ANOMALY_SCORE_DETAILS).should('have.text', mlRule.anomaly_threshold); + getDetails(RULE_TYPE_DETAILS).should('have.text', 'Machine Learning'); + getDetails(TIMELINE_TEMPLATE_DETAILS).should('have.text', 'None'); + const machineLearningJobsArray = isArray(mlRule.machine_learning_job_id) + ? mlRule.machine_learning_job_id + : [mlRule.machine_learning_job_id]; + // With the #1912 ML rule improvement changes we enable jobs on rule creation. + // Though, in cypress jobs enabling does not work reliably and job can be started or stopped. + // Thus, we disable next check till we fix the issue with enabling jobs in cypress. + // Relevant ticket: https://github.com/elastic/security-team/issues/5389 + // cy.get(MACHINE_LEARNING_JOB_STATUS).should('have.text', 'StoppedStopped'); + cy.get(MACHINE_LEARNING_JOB_ID).should('have.text', machineLearningJobsArray.join('')); + }); + cy.get(SCHEDULE_DETAILS).within(() => { + getDetails(RUNS_EVERY_DETAILS).should('have.text', `${mlRule.interval}`); + const humanizedDuration = getHumanizedDuration( + mlRule.from ?? 'now-6m', + mlRule.interval ?? '5m' + ); + getDetails(ADDITIONAL_LOOK_BACK_DETAILS).should('have.text', `${humanizedDuration}`); }); - getDetails(TAGS_DETAILS).should('have.text', expectedTags); - }); - cy.get(DEFINITION_DETAILS).within(() => { - getDetails(ANOMALY_SCORE_DETAILS).should('have.text', mlRule.anomaly_threshold); - getDetails(RULE_TYPE_DETAILS).should('have.text', 'Machine Learning'); - getDetails(TIMELINE_TEMPLATE_DETAILS).should('have.text', 'None'); - const machineLearningJobsArray = isArray(mlRule.machine_learning_job_id) - ? mlRule.machine_learning_job_id - : [mlRule.machine_learning_job_id]; - // With the #1912 ML rule improvement changes we enable jobs on rule creation. - // Though, in cypress jobs enabling does not work reliably and job can be started or stopped. - // Thus, we disable next check till we fix the issue with enabling jobs in cypress. - // Relevant ticket: https://github.com/elastic/security-team/issues/5389 - // cy.get(MACHINE_LEARNING_JOB_STATUS).should('have.text', 'StoppedStopped'); - cy.get(MACHINE_LEARNING_JOB_ID).should('have.text', machineLearningJobsArray.join('')); - }); - cy.get(SCHEDULE_DETAILS).within(() => { - getDetails(RUNS_EVERY_DETAILS).should('have.text', `${mlRule.interval}`); - const humanizedDuration = getHumanizedDuration( - mlRule.from ?? 'now-6m', - mlRule.interval ?? '5m' - ); - getDetails(ADDITIONAL_LOOK_BACK_DETAILS).should('have.text', `${humanizedDuration}`); }); - }); -}); + } +); diff --git a/x-pack/test/security_solution_cypress/cypress/e2e/detection_response/rule_creation/new_terms_rule.cy.ts b/x-pack/test/security_solution_cypress/cypress/e2e/detection_response/rule_creation/new_terms_rule.cy.ts index 2b840111b97bc..8b65f37005e6e 100644 --- a/x-pack/test/security_solution_cypress/cypress/e2e/detection_response/rule_creation/new_terms_rule.cy.ts +++ b/x-pack/test/security_solution_cypress/cypress/e2e/detection_response/rule_creation/new_terms_rule.cy.ts @@ -58,7 +58,8 @@ import { login, visit } from '../../../tasks/login'; import { RULE_CREATION } from '../../../urls/navigation'; -describe('New Terms rules', { tags: ['@ess', '@brokenInServerless'] }, () => { +// TODO: https://github.com/elastic/kibana/issues/161539 +describe('New Terms rules', { tags: ['@ess', '@serverless', '@brokenInServerless'] }, () => { before(() => { cleanKibana(); login(); diff --git a/x-pack/test/security_solution_cypress/cypress/e2e/detection_response/rule_creation/override.cy.ts b/x-pack/test/security_solution_cypress/cypress/e2e/detection_response/rule_creation/override.cy.ts index 4aa1bb9e56724..a5315fcce8116 100644 --- a/x-pack/test/security_solution_cypress/cypress/e2e/detection_response/rule_creation/override.cy.ts +++ b/x-pack/test/security_solution_cypress/cypress/e2e/detection_response/rule_creation/override.cy.ts @@ -61,91 +61,99 @@ import { getDetails, waitForTheRuleToBeExecuted } from '../../../tasks/rule_deta import { RULE_CREATION } from '../../../urls/navigation'; -describe('Detection rules, override', { tags: ['@ess', '@brokenInServerless'] }, () => { - const rule = getNewOverrideRule(); - const expectedUrls = rule.references?.join(''); - const expectedFalsePositives = rule.false_positives?.join(''); - const expectedTags = rule.tags?.join(''); - const mitreAttack = rule.threat; - const expectedMitre = formatMitreAttackDescription(mitreAttack ?? []); +// TODO: https://github.com/elastic/kibana/issues/161539 +describe( + 'Detection rules, override', + { tags: ['@ess', '@serverless', '@brokenInServerless'] }, + () => { + const rule = getNewOverrideRule(); + const expectedUrls = rule.references?.join(''); + const expectedFalsePositives = rule.false_positives?.join(''); + const expectedTags = rule.tags?.join(''); + const mitreAttack = rule.threat; + const expectedMitre = formatMitreAttackDescription(mitreAttack ?? []); - beforeEach(() => { - login(); - deleteAlertsAndRules(); - }); + beforeEach(() => { + login(); + deleteAlertsAndRules(); + }); - it('Creates and enables a new custom rule with override option', function () { - visitWithoutDateRange(RULE_CREATION); - fillDefineCustomRuleAndContinue(rule); - fillAboutRuleWithOverrideAndContinue(rule); - fillScheduleRuleAndContinue(rule); - createAndEnableRule(); + it('Creates and enables a new custom rule with override option', function () { + visitWithoutDateRange(RULE_CREATION); + fillDefineCustomRuleAndContinue(rule); + fillAboutRuleWithOverrideAndContinue(rule); + fillScheduleRuleAndContinue(rule); + createAndEnableRule(); - cy.get(CUSTOM_RULES_BTN).should('have.text', 'Custom rules (1)'); + cy.get(CUSTOM_RULES_BTN).should('have.text', 'Custom rules (1)'); - expectNumberOfRules(RULES_MANAGEMENT_TABLE, 1); + expectNumberOfRules(RULES_MANAGEMENT_TABLE, 1); - cy.get(RULE_NAME).should('have.text', rule.name); - cy.get(RISK_SCORE).should('have.text', rule.risk_score); - cy.get(SEVERITY).should('have.text', 'High'); - cy.get(RULE_SWITCH).should('have.attr', 'aria-checked', 'true'); + cy.get(RULE_NAME).should('have.text', rule.name); + cy.get(RISK_SCORE).should('have.text', rule.risk_score); + cy.get(SEVERITY).should('have.text', 'High'); + cy.get(RULE_SWITCH).should('have.attr', 'aria-checked', 'true'); - goToRuleDetails(); + goToRuleDetails(); - cy.get(RULE_NAME_HEADER).should('contain', `${rule.name}`); - cy.get(ABOUT_RULE_DESCRIPTION).should('have.text', rule.description); - cy.get(ABOUT_DETAILS).within(() => { - getDetails(SEVERITY_DETAILS).should('have.text', 'High'); - getDetails(RISK_SCORE_DETAILS).should('have.text', rule.risk_score); - getDetails(RISK_SCORE_OVERRIDE_DETAILS).should( - 'have.text', - `${rule.risk_score_mapping?.[0].field}kibana.alert.risk_score` - ); - getDetails(RULE_NAME_OVERRIDE_DETAILS).should('have.text', rule.rule_name_override); - getDetails(REFERENCE_URLS_DETAILS).should((details) => { - expect(removeExternalLinkText(details.text())).equal(expectedUrls); + cy.get(RULE_NAME_HEADER).should('contain', `${rule.name}`); + cy.get(ABOUT_RULE_DESCRIPTION).should('have.text', rule.description); + cy.get(ABOUT_DETAILS).within(() => { + getDetails(SEVERITY_DETAILS).should('have.text', 'High'); + getDetails(RISK_SCORE_DETAILS).should('have.text', rule.risk_score); + getDetails(RISK_SCORE_OVERRIDE_DETAILS).should( + 'have.text', + `${rule.risk_score_mapping?.[0].field}kibana.alert.risk_score` + ); + getDetails(RULE_NAME_OVERRIDE_DETAILS).should('have.text', rule.rule_name_override); + getDetails(REFERENCE_URLS_DETAILS).should((details) => { + expect(removeExternalLinkText(details.text())).equal(expectedUrls); + }); + getDetails(FALSE_POSITIVES_DETAILS).should('have.text', expectedFalsePositives); + getDetails(MITRE_ATTACK_DETAILS).should((mitre) => { + expect(removeExternalLinkText(mitre.text())).equal(expectedMitre); + }); + getDetails(TAGS_DETAILS).should('have.text', expectedTags); + getDetails(TIMESTAMP_OVERRIDE_DETAILS).should('have.text', rule.timestamp_override); + cy.contains(DETAILS_TITLE, 'Severity override') + .invoke('index', DETAILS_TITLE) // get index relative to other titles, not all siblings + .then((severityOverrideIndex) => { + rule.severity_mapping?.forEach((severity, i) => { + cy.get(DETAILS_DESCRIPTION) + .eq(severityOverrideIndex + i) + .should( + 'have.text', + `${severity.field}:${severity.value}${getSeveritiesOverride()[i]}` + ); + }); + }); }); - getDetails(FALSE_POSITIVES_DETAILS).should('have.text', expectedFalsePositives); - getDetails(MITRE_ATTACK_DETAILS).should((mitre) => { - expect(removeExternalLinkText(mitre.text())).equal(expectedMitre); + cy.get(INVESTIGATION_NOTES_TOGGLE).click(); + cy.get(ABOUT_INVESTIGATION_NOTES).should('have.text', INVESTIGATION_NOTES_MARKDOWN); + cy.get(DEFINITION_DETAILS).within(() => { + getDetails(INDEX_PATTERNS_DETAILS).should('have.text', getIndexPatterns().join('')); + getDetails(CUSTOM_QUERY_DETAILS).should('have.text', rule.query); + getDetails(RULE_TYPE_DETAILS).should('have.text', 'Query'); + getDetails(TIMELINE_TEMPLATE_DETAILS).should('have.text', 'None'); + }); + cy.get(SCHEDULE_DETAILS).within(() => { + getDetails(RUNS_EVERY_DETAILS).should('have.text', `${rule.interval}`); + const humanizedDuration = getHumanizedDuration( + rule.from ?? 'now-6m', + rule.interval ?? '5m' + ); + getDetails(ADDITIONAL_LOOK_BACK_DETAILS).should('have.text', `${humanizedDuration}`); }); - getDetails(TAGS_DETAILS).should('have.text', expectedTags); - getDetails(TIMESTAMP_OVERRIDE_DETAILS).should('have.text', rule.timestamp_override); - cy.contains(DETAILS_TITLE, 'Severity override') - .invoke('index', DETAILS_TITLE) // get index relative to other titles, not all siblings - .then((severityOverrideIndex) => { - rule.severity_mapping?.forEach((severity, i) => { - cy.get(DETAILS_DESCRIPTION) - .eq(severityOverrideIndex + i) - .should( - 'have.text', - `${severity.field}:${severity.value}${getSeveritiesOverride()[i]}` - ); - }); - }); - }); - cy.get(INVESTIGATION_NOTES_TOGGLE).click(); - cy.get(ABOUT_INVESTIGATION_NOTES).should('have.text', INVESTIGATION_NOTES_MARKDOWN); - cy.get(DEFINITION_DETAILS).within(() => { - getDetails(INDEX_PATTERNS_DETAILS).should('have.text', getIndexPatterns().join('')); - getDetails(CUSTOM_QUERY_DETAILS).should('have.text', rule.query); - getDetails(RULE_TYPE_DETAILS).should('have.text', 'Query'); - getDetails(TIMELINE_TEMPLATE_DETAILS).should('have.text', 'None'); - }); - cy.get(SCHEDULE_DETAILS).within(() => { - getDetails(RUNS_EVERY_DETAILS).should('have.text', `${rule.interval}`); - const humanizedDuration = getHumanizedDuration(rule.from ?? 'now-6m', rule.interval ?? '5m'); - getDetails(ADDITIONAL_LOOK_BACK_DETAILS).should('have.text', `${humanizedDuration}`); - }); - waitForTheRuleToBeExecuted(); - waitForAlertsToPopulate(); + waitForTheRuleToBeExecuted(); + waitForAlertsToPopulate(); - cy.get(ALERTS_COUNT) - .invoke('text') - .should('match', /^[1-9].+$/); // Any number of alerts - cy.get(ALERT_GRID_CELL).contains('auditbeat'); - cy.get(ALERT_GRID_CELL).contains('critical'); - cy.get(ALERT_GRID_CELL).contains('80'); - }); -}); + cy.get(ALERTS_COUNT) + .invoke('text') + .should('match', /^[1-9].+$/); // Any number of alerts + cy.get(ALERT_GRID_CELL).contains('auditbeat'); + cy.get(ALERT_GRID_CELL).contains('critical'); + cy.get(ALERT_GRID_CELL).contains('80'); + }); + } +); diff --git a/x-pack/test/security_solution_cypress/cypress/e2e/detection_response/rule_creation/threshold_rule.cy.ts b/x-pack/test/security_solution_cypress/cypress/e2e/detection_response/rule_creation/threshold_rule.cy.ts index 078be723c39ac..dfc9c265ffb82 100644 --- a/x-pack/test/security_solution_cypress/cypress/e2e/detection_response/rule_creation/threshold_rule.cy.ts +++ b/x-pack/test/security_solution_cypress/cypress/e2e/detection_response/rule_creation/threshold_rule.cy.ts @@ -58,78 +58,86 @@ import { login, visitWithoutDateRange } from '../../../tasks/login'; import { RULE_CREATION } from '../../../urls/navigation'; -describe('Detection rules, threshold', { tags: ['@ess', '@brokenInServerless'] }, () => { - const rule = getNewThresholdRule(); - const expectedUrls = rule.references?.join(''); - const expectedFalsePositives = rule.false_positives?.join(''); - const expectedTags = rule.tags?.join(''); - const mitreAttack = rule.threat; - const expectedMitre = formatMitreAttackDescription(mitreAttack ?? []); - - before(() => { - cleanKibana(); - }); - - beforeEach(() => { - deleteAlertsAndRules(); - login(); - visitWithoutDateRange(RULE_CREATION); - }); - - it('Creates and enables a new threshold rule', () => { - selectThresholdRuleType(); - fillDefineThresholdRuleAndContinue(rule); - fillAboutRuleAndContinue(rule); - fillScheduleRuleAndContinue(rule); - createAndEnableRule(); - - cy.get(CUSTOM_RULES_BTN).should('have.text', 'Custom rules (1)'); - - expectNumberOfRules(RULES_MANAGEMENT_TABLE, 1); - - cy.get(RULE_NAME).should('have.text', rule.name); - cy.get(RISK_SCORE).should('have.text', rule.risk_score); - cy.get(SEVERITY).should('have.text', 'High'); - cy.get(RULE_SWITCH).should('have.attr', 'aria-checked', 'true'); - - goToRuleDetails(); - - cy.get(RULE_NAME_HEADER).should('contain', `${rule.name}`); - cy.get(ABOUT_RULE_DESCRIPTION).should('have.text', rule.description); - cy.get(ABOUT_DETAILS).within(() => { - getDetails(SEVERITY_DETAILS).should('have.text', 'High'); - getDetails(RISK_SCORE_DETAILS).should('have.text', rule.risk_score); - getDetails(REFERENCE_URLS_DETAILS).should((details) => { - expect(removeExternalLinkText(details.text())).equal(expectedUrls); - }); - getDetails(FALSE_POSITIVES_DETAILS).should('have.text', expectedFalsePositives); - getDetails(MITRE_ATTACK_DETAILS).should((mitre) => { - expect(removeExternalLinkText(mitre.text())).equal(expectedMitre); - }); - getDetails(TAGS_DETAILS).should('have.text', expectedTags); - }); - cy.get(INVESTIGATION_NOTES_TOGGLE).click(); - cy.get(ABOUT_INVESTIGATION_NOTES).should('have.text', INVESTIGATION_NOTES_MARKDOWN); - cy.get(DEFINITION_DETAILS).within(() => { - getDetails(INDEX_PATTERNS_DETAILS).should('have.text', getIndexPatterns().join('')); - getDetails(CUSTOM_QUERY_DETAILS).should('have.text', rule.query); - getDetails(RULE_TYPE_DETAILS).should('have.text', 'Threshold'); - getDetails(TIMELINE_TEMPLATE_DETAILS).should('have.text', 'None'); - getDetails(THRESHOLD_DETAILS).should( - 'have.text', - `Results aggregated by ${rule.threshold.field} >= ${rule.threshold.value}` - ); +// TODO: https://github.com/elastic/kibana/issues/161539 +describe( + 'Detection rules, threshold', + { tags: ['@ess', '@serverless', '@brokenInServerless'] }, + () => { + const rule = getNewThresholdRule(); + const expectedUrls = rule.references?.join(''); + const expectedFalsePositives = rule.false_positives?.join(''); + const expectedTags = rule.tags?.join(''); + const mitreAttack = rule.threat; + const expectedMitre = formatMitreAttackDescription(mitreAttack ?? []); + + before(() => { + cleanKibana(); }); - cy.get(SCHEDULE_DETAILS).within(() => { - getDetails(RUNS_EVERY_DETAILS).should('have.text', `${rule.interval}`); - const humanizedDuration = getHumanizedDuration(rule.from ?? 'now-6m', rule.interval ?? '5m'); - getDetails(ADDITIONAL_LOOK_BACK_DETAILS).should('have.text', `${humanizedDuration}`); + + beforeEach(() => { + deleteAlertsAndRules(); + login(); + visitWithoutDateRange(RULE_CREATION); }); - waitForTheRuleToBeExecuted(); - waitForAlertsToPopulate(); + it('Creates and enables a new threshold rule', () => { + selectThresholdRuleType(); + fillDefineThresholdRuleAndContinue(rule); + fillAboutRuleAndContinue(rule); + fillScheduleRuleAndContinue(rule); + createAndEnableRule(); + + cy.get(CUSTOM_RULES_BTN).should('have.text', 'Custom rules (1)'); + + expectNumberOfRules(RULES_MANAGEMENT_TABLE, 1); + + cy.get(RULE_NAME).should('have.text', rule.name); + cy.get(RISK_SCORE).should('have.text', rule.risk_score); + cy.get(SEVERITY).should('have.text', 'High'); + cy.get(RULE_SWITCH).should('have.attr', 'aria-checked', 'true'); + + goToRuleDetails(); + + cy.get(RULE_NAME_HEADER).should('contain', `${rule.name}`); + cy.get(ABOUT_RULE_DESCRIPTION).should('have.text', rule.description); + cy.get(ABOUT_DETAILS).within(() => { + getDetails(SEVERITY_DETAILS).should('have.text', 'High'); + getDetails(RISK_SCORE_DETAILS).should('have.text', rule.risk_score); + getDetails(REFERENCE_URLS_DETAILS).should((details) => { + expect(removeExternalLinkText(details.text())).equal(expectedUrls); + }); + getDetails(FALSE_POSITIVES_DETAILS).should('have.text', expectedFalsePositives); + getDetails(MITRE_ATTACK_DETAILS).should((mitre) => { + expect(removeExternalLinkText(mitre.text())).equal(expectedMitre); + }); + getDetails(TAGS_DETAILS).should('have.text', expectedTags); + }); + cy.get(INVESTIGATION_NOTES_TOGGLE).click(); + cy.get(ABOUT_INVESTIGATION_NOTES).should('have.text', INVESTIGATION_NOTES_MARKDOWN); + cy.get(DEFINITION_DETAILS).within(() => { + getDetails(INDEX_PATTERNS_DETAILS).should('have.text', getIndexPatterns().join('')); + getDetails(CUSTOM_QUERY_DETAILS).should('have.text', rule.query); + getDetails(RULE_TYPE_DETAILS).should('have.text', 'Threshold'); + getDetails(TIMELINE_TEMPLATE_DETAILS).should('have.text', 'None'); + getDetails(THRESHOLD_DETAILS).should( + 'have.text', + `Results aggregated by ${rule.threshold.field} >= ${rule.threshold.value}` + ); + }); + cy.get(SCHEDULE_DETAILS).within(() => { + getDetails(RUNS_EVERY_DETAILS).should('have.text', `${rule.interval}`); + const humanizedDuration = getHumanizedDuration( + rule.from ?? 'now-6m', + rule.interval ?? '5m' + ); + getDetails(ADDITIONAL_LOOK_BACK_DETAILS).should('have.text', `${humanizedDuration}`); + }); - cy.get(ALERTS_COUNT).should(($count) => expect(+$count.text().split(' ')[0]).to.be.lt(100)); - cy.get(ALERT_GRID_CELL).contains(rule.name); - }); -}); + waitForTheRuleToBeExecuted(); + waitForAlertsToPopulate(); + + cy.get(ALERTS_COUNT).should(($count) => expect(+$count.text().split(' ')[0]).to.be.lt(100)); + cy.get(ALERT_GRID_CELL).contains(rule.name); + }); + } +); diff --git a/x-pack/test/security_solution_cypress/cypress/e2e/detection_response/rule_management/authorization/all_rules_read_only.cy.ts b/x-pack/test/security_solution_cypress/cypress/e2e/detection_response/rule_management/authorization/all_rules_read_only.cy.ts index dfb598bfa369b..28fce3db9d55b 100644 --- a/x-pack/test/security_solution_cypress/cypress/e2e/detection_response/rule_management/authorization/all_rules_read_only.cy.ts +++ b/x-pack/test/security_solution_cypress/cypress/e2e/detection_response/rule_management/authorization/all_rules_read_only.cy.ts @@ -24,7 +24,9 @@ import { } from '../../../../tasks/common/callouts'; import { login, visitSecurityDetectionRulesPage } from '../../../../tasks/login'; -describe('All rules - read only', { tags: '@ess' }, () => { +// TODO: https://github.com/elastic/kibana/issues/164451 We should find a way to make this spec work in Serverless +// TODO: https://github.com/elastic/kibana/issues/161540 +describe('All rules - read only', { tags: ['@ess', '@serverless', '@skipInServerless'] }, () => { before(() => { cleanKibana(); createRule(getNewRule({ rule_id: '1', enabled: false })); diff --git a/x-pack/test/security_solution_cypress/cypress/e2e/detection_response/rule_management/maintenance_windows/maintenance_window_callout.cy.ts b/x-pack/test/security_solution_cypress/cypress/e2e/detection_response/rule_management/maintenance_windows/maintenance_window_callout.cy.ts index 605ce523eb35b..1ba764c09000d 100644 --- a/x-pack/test/security_solution_cypress/cypress/e2e/detection_response/rule_management/maintenance_windows/maintenance_window_callout.cy.ts +++ b/x-pack/test/security_solution_cypress/cypress/e2e/detection_response/rule_management/maintenance_windows/maintenance_window_callout.cy.ts @@ -12,47 +12,52 @@ import { cleanKibana } from '../../../../tasks/common'; import { login, visit } from '../../../../tasks/login'; import { DETECTIONS_RULE_MANAGEMENT_URL } from '../../../../urls/navigation'; -describe('Maintenance window callout on Rule Management page', { tags: ['@ess'] }, () => { - let maintenanceWindowId = ''; - - before(() => { - cleanKibana(); - login(); - - const body: AsApiContract = { - title: 'My maintenance window', - duration: 60000, // 1 minute - r_rule: { - dtstart: new Date().toISOString(), - tzid: 'Europe/Amsterdam', - freq: 0, - count: 1, - }, - }; - - // Create a test maintenance window - cy.request({ - method: 'POST', - url: INTERNAL_ALERTING_API_MAINTENANCE_WINDOW_PATH, - headers: { 'kbn-xsrf': 'cypress-creds', 'x-elastic-internal-origin': 'security-solution' }, - body, - }).then((response) => { - maintenanceWindowId = response.body.id; +// TODO: https://github.com/elastic/kibana/issues/161540 +describe( + 'Maintenance window callout on Rule Management page', + { tags: ['@ess', '@serverless', '@skipInServerless'] }, + () => { + let maintenanceWindowId = ''; + + before(() => { + cleanKibana(); + login(); + + const body: AsApiContract = { + title: 'My maintenance window', + duration: 60000, // 1 minute + r_rule: { + dtstart: new Date().toISOString(), + tzid: 'Europe/Amsterdam', + freq: 0, + count: 1, + }, + }; + + // Create a test maintenance window + cy.request({ + method: 'POST', + url: INTERNAL_ALERTING_API_MAINTENANCE_WINDOW_PATH, + headers: { 'kbn-xsrf': 'cypress-creds', 'x-elastic-internal-origin': 'security-solution' }, + body, + }).then((response) => { + maintenanceWindowId = response.body.id; + }); }); - }); - - after(() => { - // Delete a test maintenance window - cy.request({ - method: 'DELETE', - url: `${INTERNAL_ALERTING_API_MAINTENANCE_WINDOW_PATH}/${maintenanceWindowId}`, - headers: { 'kbn-xsrf': 'cypress-creds', 'x-elastic-internal-origin': 'security-solution' }, + + after(() => { + // Delete a test maintenance window + cy.request({ + method: 'DELETE', + url: `${INTERNAL_ALERTING_API_MAINTENANCE_WINDOW_PATH}/${maintenanceWindowId}`, + headers: { 'kbn-xsrf': 'cypress-creds', 'x-elastic-internal-origin': 'security-solution' }, + }); }); - }); - it('Displays the callout when there are running maintenance windows', () => { - visit(DETECTIONS_RULE_MANAGEMENT_URL); + it('Displays the callout when there are running maintenance windows', () => { + visit(DETECTIONS_RULE_MANAGEMENT_URL); - cy.contains('Maintenance window is running'); - }); -}); + cy.contains('Maintenance window is running'); + }); + } +); diff --git a/x-pack/test/security_solution_cypress/cypress/e2e/detection_response/rule_management/related_integrations/related_integrations.cy.ts b/x-pack/test/security_solution_cypress/cypress/e2e/detection_response/rule_management/related_integrations/related_integrations.cy.ts index f5aaef1b4e841..b115d93dfd7e8 100644 --- a/x-pack/test/security_solution_cypress/cypress/e2e/detection_response/rule_management/related_integrations/related_integrations.cy.ts +++ b/x-pack/test/security_solution_cypress/cypress/e2e/detection_response/rule_management/related_integrations/related_integrations.cy.ts @@ -47,7 +47,8 @@ import { import { ruleDetailsUrl } from '../../../../urls/navigation'; import { enablesRule, waitForPageToBeLoaded } from '../../../../tasks/rule_details'; -describe('Related integrations', { tags: ['@ess', '@brokenInServerless'] }, () => { +// TODO: https://github.com/elastic/kibana/issues/161540 +describe('Related integrations', { tags: ['@ess', '@serverless', '@brokenInServerless'] }, () => { const DATA_STREAM_NAME = 'logs-related-integrations-test'; const PREBUILT_RULE_NAME = 'Prebuilt rule with related integrations'; const RULE_RELATED_INTEGRATIONS: IntegrationDefinition[] = [ @@ -189,6 +190,7 @@ describe('Related integrations', { tags: ['@ess', '@brokenInServerless'] }, () = }); }); + // TODO: https://github.com/elastic/kibana/issues/161540 // Flaky in serverless tests // @brokenInServerless tag is not working so a skip was needed describe.skip('rule details', { tags: ['@brokenInServerless'] }, () => { diff --git a/x-pack/test/security_solution_cypress/cypress/e2e/detection_response/rule_management/rule_actions/bulk_actions/bulk_duplicate_rules.cy.ts b/x-pack/test/security_solution_cypress/cypress/e2e/detection_response/rule_management/rule_actions/bulk_actions/bulk_duplicate_rules.cy.ts index b95741083a065..aa43b7615d0a5 100644 --- a/x-pack/test/security_solution_cypress/cypress/e2e/detection_response/rule_management/rule_actions/bulk_actions/bulk_duplicate_rules.cy.ts +++ b/x-pack/test/security_solution_cypress/cypress/e2e/detection_response/rule_management/rule_actions/bulk_actions/bulk_duplicate_rules.cy.ts @@ -52,10 +52,11 @@ const EXPIRED_EXCEPTION_ITEM_NAME = 'Sample exception item'; const NON_EXPIRED_EXCEPTION_ITEM_NAME = 'Sample exception item with future expiration'; +// TODO: https://github.com/elastic/kibana/issues/161540 // Flaky on serverless describe( 'Detection rules, bulk duplicate', - { tags: ['@ess', '@serverless', '@brokenInServerless'] }, + { tags: ['@ess', '@serverless', '@skipInServerless'] }, () => { before(() => { cleanKibana(); diff --git a/x-pack/test/security_solution_cypress/cypress/e2e/detection_response/rule_management/rule_actions/bulk_actions/bulk_edit_rules.cy.ts b/x-pack/test/security_solution_cypress/cypress/e2e/detection_response/rule_management/rule_actions/bulk_actions/bulk_edit_rules.cy.ts index 4b86a8344836c..6ff4f2fc44a7e 100644 --- a/x-pack/test/security_solution_cypress/cypress/e2e/detection_response/rule_management/rule_actions/bulk_actions/bulk_edit_rules.cy.ts +++ b/x-pack/test/security_solution_cypress/cypress/e2e/detection_response/rule_management/rule_actions/bulk_actions/bulk_edit_rules.cy.ts @@ -114,550 +114,560 @@ const defaultRuleData = { timeline_id: '495ad7a7-316e-4544-8a0f-9c098daee76e', }; -describe('Detection rules, bulk edit', { tags: ['@ess', '@brokenInServerless'] }, () => { - before(() => { - cleanKibana(); - }); - beforeEach(() => { - login(); - // Make sure persisted rules table state is cleared - resetRulesTableState(); - deleteAlertsAndRules(); - preventPrebuiltRulesPackageInstallation(); // Make sure prebuilt rules aren't pulled from Fleet API - cy.task('esArchiverResetKibana'); - createRule(getNewRule({ name: RULE_NAME, ...defaultRuleData, rule_id: '1', enabled: false })); - createRule( - getEqlRule({ ...defaultRuleData, rule_id: '2', name: 'New EQL Rule', enabled: false }) - ); - createRule( - getMachineLearningRule({ - name: 'New ML Rule Test', - tags: ['test-default-tag-1', 'test-default-tag-2'], - enabled: false, - }) - ); - createRule( - getNewThreatIndicatorRule({ - ...defaultRuleData, - rule_id: '4', - name: 'Threat Indicator Rule Test', - enabled: false, - }) - ); - createRule( - getNewThresholdRule({ - ...defaultRuleData, - rule_id: '5', - name: 'Threshold Rule', - enabled: false, - }) - ); - createRule( - getNewTermsRule({ ...defaultRuleData, rule_id: '6', name: 'New Terms Rule', enabled: false }) - ); - - visitSecurityDetectionRulesPage(); - disableAutoRefresh(); - }); - - describe('Prerequisites', () => { - const PREBUILT_RULES = [ - createRuleAssetSavedObject({ - name: 'Prebuilt rule 1', - rule_id: 'rule_1', - }), - createRuleAssetSavedObject({ - name: 'Prebuilt rule 2', - rule_id: 'rule_2', - }), - ]; - - it('No rules selected', () => { - openBulkActionsMenu(); - - // when no rule selected all bulk edit options should be disabled - cy.get(TAGS_RULE_BULK_MENU_ITEM).should('be.disabled'); - cy.get(INDEX_PATTERNS_RULE_BULK_MENU_ITEM).should('be.disabled'); - cy.get(APPLY_TIMELINE_RULE_BULK_MENU_ITEM).should('be.disabled'); +// TODO: https://github.com/elastic/kibana/issues/161540 +describe( + 'Detection rules, bulk edit', + { tags: ['@ess', '@serverless', '@brokenInServerless'] }, + () => { + before(() => { + cleanKibana(); }); + beforeEach(() => { + login(); + // Make sure persisted rules table state is cleared + resetRulesTableState(); + deleteAlertsAndRules(); + preventPrebuiltRulesPackageInstallation(); // Make sure prebuilt rules aren't pulled from Fleet API + cy.task('esArchiverResetKibana'); + createRule(getNewRule({ name: RULE_NAME, ...defaultRuleData, rule_id: '1', enabled: false })); + createRule( + getEqlRule({ ...defaultRuleData, rule_id: '2', name: 'New EQL Rule', enabled: false }) + ); + createRule( + getMachineLearningRule({ + name: 'New ML Rule Test', + tags: ['test-default-tag-1', 'test-default-tag-2'], + enabled: false, + }) + ); + createRule( + getNewThreatIndicatorRule({ + ...defaultRuleData, + rule_id: '4', + name: 'Threat Indicator Rule Test', + enabled: false, + }) + ); + createRule( + getNewThresholdRule({ + ...defaultRuleData, + rule_id: '5', + name: 'Threshold Rule', + enabled: false, + }) + ); + createRule( + getNewTermsRule({ + ...defaultRuleData, + rule_id: '6', + name: 'New Terms Rule', + enabled: false, + }) + ); - it('Only prebuilt rules selected', () => { - createAndInstallMockedPrebuiltRules({ rules: PREBUILT_RULES }); - - // select Elastic(prebuilt) rules, check if we can't proceed further, as Elastic rules are not editable - filterByElasticRules(); - selectAllRulesOnPage(); - clickApplyTimelineTemplatesMenuItem(); - - getRulesManagementTableRows().then((rows) => { - // check modal window for Elastic rule that can't be edited - checkPrebuiltRulesCannotBeModified(rows.length); + visitSecurityDetectionRulesPage(); + disableAutoRefresh(); + }); - // the confirm button closes modal - cy.get(MODAL_CONFIRMATION_BTN).should('have.text', 'Close').click(); - cy.get(MODAL_CONFIRMATION_BODY).should('not.exist'); + describe('Prerequisites', () => { + const PREBUILT_RULES = [ + createRuleAssetSavedObject({ + name: 'Prebuilt rule 1', + rule_id: 'rule_1', + }), + createRuleAssetSavedObject({ + name: 'Prebuilt rule 2', + rule_id: 'rule_2', + }), + ]; + + it('No rules selected', () => { + openBulkActionsMenu(); + + // when no rule selected all bulk edit options should be disabled + cy.get(TAGS_RULE_BULK_MENU_ITEM).should('be.disabled'); + cy.get(INDEX_PATTERNS_RULE_BULK_MENU_ITEM).should('be.disabled'); + cy.get(APPLY_TIMELINE_RULE_BULK_MENU_ITEM).should('be.disabled'); }); - }); - it('Prebuilt and custom rules selected: user proceeds with custom rules editing', () => { - getRulesManagementTableRows().then((existedRulesRows) => { + it('Only prebuilt rules selected', () => { createAndInstallMockedPrebuiltRules({ rules: PREBUILT_RULES }); - // modal window should show how many rules can be edit, how many not - selectAllRules(); - clickAddTagsMenuItem(); + // select Elastic(prebuilt) rules, check if we can't proceed further, as Elastic rules are not editable + filterByElasticRules(); + selectAllRulesOnPage(); + clickApplyTimelineTemplatesMenuItem(); - waitForMixedRulesBulkEditModal(existedRulesRows.length); + getRulesManagementTableRows().then((rows) => { + // check modal window for Elastic rule that can't be edited + checkPrebuiltRulesCannotBeModified(rows.length); - getAvailablePrebuiltRulesCount().then((availablePrebuiltRulesCount) => { - checkPrebuiltRulesCannotBeModified(availablePrebuiltRulesCount); + // the confirm button closes modal + cy.get(MODAL_CONFIRMATION_BTN).should('have.text', 'Close').click(); + cy.get(MODAL_CONFIRMATION_BODY).should('not.exist'); }); + }); - // user can proceed with custom rule editing - cy.get(MODAL_CONFIRMATION_BTN) - .should('have.text', `Edit ${existedRulesRows.length} custom rules`) - .click(); + it('Prebuilt and custom rules selected: user proceeds with custom rules editing', () => { + getRulesManagementTableRows().then((existedRulesRows) => { + createAndInstallMockedPrebuiltRules({ rules: PREBUILT_RULES }); - // action should finish - typeTags(['test-tag']); - submitBulkEditForm(); - waitForBulkEditActionToFinish({ updatedCount: existedRulesRows.length }); - }); - }); + // modal window should show how many rules can be edit, how many not + selectAllRules(); + clickAddTagsMenuItem(); - it('Prebuilt and custom rules selected: user cancels action', () => { - createAndInstallMockedPrebuiltRules({ rules: PREBUILT_RULES }); + waitForMixedRulesBulkEditModal(existedRulesRows.length); - getRulesManagementTableRows().then((rows) => { - // modal window should show how many rules can be edit, how many not - selectAllRules(); - clickAddTagsMenuItem(); - waitForMixedRulesBulkEditModal(rows.length); + getAvailablePrebuiltRulesCount().then((availablePrebuiltRulesCount) => { + checkPrebuiltRulesCannotBeModified(availablePrebuiltRulesCount); + }); - checkPrebuiltRulesCannotBeModified(PREBUILT_RULES.length); + // user can proceed with custom rule editing + cy.get(MODAL_CONFIRMATION_BTN) + .should('have.text', `Edit ${existedRulesRows.length} custom rules`) + .click(); - // user cancels action and modal disappears - cancelConfirmationModal(); + // action should finish + typeTags(['test-tag']); + submitBulkEditForm(); + waitForBulkEditActionToFinish({ updatedCount: existedRulesRows.length }); + }); }); - }); - it('should not lose rules selection after edit action', () => { - const rulesToUpdate = [RULE_NAME, 'New EQL Rule', 'New Terms Rule'] as const; - // Switch to 5 rules per page, to have few pages in pagination(ideal way to test auto refresh and selection of few items) - setRowsPerPageTo(5); - // and make the rules order isn't changing (set sorting by rule name) over time if rules are run - sortByTableColumn('Rule'); - selectRulesByName(rulesToUpdate); - - // open add tags form and add 2 new tags - openBulkEditAddTagsForm(); - typeTags(['new-tag-1']); - submitBulkEditForm(); - waitForBulkEditActionToFinish({ updatedCount: rulesToUpdate.length }); - - testMultipleSelectedRulesLabel(rulesToUpdate.length); - // check if first four(rulesCount) rules still selected and tags are updated - for (const ruleName of rulesToUpdate) { - getRuleRow(ruleName).find(EUI_CHECKBOX).should('be.checked'); - getRuleRow(ruleName) - .find(RULES_TAGS_POPOVER_BTN) - .each(($el) => { - testTagsBadge($el, prePopulatedTags.concat(['new-tag-1'])); - }); - } - }); - }); + it('Prebuilt and custom rules selected: user cancels action', () => { + createAndInstallMockedPrebuiltRules({ rules: PREBUILT_RULES }); - describe('Tags actions', () => { - it('Display list of tags in tags select', () => { - selectAllRules(); + getRulesManagementTableRows().then((rows) => { + // modal window should show how many rules can be edit, how many not + selectAllRules(); + clickAddTagsMenuItem(); + waitForMixedRulesBulkEditModal(rows.length); - openBulkEditAddTagsForm(); - openTagsSelect(); + checkPrebuiltRulesCannotBeModified(PREBUILT_RULES.length); - cy.get(EUI_FILTER_SELECT_ITEM) - .should('have.length', prePopulatedTags.length) - .each(($el, index) => { - cy.wrap($el).should('have.text', prePopulatedTags[index]); + // user cancels action and modal disappears + cancelConfirmationModal(); }); - }); + }); - it('Add tags to custom rules', () => { - getRulesManagementTableRows().then((rows) => { - const tagsToBeAdded = ['tag-to-add-1', 'tag-to-add-2']; - const resultingTags = [...prePopulatedTags, ...tagsToBeAdded]; + it('should not lose rules selection after edit action', () => { + const rulesToUpdate = [RULE_NAME, 'New EQL Rule', 'New Terms Rule'] as const; + // Switch to 5 rules per page, to have few pages in pagination(ideal way to test auto refresh and selection of few items) + setRowsPerPageTo(5); + // and make the rules order isn't changing (set sorting by rule name) over time if rules are run + sortByTableColumn('Rule'); + selectRulesByName(rulesToUpdate); - // check if only pre-populated tags exist in the tags filter - checkTagsInTagsFilter(prePopulatedTags, EUI_SELECTABLE_LIST_ITEM_SR_TEXT); + // open add tags form and add 2 new tags + openBulkEditAddTagsForm(); + typeTags(['new-tag-1']); + submitBulkEditForm(); + waitForBulkEditActionToFinish({ updatedCount: rulesToUpdate.length }); + + testMultipleSelectedRulesLabel(rulesToUpdate.length); + // check if first four(rulesCount) rules still selected and tags are updated + for (const ruleName of rulesToUpdate) { + getRuleRow(ruleName).find(EUI_CHECKBOX).should('be.checked'); + getRuleRow(ruleName) + .find(RULES_TAGS_POPOVER_BTN) + .each(($el) => { + testTagsBadge($el, prePopulatedTags.concat(['new-tag-1'])); + }); + } + }); + }); + describe('Tags actions', () => { + it('Display list of tags in tags select', () => { selectAllRules(); - // open add tags form and add 2 new tags openBulkEditAddTagsForm(); - typeTags(tagsToBeAdded); - submitBulkEditForm(); - waitForBulkEditActionToFinish({ updatedCount: rows.length }); + openTagsSelect(); + + cy.get(EUI_FILTER_SELECT_ITEM) + .should('have.length', prePopulatedTags.length) + .each(($el, index) => { + cy.wrap($el).should('have.text', prePopulatedTags[index]); + }); + }); - // check if all rules have been updated with new tags - testAllTagsBadges(resultingTags); + it('Add tags to custom rules', () => { + getRulesManagementTableRows().then((rows) => { + const tagsToBeAdded = ['tag-to-add-1', 'tag-to-add-2']; + const resultingTags = [...prePopulatedTags, ...tagsToBeAdded]; - // check that new tags were added to tags filter - // tags in tags filter sorted alphabetically - const resultingTagsInFilter = [...resultingTags].sort(); - checkTagsInTagsFilter(resultingTagsInFilter, EUI_SELECTABLE_LIST_ITEM_SR_TEXT); + // check if only pre-populated tags exist in the tags filter + checkTagsInTagsFilter(prePopulatedTags, EUI_SELECTABLE_LIST_ITEM_SR_TEXT); + + selectAllRules(); + + // open add tags form and add 2 new tags + openBulkEditAddTagsForm(); + typeTags(tagsToBeAdded); + submitBulkEditForm(); + waitForBulkEditActionToFinish({ updatedCount: rows.length }); + + // check if all rules have been updated with new tags + testAllTagsBadges(resultingTags); + + // check that new tags were added to tags filter + // tags in tags filter sorted alphabetically + const resultingTagsInFilter = [...resultingTags].sort(); + checkTagsInTagsFilter(resultingTagsInFilter, EUI_SELECTABLE_LIST_ITEM_SR_TEXT); + }); }); - }); - it('Display success toast after adding tags', () => { - getRulesManagementTableRows().then((rows) => { - const tagsToBeAdded = ['tag-to-add-1', 'tag-to-add-2']; + it('Display success toast after adding tags', () => { + getRulesManagementTableRows().then((rows) => { + const tagsToBeAdded = ['tag-to-add-1', 'tag-to-add-2']; - // check if only pre-populated tags exist in the tags filter - checkTagsInTagsFilter(prePopulatedTags, EUI_SELECTABLE_LIST_ITEM_SR_TEXT); + // check if only pre-populated tags exist in the tags filter + checkTagsInTagsFilter(prePopulatedTags, EUI_SELECTABLE_LIST_ITEM_SR_TEXT); - selectAllRules(); + selectAllRules(); - // open add tags form and add 2 new tags - openBulkEditAddTagsForm(); - typeTags(tagsToBeAdded); - submitBulkEditForm(); - waitForBulkEditActionToFinish({ updatedCount: rows.length }); + // open add tags form and add 2 new tags + openBulkEditAddTagsForm(); + typeTags(tagsToBeAdded); + submitBulkEditForm(); + waitForBulkEditActionToFinish({ updatedCount: rows.length }); + }); }); - }); - it('Overwrite tags in custom rules', () => { - getRulesManagementTableRows().then((rows) => { - const tagsToOverwrite = ['overwrite-tag-1']; + it('Overwrite tags in custom rules', () => { + getRulesManagementTableRows().then((rows) => { + const tagsToOverwrite = ['overwrite-tag-1']; - // check if only pre-populated tags exist in the tags filter - checkTagsInTagsFilter(prePopulatedTags, EUI_SELECTABLE_LIST_ITEM_SR_TEXT); + // check if only pre-populated tags exist in the tags filter + checkTagsInTagsFilter(prePopulatedTags, EUI_SELECTABLE_LIST_ITEM_SR_TEXT); - selectAllRules(); + selectAllRules(); - // open add tags form, check overwrite tags and warning message, type tags - openBulkEditAddTagsForm(); - checkOverwriteTagsCheckbox(); + // open add tags form, check overwrite tags and warning message, type tags + openBulkEditAddTagsForm(); + checkOverwriteTagsCheckbox(); - cy.get(RULES_BULK_EDIT_TAGS_WARNING).should( - 'have.text', - `You’re about to overwrite tags for ${rows.length} selected rules, press Save to apply changes.` - ); + cy.get(RULES_BULK_EDIT_TAGS_WARNING).should( + 'have.text', + `You’re about to overwrite tags for ${rows.length} selected rules, press Save to apply changes.` + ); - typeTags(tagsToOverwrite); - submitBulkEditForm(); - waitForBulkEditActionToFinish({ updatedCount: rows.length }); + typeTags(tagsToOverwrite); + submitBulkEditForm(); + waitForBulkEditActionToFinish({ updatedCount: rows.length }); - // check if all rules have been updated with new tags - testAllTagsBadges(tagsToOverwrite); + // check if all rules have been updated with new tags + testAllTagsBadges(tagsToOverwrite); - // check that only new tags are in the tag filter - checkTagsInTagsFilter(tagsToOverwrite, EUI_SELECTABLE_LIST_ITEM_SR_TEXT); + // check that only new tags are in the tag filter + checkTagsInTagsFilter(tagsToOverwrite, EUI_SELECTABLE_LIST_ITEM_SR_TEXT); + }); }); - }); - it('Delete tags from custom rules', () => { - getRulesManagementTableRows().then((rows) => { - const tagsToDelete = prePopulatedTags.slice(0, 1); - const resultingTags = prePopulatedTags.slice(1); + it('Delete tags from custom rules', () => { + getRulesManagementTableRows().then((rows) => { + const tagsToDelete = prePopulatedTags.slice(0, 1); + const resultingTags = prePopulatedTags.slice(1); - // check if only pre-populated tags exist in the tags filter - checkTagsInTagsFilter(prePopulatedTags, EUI_SELECTABLE_LIST_ITEM_SR_TEXT); + // check if only pre-populated tags exist in the tags filter + checkTagsInTagsFilter(prePopulatedTags, EUI_SELECTABLE_LIST_ITEM_SR_TEXT); - selectAllRules(); + selectAllRules(); - // open add tags form, check overwrite tags, type tags - openBulkEditDeleteTagsForm(); - typeTags(tagsToDelete); - submitBulkEditForm(); - waitForBulkEditActionToFinish({ updatedCount: rows.length }); + // open add tags form, check overwrite tags, type tags + openBulkEditDeleteTagsForm(); + typeTags(tagsToDelete); + submitBulkEditForm(); + waitForBulkEditActionToFinish({ updatedCount: rows.length }); - // check tags has been removed from all rules - testAllTagsBadges(resultingTags); + // check tags has been removed from all rules + testAllTagsBadges(resultingTags); - // check that tags were removed from the tag filter - checkTagsInTagsFilter(resultingTags, EUI_SELECTABLE_LIST_ITEM_SR_TEXT); + // check that tags were removed from the tag filter + checkTagsInTagsFilter(resultingTags, EUI_SELECTABLE_LIST_ITEM_SR_TEXT); + }); }); }); - }); - describe('Index patterns', () => { - it('Index pattern action applied to custom rules, including machine learning: user proceeds with edit of custom non machine learning rule', () => { - getRulesManagementTableRows().then((rows) => { - const indexPattersToBeAdded = ['index-to-add-1-*', 'index-to-add-2-*']; - const resultingIndexPatterns = [...prePopulatedIndexPatterns, ...indexPattersToBeAdded]; + describe('Index patterns', () => { + it('Index pattern action applied to custom rules, including machine learning: user proceeds with edit of custom non machine learning rule', () => { + getRulesManagementTableRows().then((rows) => { + const indexPattersToBeAdded = ['index-to-add-1-*', 'index-to-add-2-*']; + const resultingIndexPatterns = [...prePopulatedIndexPatterns, ...indexPattersToBeAdded]; + + selectAllRules(); + clickAddIndexPatternsMenuItem(); + + // confirm editing custom rules, that are not Machine Learning + checkMachineLearningRulesCannotBeModified(expectedNumberOfMachineLearningRulesToBeEdited); + cy.get(MODAL_CONFIRMATION_BTN).click(); + + typeIndexPatterns(indexPattersToBeAdded); + submitBulkEditForm(); + + waitForBulkEditActionToFinish({ + updatedCount: rows.length - expectedNumberOfMachineLearningRulesToBeEdited, + }); + + // check if rule has been updated + goToTheRuleDetailsOf(RULE_NAME); + hasIndexPatterns(resultingIndexPatterns.join('')); + }); + }); + it('Index pattern action applied to custom rules, including machine learning: user cancels action', () => { selectAllRules(); clickAddIndexPatternsMenuItem(); // confirm editing custom rules, that are not Machine Learning checkMachineLearningRulesCannotBeModified(expectedNumberOfMachineLearningRulesToBeEdited); - cy.get(MODAL_CONFIRMATION_BTN).click(); - typeIndexPatterns(indexPattersToBeAdded); - submitBulkEditForm(); - - waitForBulkEditActionToFinish({ - updatedCount: rows.length - expectedNumberOfMachineLearningRulesToBeEdited, - }); - - // check if rule has been updated - goToTheRuleDetailsOf(RULE_NAME); - hasIndexPatterns(resultingIndexPatterns.join('')); + // user cancels action and modal disappears + cancelConfirmationModal(); }); - }); - it('Index pattern action applied to custom rules, including machine learning: user cancels action', () => { - selectAllRules(); - clickAddIndexPatternsMenuItem(); - - // confirm editing custom rules, that are not Machine Learning - checkMachineLearningRulesCannotBeModified(expectedNumberOfMachineLearningRulesToBeEdited); + it('Add index patterns to custom rules', () => { + getRulesManagementTableRows().then((rows) => { + const indexPattersToBeAdded = ['index-to-add-1-*', 'index-to-add-2-*']; + const resultingIndexPatterns = [...prePopulatedIndexPatterns, ...indexPattersToBeAdded]; + + // select only rules that are not ML + selectRulesByName([ + RULE_NAME, + 'New EQL Rule', + 'Threat Indicator Rule Test', + 'Threshold Rule', + 'New Terms Rule', + ]); + + openBulkEditAddIndexPatternsForm(); + typeIndexPatterns(indexPattersToBeAdded); + submitBulkEditForm(); + + waitForBulkEditActionToFinish({ + updatedCount: rows.length - expectedNumberOfMachineLearningRulesToBeEdited, + }); - // user cancels action and modal disappears - cancelConfirmationModal(); - }); + // check if rule has been updated + goToTheRuleDetailsOf(RULE_NAME); + hasIndexPatterns(resultingIndexPatterns.join('')); + }); + }); - it('Add index patterns to custom rules', () => { - getRulesManagementTableRows().then((rows) => { - const indexPattersToBeAdded = ['index-to-add-1-*', 'index-to-add-2-*']; - const resultingIndexPatterns = [...prePopulatedIndexPatterns, ...indexPattersToBeAdded]; + it('Display success toast after editing the index pattern', () => { + getRulesManagementTableRows().then((rows) => { + const indexPattersToBeAdded = ['index-to-add-1-*', 'index-to-add-2-*']; + + // select only rules that are not ML + selectRulesByName([ + RULE_NAME, + 'New EQL Rule', + 'Threat Indicator Rule Test', + 'Threshold Rule', + 'New Terms Rule', + ]); + + openBulkEditAddIndexPatternsForm(); + typeIndexPatterns(indexPattersToBeAdded); + submitBulkEditForm(); + + waitForBulkEditActionToFinish({ + updatedCount: rows.length - expectedNumberOfMachineLearningRulesToBeEdited, + }); + }); + }); - // select only rules that are not ML - selectRulesByName([ + it('Overwrite index patterns in custom rules', () => { + const rulesToSelect = [ RULE_NAME, 'New EQL Rule', 'Threat Indicator Rule Test', 'Threshold Rule', 'New Terms Rule', - ]); + ] as const; + const indexPattersToWrite = ['index-to-write-1-*', 'index-to-write-2-*']; + + // select only rules that are not ML + selectRulesByName(rulesToSelect); openBulkEditAddIndexPatternsForm(); - typeIndexPatterns(indexPattersToBeAdded); + + // check overwrite index patterns checkbox, ensure warning message is displayed and type index patterns + checkOverwriteIndexPatternsCheckbox(); + cy.get(RULES_BULK_EDIT_INDEX_PATTERNS_WARNING).should( + 'have.text', + `You’re about to overwrite index patterns for ${rulesToSelect.length} selected rules, press Save to apply changes.` + ); + + typeIndexPatterns(indexPattersToWrite); submitBulkEditForm(); - waitForBulkEditActionToFinish({ - updatedCount: rows.length - expectedNumberOfMachineLearningRulesToBeEdited, - }); + waitForBulkEditActionToFinish({ updatedCount: rulesToSelect.length }); // check if rule has been updated goToTheRuleDetailsOf(RULE_NAME); - hasIndexPatterns(resultingIndexPatterns.join('')); + hasIndexPatterns(indexPattersToWrite.join('')); }); - }); - - it('Display success toast after editing the index pattern', () => { - getRulesManagementTableRows().then((rows) => { - const indexPattersToBeAdded = ['index-to-add-1-*', 'index-to-add-2-*']; - // select only rules that are not ML - selectRulesByName([ + it('Delete index patterns from custom rules', () => { + const rulesToSelect = [ RULE_NAME, 'New EQL Rule', 'Threat Indicator Rule Test', 'Threshold Rule', 'New Terms Rule', - ]); - - openBulkEditAddIndexPatternsForm(); - typeIndexPatterns(indexPattersToBeAdded); - submitBulkEditForm(); - - waitForBulkEditActionToFinish({ - updatedCount: rows.length - expectedNumberOfMachineLearningRulesToBeEdited, - }); - }); - }); + ] as const; + const indexPatternsToDelete = prePopulatedIndexPatterns.slice(0, 1); + const resultingIndexPatterns = prePopulatedIndexPatterns.slice(1); - it('Overwrite index patterns in custom rules', () => { - const rulesToSelect = [ - RULE_NAME, - 'New EQL Rule', - 'Threat Indicator Rule Test', - 'Threshold Rule', - 'New Terms Rule', - ] as const; - const indexPattersToWrite = ['index-to-write-1-*', 'index-to-write-2-*']; - - // select only rules that are not ML - selectRulesByName(rulesToSelect); - - openBulkEditAddIndexPatternsForm(); - - // check overwrite index patterns checkbox, ensure warning message is displayed and type index patterns - checkOverwriteIndexPatternsCheckbox(); - cy.get(RULES_BULK_EDIT_INDEX_PATTERNS_WARNING).should( - 'have.text', - `You’re about to overwrite index patterns for ${rulesToSelect.length} selected rules, press Save to apply changes.` - ); + // select only not ML rules + selectRulesByName(rulesToSelect); - typeIndexPatterns(indexPattersToWrite); - submitBulkEditForm(); + openBulkEditDeleteIndexPatternsForm(); + typeIndexPatterns(indexPatternsToDelete); + submitBulkEditForm(); - waitForBulkEditActionToFinish({ updatedCount: rulesToSelect.length }); + waitForBulkEditActionToFinish({ updatedCount: rulesToSelect.length }); - // check if rule has been updated - goToTheRuleDetailsOf(RULE_NAME); - hasIndexPatterns(indexPattersToWrite.join('')); - }); - - it('Delete index patterns from custom rules', () => { - const rulesToSelect = [ - RULE_NAME, - 'New EQL Rule', - 'Threat Indicator Rule Test', - 'Threshold Rule', - 'New Terms Rule', - ] as const; - const indexPatternsToDelete = prePopulatedIndexPatterns.slice(0, 1); - const resultingIndexPatterns = prePopulatedIndexPatterns.slice(1); - - // select only not ML rules - selectRulesByName(rulesToSelect); - - openBulkEditDeleteIndexPatternsForm(); - typeIndexPatterns(indexPatternsToDelete); - submitBulkEditForm(); - - waitForBulkEditActionToFinish({ updatedCount: rulesToSelect.length }); - - // check if rule has been updated - goToTheRuleDetailsOf(RULE_NAME); - hasIndexPatterns(resultingIndexPatterns.join('')); - }); + // check if rule has been updated + goToTheRuleDetailsOf(RULE_NAME); + hasIndexPatterns(resultingIndexPatterns.join('')); + }); - it('Delete all index patterns from custom rules', () => { - const rulesToSelect = [ - RULE_NAME, - 'New EQL Rule', - 'Threat Indicator Rule Test', - 'Threshold Rule', - 'New Terms Rule', - ] as const; + it('Delete all index patterns from custom rules', () => { + const rulesToSelect = [ + RULE_NAME, + 'New EQL Rule', + 'Threat Indicator Rule Test', + 'Threshold Rule', + 'New Terms Rule', + ] as const; - // select only rules that are not ML - selectRulesByName(rulesToSelect); + // select only rules that are not ML + selectRulesByName(rulesToSelect); - openBulkEditDeleteIndexPatternsForm(); - typeIndexPatterns(prePopulatedIndexPatterns); - submitBulkEditForm(); + openBulkEditDeleteIndexPatternsForm(); + typeIndexPatterns(prePopulatedIndexPatterns); + submitBulkEditForm(); - // error toast should be displayed that that rules edit failed - waitForBulkEditActionToFinish({ failedCount: rulesToSelect.length }); + // error toast should be displayed that that rules edit failed + waitForBulkEditActionToFinish({ failedCount: rulesToSelect.length }); - // on error toast button click display error that index patterns can't be empty - clickErrorToastBtn(); - cy.contains(MODAL_ERROR_BODY, "Index patterns can't be empty"); + // on error toast button click display error that index patterns can't be empty + clickErrorToastBtn(); + cy.contains(MODAL_ERROR_BODY, "Index patterns can't be empty"); + }); }); - }); - describe('Timeline templates', () => { - beforeEach(() => { - loadPrepackagedTimelineTemplates(); - }); + describe('Timeline templates', () => { + beforeEach(() => { + loadPrepackagedTimelineTemplates(); + }); - it('Apply timeline template to custom rules', () => { - getRulesManagementTableRows().then((rows) => { - const timelineTemplateName = 'Generic Endpoint Timeline'; + it('Apply timeline template to custom rules', () => { + getRulesManagementTableRows().then((rows) => { + const timelineTemplateName = 'Generic Endpoint Timeline'; - selectAllRules(); + selectAllRules(); - // open Timeline template form, check warning, select timeline template - clickApplyTimelineTemplatesMenuItem(); - cy.get(RULES_BULK_EDIT_TIMELINE_TEMPLATES_WARNING).contains( - `You're about to apply changes to ${rows.length} selected rules. If you previously applied Timeline templates to these rules, they will be overwritten or (if you select 'None') reset to none.` - ); - selectTimelineTemplate(timelineTemplateName); + // open Timeline template form, check warning, select timeline template + clickApplyTimelineTemplatesMenuItem(); + cy.get(RULES_BULK_EDIT_TIMELINE_TEMPLATES_WARNING).contains( + `You're about to apply changes to ${rows.length} selected rules. If you previously applied Timeline templates to these rules, they will be overwritten or (if you select 'None') reset to none.` + ); + selectTimelineTemplate(timelineTemplateName); - submitBulkEditForm(); - waitForBulkEditActionToFinish({ updatedCount: rows.length }); + submitBulkEditForm(); + waitForBulkEditActionToFinish({ updatedCount: rows.length }); - // check if timeline template has been updated to selected one - goToTheRuleDetailsOf(RULE_NAME); - getDetails(TIMELINE_TEMPLATE_DETAILS).should('have.text', timelineTemplateName); + // check if timeline template has been updated to selected one + goToTheRuleDetailsOf(RULE_NAME); + getDetails(TIMELINE_TEMPLATE_DETAILS).should('have.text', timelineTemplateName); + }); }); - }); - it('Reset timeline template to None for custom rules', () => { - getRulesManagementTableRows().then((rows) => { - const noneTimelineTemplate = 'None'; + it('Reset timeline template to None for custom rules', () => { + getRulesManagementTableRows().then((rows) => { + const noneTimelineTemplate = 'None'; - selectAllRules(); + selectAllRules(); - // open Timeline template form, submit form without picking timeline template as None is selected by default - clickApplyTimelineTemplatesMenuItem(); + // open Timeline template form, submit form without picking timeline template as None is selected by default + clickApplyTimelineTemplatesMenuItem(); - submitBulkEditForm(); - waitForBulkEditActionToFinish({ updatedCount: rows.length }); + submitBulkEditForm(); + waitForBulkEditActionToFinish({ updatedCount: rows.length }); - // check if timeline template has been updated to selected one, by opening rule that have had timeline prior to editing - goToTheRuleDetailsOf(RULE_NAME); - getDetails(TIMELINE_TEMPLATE_DETAILS).should('have.text', noneTimelineTemplate); + // check if timeline template has been updated to selected one, by opening rule that have had timeline prior to editing + goToTheRuleDetailsOf(RULE_NAME); + getDetails(TIMELINE_TEMPLATE_DETAILS).should('have.text', noneTimelineTemplate); + }); }); }); - }); - describe('Schedule', () => { - it('Default values are applied to bulk edit schedule fields', () => { - getRulesManagementTableRows().then((rows) => { - selectAllRules(); - clickUpdateScheduleMenuItem(); + describe('Schedule', () => { + it('Default values are applied to bulk edit schedule fields', () => { + getRulesManagementTableRows().then((rows) => { + selectAllRules(); + clickUpdateScheduleMenuItem(); - assertUpdateScheduleWarningExists(rows.length); + assertUpdateScheduleWarningExists(rows.length); - assertDefaultValuesAreAppliedToScheduleFields({ - interval: 5, - lookback: 1, + assertDefaultValuesAreAppliedToScheduleFields({ + interval: 5, + lookback: 1, + }); }); }); - }); - it('Updates schedule for custom rules', () => { - getRulesManagementTableRows().then((rows) => { - selectAllRules(); - clickUpdateScheduleMenuItem(); + it('Updates schedule for custom rules', () => { + getRulesManagementTableRows().then((rows) => { + selectAllRules(); + clickUpdateScheduleMenuItem(); - assertUpdateScheduleWarningExists(rows.length); + assertUpdateScheduleWarningExists(rows.length); - typeScheduleInterval('20'); - setScheduleIntervalTimeUnit('Hours'); + typeScheduleInterval('20'); + setScheduleIntervalTimeUnit('Hours'); - typeScheduleLookback('10'); - setScheduleLookbackTimeUnit('Minutes'); + typeScheduleLookback('10'); + setScheduleLookbackTimeUnit('Minutes'); - submitBulkEditForm(); - waitForBulkEditActionToFinish({ updatedCount: rows.length }); + submitBulkEditForm(); + waitForBulkEditActionToFinish({ updatedCount: rows.length }); - goToTheRuleDetailsOf(RULE_NAME); + goToTheRuleDetailsOf(RULE_NAME); - assertRuleScheduleValues({ - interval: '20h', - lookback: '10m', + assertRuleScheduleValues({ + interval: '20h', + lookback: '10m', + }); }); }); - }); - it('Validates invalid inputs when scheduling for custom rules', () => { - getRulesManagementTableRows().then((rows) => { - selectAllRules(); - clickUpdateScheduleMenuItem(); + it('Validates invalid inputs when scheduling for custom rules', () => { + getRulesManagementTableRows().then((rows) => { + selectAllRules(); + clickUpdateScheduleMenuItem(); - // Validate invalid values are corrected to minimumValue - for 0 and negative values - typeScheduleInterval('0'); - setScheduleIntervalTimeUnit('Hours'); + // Validate invalid values are corrected to minimumValue - for 0 and negative values + typeScheduleInterval('0'); + setScheduleIntervalTimeUnit('Hours'); - typeScheduleLookback('-5'); - setScheduleLookbackTimeUnit('Seconds'); + typeScheduleLookback('-5'); + setScheduleLookbackTimeUnit('Seconds'); - submitBulkEditForm(); - waitForBulkEditActionToFinish({ updatedCount: rows.length }); + submitBulkEditForm(); + waitForBulkEditActionToFinish({ updatedCount: rows.length }); - goToTheRuleDetailsOf(RULE_NAME); + goToTheRuleDetailsOf(RULE_NAME); - assertRuleScheduleValues({ - interval: '1h', - lookback: '1s', + assertRuleScheduleValues({ + interval: '1h', + lookback: '1s', + }); }); }); }); - }); -}); + } +); diff --git a/x-pack/test/security_solution_cypress/cypress/e2e/detection_response/rule_management/rule_actions/bulk_actions/bulk_edit_rules_actions.cy.ts b/x-pack/test/security_solution_cypress/cypress/e2e/detection_response/rule_management/rule_actions/bulk_actions/bulk_edit_rules_actions.cy.ts index 997ded389422e..a2575f825dd75 100644 --- a/x-pack/test/security_solution_cypress/cypress/e2e/detection_response/rule_management/rule_actions/bulk_actions/bulk_edit_rules_actions.cy.ts +++ b/x-pack/test/security_solution_cypress/cypress/e2e/detection_response/rule_management/rule_actions/bulk_actions/bulk_edit_rules_actions.cy.ts @@ -73,9 +73,10 @@ const ruleNameToAssert = 'Custom rule name with actions'; const expectedExistingSlackMessage = 'Existing slack action'; const expectedSlackMessage = 'Slack action test message'; +// TODO: https://github.com/elastic/kibana/issues/161540 describe( 'Detection rules, bulk edit of rule actions', - { tags: ['@ess', '@brokenInServerless'] }, + { tags: ['@ess', '@serverless', '@brokenInServerless'] }, () => { beforeEach(() => { cleanKibana(); diff --git a/x-pack/test/security_solution_cypress/cypress/e2e/detection_response/rule_management/rule_actions/bulk_actions/bulk_edit_rules_data_view.cy.ts b/x-pack/test/security_solution_cypress/cypress/e2e/detection_response/rule_management/rule_actions/bulk_actions/bulk_edit_rules_data_view.cy.ts index 32e96dd8f3cfb..6628df0a55a52 100644 --- a/x-pack/test/security_solution_cypress/cypress/e2e/detection_response/rule_management/rule_actions/bulk_actions/bulk_edit_rules_data_view.cy.ts +++ b/x-pack/test/security_solution_cypress/cypress/e2e/detection_response/rule_management/rule_actions/bulk_actions/bulk_edit_rules_data_view.cy.ts @@ -53,9 +53,10 @@ const DATA_VIEW_ID = 'auditbeat'; const expectedIndexPatterns = ['index-1-*', 'index-2-*']; +// TODO: https://github.com/elastic/kibana/issues/161540 describe( 'Bulk editing index patterns of rules with a data view only', - { tags: ['@ess', '@brokenInServerless'] }, + { tags: ['@ess', '@serverless', '@brokenInServerless'] }, () => { before(() => { cleanKibana(); diff --git a/x-pack/test/security_solution_cypress/cypress/e2e/detection_response/rule_management/rule_actions/import_export/export_rule.cy.ts b/x-pack/test/security_solution_cypress/cypress/e2e/detection_response/rule_management/rule_actions/import_export/export_rule.cy.ts index a9c6d6d693129..050c944c42d2d 100644 --- a/x-pack/test/security_solution_cypress/cypress/e2e/detection_response/rule_management/rule_actions/import_export/export_rule.cy.ts +++ b/x-pack/test/security_solution_cypress/cypress/e2e/detection_response/rule_management/rule_actions/import_export/export_rule.cy.ts @@ -55,7 +55,8 @@ const prebuiltRules = Array.from(Array(7)).map((_, i) => { }); }); -describe('Export rules', { tags: ['@ess', '@brokenInServerless'] }, () => { +// TODO: https://github.com/elastic/kibana/issues/161540 +describe('Export rules', { tags: ['@ess', '@serverless', '@brokenInServerless'] }, () => { const downloadsFolder = Cypress.config('downloadsFolder'); before(() => { diff --git a/x-pack/test/security_solution_cypress/cypress/e2e/detection_response/rule_management/rule_actions/import_export/import_rules.cy.ts b/x-pack/test/security_solution_cypress/cypress/e2e/detection_response/rule_management/rule_actions/import_export/import_rules.cy.ts index f42dabbbc030b..147148b724d7e 100644 --- a/x-pack/test/security_solution_cypress/cypress/e2e/detection_response/rule_management/rule_actions/import_export/import_rules.cy.ts +++ b/x-pack/test/security_solution_cypress/cypress/e2e/detection_response/rule_management/rule_actions/import_export/import_rules.cy.ts @@ -17,7 +17,8 @@ import { login, visitWithoutDateRange } from '../../../../../tasks/login'; import { DETECTIONS_RULE_MANAGEMENT_URL } from '../../../../../urls/navigation'; const RULES_TO_IMPORT_FILENAME = 'cypress/fixtures/7_16_rules.ndjson'; -describe('Import rules', { tags: ['@ess', '@brokenInServerless'] }, () => { +// TODO: https://github.com/elastic/kibana/issues/161540 +describe('Import rules', { tags: ['@ess', '@serverless', '@brokenInServerless'] }, () => { before(() => { cleanKibana(); }); diff --git a/x-pack/test/security_solution_cypress/cypress/e2e/detection_response/rule_management/rule_actions/snoozing/rule_snoozing.cy.ts b/x-pack/test/security_solution_cypress/cypress/e2e/detection_response/rule_management/rule_actions/snoozing/rule_snoozing.cy.ts index 6f5dc717c8607..b5121bda97b0e 100644 --- a/x-pack/test/security_solution_cypress/cypress/e2e/detection_response/rule_management/rule_actions/snoozing/rule_snoozing.cy.ts +++ b/x-pack/test/security_solution_cypress/cypress/e2e/detection_response/rule_management/rule_actions/snoozing/rule_snoozing.cy.ts @@ -47,8 +47,9 @@ import { TOOLTIP } from '../../../../../screens/common'; const RULES_TO_IMPORT_FILENAME = 'cypress/fixtures/7_16_rules.ndjson'; +// TODO: https://github.com/elastic/kibana/issues/161540 // Flaky in serverless tests -describe('rule snoozing', { tags: ['@ess', '@serverless', '@brokenInServerless'] }, () => { +describe('rule snoozing', { tags: ['@ess', '@serverless', '@skipInServerless'] }, () => { before(() => { cleanKibana(); }); diff --git a/x-pack/test/security_solution_cypress/cypress/e2e/detection_response/rule_management/rules_table/rules_table_auto_refresh.cy.ts b/x-pack/test/security_solution_cypress/cypress/e2e/detection_response/rule_management/rules_table/rules_table_auto_refresh.cy.ts index 4d38fbda5525b..ffcfb468e0824 100644 --- a/x-pack/test/security_solution_cypress/cypress/e2e/detection_response/rule_management/rules_table/rules_table_auto_refresh.cy.ts +++ b/x-pack/test/security_solution_cypress/cypress/e2e/detection_response/rule_management/rules_table/rules_table_auto_refresh.cy.ts @@ -33,86 +33,91 @@ import { getNewRule } from '../../../../objects/rule'; const DEFAULT_RULE_REFRESH_INTERVAL_VALUE = 60000; const NUM_OF_TEST_RULES = 6; -describe('Rules table: auto-refresh', { tags: ['@ess', '@brokenInServerless'] }, () => { - before(() => { - cleanKibana(); - login(); +// TODO: https://github.com/elastic/kibana/issues/161540 +describe( + 'Rules table: auto-refresh', + { tags: ['@ess', '@serverless', '@brokenInServerless'] }, + () => { + before(() => { + cleanKibana(); + login(); - for (let i = 1; i <= NUM_OF_TEST_RULES; ++i) { - createRule(getNewRule({ name: `Test rule ${i}`, rule_id: `${i}`, enabled: false })); - } - }); + for (let i = 1; i <= NUM_OF_TEST_RULES; ++i) { + createRule(getNewRule({ name: `Test rule ${i}`, rule_id: `${i}`, enabled: false })); + } + }); - beforeEach(() => { - login(); - }); + beforeEach(() => { + login(); + }); - it('Auto refreshes rules', () => { - mockGlobalClock(); - visitWithoutDateRange(DETECTIONS_RULE_MANAGEMENT_URL); + it('Auto refreshes rules', () => { + mockGlobalClock(); + visitWithoutDateRange(DETECTIONS_RULE_MANAGEMENT_URL); - expectNumberOfRules(RULES_MANAGEMENT_TABLE, NUM_OF_TEST_RULES); + expectNumberOfRules(RULES_MANAGEMENT_TABLE, NUM_OF_TEST_RULES); - // // mock 1 minute passing to make sure refresh is conducted - cy.get(RULES_TABLE_AUTOREFRESH_INDICATOR).should('not.exist'); - cy.tick(DEFAULT_RULE_REFRESH_INTERVAL_VALUE); - cy.get(RULES_TABLE_AUTOREFRESH_INDICATOR).should('be.visible'); + // // mock 1 minute passing to make sure refresh is conducted + cy.get(RULES_TABLE_AUTOREFRESH_INDICATOR).should('not.exist'); + cy.tick(DEFAULT_RULE_REFRESH_INTERVAL_VALUE); + cy.get(RULES_TABLE_AUTOREFRESH_INDICATOR).should('be.visible'); - cy.contains(REFRESH_RULES_STATUS, 'Updated now'); - }); + cy.contains(REFRESH_RULES_STATUS, 'Updated now'); + }); - it('should prevent table from rules refetch if any rule selected', () => { - mockGlobalClock(); - visitWithoutDateRange(DETECTIONS_RULE_MANAGEMENT_URL); + it('should prevent table from rules refetch if any rule selected', () => { + mockGlobalClock(); + visitWithoutDateRange(DETECTIONS_RULE_MANAGEMENT_URL); - expectNumberOfRules(RULES_MANAGEMENT_TABLE, NUM_OF_TEST_RULES); + expectNumberOfRules(RULES_MANAGEMENT_TABLE, NUM_OF_TEST_RULES); - selectRulesByName(['Test rule 1']); + selectRulesByName(['Test rule 1']); - // mock 1 minute passing to make sure refresh is not conducted - cy.get(RULES_TABLE_AUTOREFRESH_INDICATOR).should('not.exist'); - cy.tick(DEFAULT_RULE_REFRESH_INTERVAL_VALUE); - cy.get(RULES_TABLE_AUTOREFRESH_INDICATOR).should('not.exist'); + // mock 1 minute passing to make sure refresh is not conducted + cy.get(RULES_TABLE_AUTOREFRESH_INDICATOR).should('not.exist'); + cy.tick(DEFAULT_RULE_REFRESH_INTERVAL_VALUE); + cy.get(RULES_TABLE_AUTOREFRESH_INDICATOR).should('not.exist'); - // ensure rule is still selected - getRuleRow('Test rule 1').find(EUI_CHECKBOX).should('be.checked'); + // ensure rule is still selected + getRuleRow('Test rule 1').find(EUI_CHECKBOX).should('be.checked'); - cy.get(REFRESH_RULES_STATUS).should('have.not.text', 'Updated now'); - }); + cy.get(REFRESH_RULES_STATUS).should('have.not.text', 'Updated now'); + }); - it('should disable auto refresh when any rule selected and enable it after rules unselected', () => { - visit(DETECTIONS_RULE_MANAGEMENT_URL); + it('should disable auto refresh when any rule selected and enable it after rules unselected', () => { + visit(DETECTIONS_RULE_MANAGEMENT_URL); - expectNumberOfRules(RULES_MANAGEMENT_TABLE, NUM_OF_TEST_RULES); + expectNumberOfRules(RULES_MANAGEMENT_TABLE, NUM_OF_TEST_RULES); - // check refresh settings if it's enabled before selecting - expectAutoRefreshIsEnabled(); + // check refresh settings if it's enabled before selecting + expectAutoRefreshIsEnabled(); - selectAllRules(); + selectAllRules(); - // auto refresh should be deactivated (which means disabled without an ability to enable it) after rules selected - expectAutoRefreshIsDeactivated(); + // auto refresh should be deactivated (which means disabled without an ability to enable it) after rules selected + expectAutoRefreshIsDeactivated(); - clearAllRuleSelection(); + clearAllRuleSelection(); - // after all rules unselected, auto refresh should be reset to its previous state - expectAutoRefreshIsEnabled(); - }); + // after all rules unselected, auto refresh should be reset to its previous state + expectAutoRefreshIsEnabled(); + }); - it('should not enable auto refresh after rules were unselected if auto refresh was disabled', () => { - visit(DETECTIONS_RULE_MANAGEMENT_URL); + it('should not enable auto refresh after rules were unselected if auto refresh was disabled', () => { + visit(DETECTIONS_RULE_MANAGEMENT_URL); - expectNumberOfRules(RULES_MANAGEMENT_TABLE, NUM_OF_TEST_RULES); + expectNumberOfRules(RULES_MANAGEMENT_TABLE, NUM_OF_TEST_RULES); - disableAutoRefresh(); + disableAutoRefresh(); - selectAllRules(); + selectAllRules(); - expectAutoRefreshIsDeactivated(); + expectAutoRefreshIsDeactivated(); - clearAllRuleSelection(); + clearAllRuleSelection(); - // after all rules unselected, auto refresh should still be disabled - expectAutoRefreshIsDisabled(); - }); -}); + // after all rules unselected, auto refresh should still be disabled + expectAutoRefreshIsDisabled(); + }); + } +); diff --git a/x-pack/test/security_solution_cypress/cypress/e2e/detection_response/rule_management/rules_table/rules_table_filtering.cy.ts b/x-pack/test/security_solution_cypress/cypress/e2e/detection_response/rule_management/rules_table/rules_table_filtering.cy.ts index 97ccd8494e3dd..d6cf2c415297c 100644 --- a/x-pack/test/security_solution_cypress/cypress/e2e/detection_response/rule_management/rules_table/rules_table_filtering.cy.ts +++ b/x-pack/test/security_solution_cypress/cypress/e2e/detection_response/rule_management/rules_table/rules_table_filtering.cy.ts @@ -28,8 +28,9 @@ import { import { disableAutoRefresh } from '../../../../tasks/alerts_detection_rules'; import { getNewRule } from '../../../../objects/rule'; +// TODO: https://github.com/elastic/kibana/issues/161540 // Flaky in serverless tests -describe('Rules table: filtering', { tags: ['@ess', '@serverless', '@brokenInServerless'] }, () => { +describe('Rules table: filtering', { tags: ['@ess', '@serverless', '@skipInServerless'] }, () => { before(() => { cleanKibana(); }); @@ -42,6 +43,7 @@ describe('Rules table: filtering', { tags: ['@ess', '@serverless', '@brokenInSer cy.task('esArchiverResetKibana'); }); + // TODO: https://github.com/elastic/kibana/issues/161540 describe.skip('Last response filter', () => { // Flaky in serverless tests // @brokenInServerless tag is not working so a skip was needed diff --git a/x-pack/test/security_solution_cypress/cypress/e2e/detection_response/rule_management/rules_table/rules_table_links.cy.ts b/x-pack/test/security_solution_cypress/cypress/e2e/detection_response/rule_management/rules_table/rules_table_links.cy.ts index d2fbd5433f872..a568bbefe7fae 100644 --- a/x-pack/test/security_solution_cypress/cypress/e2e/detection_response/rule_management/rules_table/rules_table_links.cy.ts +++ b/x-pack/test/security_solution_cypress/cypress/e2e/detection_response/rule_management/rules_table/rules_table_links.cy.ts @@ -12,8 +12,9 @@ import { cleanKibana, deleteAlertsAndRules } from '../../../../tasks/common'; import { login, visitWithoutDateRange } from '../../../../tasks/login'; import { DETECTIONS_RULE_MANAGEMENT_URL } from '../../../../urls/navigation'; +// TODO: https://github.com/elastic/kibana/issues/161540 // Flaky in serverless tests -describe('Rules table: links', { tags: ['@ess', '@serverless', '@brokenInServerless'] }, () => { +describe('Rules table: links', { tags: ['@ess', '@serverless', '@skipInServerless'] }, () => { before(() => { cleanKibana(); }); diff --git a/x-pack/test/security_solution_cypress/cypress/e2e/detection_response/rule_management/rules_table/rules_table_persistent_state.cy.ts b/x-pack/test/security_solution_cypress/cypress/e2e/detection_response/rule_management/rules_table/rules_table_persistent_state.cy.ts index 30c35ba44288a..68a614871168a 100644 --- a/x-pack/test/security_solution_cypress/cypress/e2e/detection_response/rule_management/rules_table/rules_table_persistent_state.cy.ts +++ b/x-pack/test/security_solution_cypress/cypress/e2e/detection_response/rule_management/rules_table/rules_table_persistent_state.cy.ts @@ -99,310 +99,316 @@ function expectDefaultRulesTableState(): void { expectTablePage(1); } -describe('Rules table: persistent state', { tags: ['@ess', '@serverless'] }, () => { - before(() => { - cleanKibana(); - createTestRules(); - }); - - beforeEach(() => { - login(); - resetRulesTableState(); - }); - - // Flaky on serverless - // FLAKY: https://github.com/elastic/kibana/issues/165740 - describe( - 'while on a happy path', - { tags: ['@ess', '@serverless', '@brokenInServerless'] }, - () => { - it('activates management tab by default', () => { - visit(SECURITY_DETECTIONS_RULES_URL); - - expectRulesManagementTab(); - }); +// TODO: https://github.com/elastic/kibana/issues/161540 +describe( + 'Rules table: persistent state', + { tags: ['@ess', '@serverless', '@skipInServerless'] }, + () => { + before(() => { + cleanKibana(); + createTestRules(); + }); - it('leads to displaying a rule according to the specified filters', () => { - visitRulesTableWithState({ - searchTerm: 'rule', - tags: ['tag-b'], - source: 'custom', - enabled: false, - field: 'name', - order: 'asc', - perPage: 5, - page: 2, - }); + beforeEach(() => { + login(); + resetRulesTableState(); + }); - expectManagementTableRules(['rule 6']); - }); + // TODO: https://github.com/elastic/kibana/issues/161540 + // Flaky on serverless + // FLAKY: https://github.com/elastic/kibana/issues/165740 + describe( + 'while on a happy path', + { tags: ['@ess', '@serverless', '@brokenInServerless'] }, + () => { + it('activates management tab by default', () => { + visit(SECURITY_DETECTIONS_RULES_URL); - it('loads from the url', () => { - visitRulesTableWithState({ - searchTerm: 'rule', - tags: ['tag-b'], - source: 'custom', - enabled: false, - field: 'name', - order: 'asc', - perPage: 5, - page: 2, + expectRulesManagementTab(); }); - expectRulesManagementTab(); - expectFilterSearchTerm('rule'); - expectFilterByTags(['tag-b']); - expectFilterByCustomRules(); - expectFilterByDisabledRules(); - expectTableSorting('Rule', 'asc'); - expectRowsPerPage(5); - expectTablePage(2); - }); - - it('loads from the session storage', () => { - setStorageState({ - searchTerm: 'test', - tags: ['tag-a'], - source: 'prebuilt', - enabled: true, - field: 'severity', - order: 'desc', - perPage: 10, + it('leads to displaying a rule according to the specified filters', () => { + visitRulesTableWithState({ + searchTerm: 'rule', + tags: ['tag-b'], + source: 'custom', + enabled: false, + field: 'name', + order: 'asc', + perPage: 5, + page: 2, + }); + + expectManagementTableRules(['rule 6']); }); - visit(SECURITY_DETECTIONS_RULES_MANAGEMENT_URL); + it('loads from the url', () => { + visitRulesTableWithState({ + searchTerm: 'rule', + tags: ['tag-b'], + source: 'custom', + enabled: false, + field: 'name', + order: 'asc', + perPage: 5, + page: 2, + }); - expectRulesManagementTab(); - expectFilterSearchTerm('test'); - expectFilterByTags(['tag-a']); - expectFilterByPrebuiltRules(); - expectFilterByEnabledRules(); - expectTableSorting('Severity', 'desc'); - }); - - it('prefers url state over storage state', () => { - setStorageState({ - searchTerm: 'test', - tags: ['tag-c'], - source: 'prebuilt', - enabled: true, - field: 'severity', - order: 'desc', - perPage: 10, - }); - - visitRulesTableWithState({ - searchTerm: 'rule', - tags: ['tag-b'], - source: 'custom', - enabled: false, - field: 'name', - order: 'asc', - perPage: 5, - page: 2, + expectRulesManagementTab(); + expectFilterSearchTerm('rule'); + expectFilterByTags(['tag-b']); + expectFilterByCustomRules(); + expectFilterByDisabledRules(); + expectTableSorting('Rule', 'asc'); + expectRowsPerPage(5); + expectTablePage(2); }); - expectRulesManagementTab(); - expectRulesTableState(); - expectTablePage(2); - }); + it('loads from the session storage', () => { + setStorageState({ + searchTerm: 'test', + tags: ['tag-a'], + source: 'prebuilt', + enabled: true, + field: 'severity', + order: 'desc', + perPage: 10, + }); - describe('and on the rules management tab', () => { - beforeEach(() => { - login(); visit(SECURITY_DETECTIONS_RULES_MANAGEMENT_URL); - }); - - it('persists after reloading the page', () => { - changeRulesTableState(); - goToTablePage(2); - - cy.reload(); expectRulesManagementTab(); - expectRulesTableState(); - expectTablePage(2); + expectFilterSearchTerm('test'); + expectFilterByTags(['tag-a']); + expectFilterByPrebuiltRules(); + expectFilterByEnabledRules(); + expectTableSorting('Severity', 'desc'); }); - it('persists after navigating back from a rule details page', () => { - changeRulesTableState(); - goToTablePage(2); - - goToRuleDetails(); - cy.go('back'); + it('prefers url state over storage state', () => { + setStorageState({ + searchTerm: 'test', + tags: ['tag-c'], + source: 'prebuilt', + enabled: true, + field: 'severity', + order: 'desc', + perPage: 10, + }); + + visitRulesTableWithState({ + searchTerm: 'rule', + tags: ['tag-b'], + source: 'custom', + enabled: false, + field: 'name', + order: 'asc', + perPage: 5, + page: 2, + }); expectRulesManagementTab(); expectRulesTableState(); expectTablePage(2); }); - it('persists after navigating to another page inside Security Solution', () => { - changeRulesTableState(); - goToTablePage(2); + describe('and on the rules management tab', () => { + beforeEach(() => { + login(); + visit(SECURITY_DETECTIONS_RULES_MANAGEMENT_URL); + }); - visit(DASHBOARDS_URL); - visit(SECURITY_DETECTIONS_RULES_MANAGEMENT_URL); + it('persists after reloading the page', () => { + changeRulesTableState(); + goToTablePage(2); - expectRulesManagementTab(); - expectRulesTableState(); - expectTablePage(1); - }); + cy.reload(); - it('persists after navigating to another page outside Security Solution', () => { - changeRulesTableState(); - goToTablePage(2); + expectRulesManagementTab(); + expectRulesTableState(); + expectTablePage(2); + }); - visit(KIBANA_HOME); - visit(SECURITY_DETECTIONS_RULES_MANAGEMENT_URL); + it('persists after navigating back from a rule details page', () => { + changeRulesTableState(); + goToTablePage(2); - expectRulesManagementTab(); - expectRulesTableState(); - expectTablePage(1); - }); - }); + goToRuleDetails(); + cy.go('back'); - describe('and on the rules monitoring tab', () => { - beforeEach(() => { - login(); - visit(SECURITY_DETECTIONS_RULES_MONITORING_URL); - }); + expectRulesManagementTab(); + expectRulesTableState(); + expectTablePage(2); + }); - it('persists the selected tab', () => { - changeRulesTableState(); + it('persists after navigating to another page inside Security Solution', () => { + changeRulesTableState(); + goToTablePage(2); - cy.reload(); + visit(DASHBOARDS_URL); + visit(SECURITY_DETECTIONS_RULES_MANAGEMENT_URL); - expectRulesMonitoringTab(); - }); - }); - } - ); + expectRulesManagementTab(); + expectRulesTableState(); + expectTablePage(1); + }); - describe('upon state format upgrade', async () => { - beforeEach(() => { - login(); - }); + it('persists after navigating to another page outside Security Solution', () => { + changeRulesTableState(); + goToTablePage(2); + + visit(KIBANA_HOME); + visit(SECURITY_DETECTIONS_RULES_MANAGEMENT_URL); - describe('and having state in the url', () => { - it('ignores unsupported state key', () => { - visitRulesTableWithState({ - someKey: 10, - searchTerm: 'rule', - tags: ['tag-b'], - source: 'custom', - enabled: false, - field: 'name', - order: 'asc', - perPage: 5, - page: 2, + expectRulesManagementTab(); + expectRulesTableState(); + expectTablePage(1); + }); }); - expectRulesTableState(); - expectTablePage(2); - }); - }); + describe('and on the rules monitoring tab', () => { + beforeEach(() => { + login(); + visit(SECURITY_DETECTIONS_RULES_MONITORING_URL); + }); - describe('and having state in the session storage', () => { - it('ignores unsupported state key', () => { - setStorageState({ - someKey: 10, - searchTerm: 'rule', - tags: ['tag-b'], - source: 'custom', - enabled: false, - field: 'name', - order: 'asc', - perPage: 5, - }); + it('persists the selected tab', () => { + changeRulesTableState(); - visit(SECURITY_DETECTIONS_RULES_MANAGEMENT_URL); + cy.reload(); - expectRulesTableState(); - expectTablePage(1); - }); - }); - }); + expectRulesMonitoringTab(); + }); + }); + } + ); - describe('when persisted state is partially unavailable', () => { - describe('and on the rules management tab', () => { + describe('upon state format upgrade', async () => { beforeEach(() => { login(); - visit(SECURITY_DETECTIONS_RULES_MANAGEMENT_URL); }); - it('persists after clearing the session storage', () => { - changeRulesTableState(); - goToTablePage(2); + describe('and having state in the url', () => { + it('ignores unsupported state key', () => { + visitRulesTableWithState({ + someKey: 10, + searchTerm: 'rule', + tags: ['tag-b'], + source: 'custom', + enabled: false, + field: 'name', + order: 'asc', + perPage: 5, + page: 2, + }); - cy.window().then((win) => { - win.sessionStorage.clear(); + expectRulesTableState(); + expectTablePage(2); }); - cy.reload(); - - expectRulesManagementTab(); - expectRulesTableState(); - expectTablePage(2); }); - it('persists after clearing the url state', () => { - changeRulesTableState(); - goToTablePage(2); + describe('and having state in the session storage', () => { + it('ignores unsupported state key', () => { + setStorageState({ + someKey: 10, + searchTerm: 'rule', + tags: ['tag-b'], + source: 'custom', + enabled: false, + field: 'name', + order: 'asc', + perPage: 5, + }); - visit(SECURITY_DETECTIONS_RULES_MANAGEMENT_URL); + visit(SECURITY_DETECTIONS_RULES_MANAGEMENT_URL); - expectRulesManagementTab(); - expectRulesTableState(); - expectTablePage(1); + expectRulesTableState(); + expectTablePage(1); + }); }); }); - }); - describe('when corrupted', () => { - describe('and on the rules management tab', () => { - beforeEach(() => { - login(); - visit(SECURITY_DETECTIONS_RULES_MANAGEMENT_URL); - }); + describe('when persisted state is partially unavailable', () => { + describe('and on the rules management tab', () => { + beforeEach(() => { + login(); + visit(SECURITY_DETECTIONS_RULES_MANAGEMENT_URL); + }); - it('persists after corrupting the session storage data', () => { - changeRulesTableState(); - goToTablePage(2); + it('persists after clearing the session storage', () => { + changeRulesTableState(); + goToTablePage(2); - cy.window().then((win) => { - win.sessionStorage.setItem('securitySolution.rulesTable', '!invalid'); + cy.window().then((win) => { + win.sessionStorage.clear(); + }); cy.reload(); expectRulesManagementTab(); expectRulesTableState(); expectTablePage(2); }); - }); - it('persists after corrupting the url param data', () => { - changeRulesTableState(); - goToTablePage(2); + it('persists after clearing the url state', () => { + changeRulesTableState(); + goToTablePage(2); - visit(SECURITY_DETECTIONS_RULES_MANAGEMENT_URL, { qs: { rulesTable: '(!invalid)' } }); + visit(SECURITY_DETECTIONS_RULES_MANAGEMENT_URL); - expectRulesManagementTab(); - expectRulesTableState(); - expectTablePage(1); + expectRulesManagementTab(); + expectRulesTableState(); + expectTablePage(1); + }); }); + }); - it('DOES NOT persist after corrupting the session storage and url param data', () => { - changeRulesTableState(); - goToTablePage(2); + describe('when corrupted', () => { + describe('and on the rules management tab', () => { + beforeEach(() => { + login(); + visit(SECURITY_DETECTIONS_RULES_MANAGEMENT_URL); + }); - visit(SECURITY_DETECTIONS_RULES_MANAGEMENT_URL, { - qs: { rulesTable: '(!invalid)' }, - onBeforeLoad: (win) => { + it('persists after corrupting the session storage data', () => { + changeRulesTableState(); + goToTablePage(2); + + cy.window().then((win) => { win.sessionStorage.setItem('securitySolution.rulesTable', '!invalid'); - }, + cy.reload(); + + expectRulesManagementTab(); + expectRulesTableState(); + expectTablePage(2); + }); + }); + + it('persists after corrupting the url param data', () => { + changeRulesTableState(); + goToTablePage(2); + + visit(SECURITY_DETECTIONS_RULES_MANAGEMENT_URL, { qs: { rulesTable: '(!invalid)' } }); + + expectRulesManagementTab(); + expectRulesTableState(); + expectTablePage(1); }); - expectRulesManagementTab(); - expectDefaultRulesTableState(); + it('DOES NOT persist after corrupting the session storage and url param data', () => { + changeRulesTableState(); + goToTablePage(2); + + visit(SECURITY_DETECTIONS_RULES_MANAGEMENT_URL, { + qs: { rulesTable: '(!invalid)' }, + onBeforeLoad: (win) => { + win.sessionStorage.setItem('securitySolution.rulesTable', '!invalid'); + }, + }); + + expectRulesManagementTab(); + expectDefaultRulesTableState(); + }); }); }); - }); -}); + } +); diff --git a/x-pack/test/security_solution_cypress/cypress/e2e/detection_response/rule_management/rules_table/rules_table_selection.cy.ts b/x-pack/test/security_solution_cypress/cypress/e2e/detection_response/rule_management/rules_table/rules_table_selection.cy.ts index 782e70dec8379..383718c646f9d 100644 --- a/x-pack/test/security_solution_cypress/cypress/e2e/detection_response/rule_management/rules_table/rules_table_selection.cy.ts +++ b/x-pack/test/security_solution_cypress/cypress/e2e/detection_response/rule_management/rules_table/rules_table_selection.cy.ts @@ -33,69 +33,74 @@ const RULE_2 = createRuleAssetSavedObject({ rule_id: 'rule_2', }); +// TODO: https://github.com/elastic/kibana/issues/161540 // FLAKY: https://github.com/elastic/kibana/issues/165643 -describe.skip('Rules table: selection', { tags: ['@ess', '@serverless'] }, () => { - before(() => { - cleanKibana(); - }); +describe.skip( + 'Rules table: selection', + { tags: ['@ess', '@serverless', '@skipInServerless'] }, + () => { + before(() => { + cleanKibana(); + }); - beforeEach(() => { - login(); - /* Create and install two mock rules */ - createAndInstallMockedPrebuiltRules({ rules: [RULE_1, RULE_2] }); - visitWithoutDateRange(DETECTIONS_RULE_MANAGEMENT_URL); - waitForPrebuiltDetectionRulesToBeLoaded(); - }); + beforeEach(() => { + login(); + /* Create and install two mock rules */ + createAndInstallMockedPrebuiltRules({ rules: [RULE_1, RULE_2] }); + visitWithoutDateRange(DETECTIONS_RULE_MANAGEMENT_URL); + waitForPrebuiltDetectionRulesToBeLoaded(); + }); - it('should correctly update the selection label when rules are individually selected and unselected', () => { - waitForPrebuiltDetectionRulesToBeLoaded(); + it('should correctly update the selection label when rules are individually selected and unselected', () => { + waitForPrebuiltDetectionRulesToBeLoaded(); - selectRulesByName(['Test rule 1', 'Test rule 2']); + selectRulesByName(['Test rule 1', 'Test rule 2']); - cy.get(SELECTED_RULES_NUMBER_LABEL).should('contain.text', '2'); + cy.get(SELECTED_RULES_NUMBER_LABEL).should('contain.text', '2'); - unselectRulesByName(['Test rule 1', 'Test rule 2']); + unselectRulesByName(['Test rule 1', 'Test rule 2']); - cy.get(SELECTED_RULES_NUMBER_LABEL).should('contain.text', '0'); - }); + cy.get(SELECTED_RULES_NUMBER_LABEL).should('contain.text', '0'); + }); - it('should correctly update the selection label when rules are bulk selected and then bulk un-selected', () => { - waitForPrebuiltDetectionRulesToBeLoaded(); + it('should correctly update the selection label when rules are bulk selected and then bulk un-selected', () => { + waitForPrebuiltDetectionRulesToBeLoaded(); - cy.get(SELECT_ALL_RULES_BTN).click(); + cy.get(SELECT_ALL_RULES_BTN).click(); - getAvailablePrebuiltRulesCount().then((availablePrebuiltRulesCount) => { - cy.get(SELECTED_RULES_NUMBER_LABEL).should('contain.text', availablePrebuiltRulesCount); - }); + getAvailablePrebuiltRulesCount().then((availablePrebuiltRulesCount) => { + cy.get(SELECTED_RULES_NUMBER_LABEL).should('contain.text', availablePrebuiltRulesCount); + }); - // Un-select all rules via the Bulk Selection button from the Utility bar - cy.get(SELECT_ALL_RULES_BTN).click(); + // Un-select all rules via the Bulk Selection button from the Utility bar + cy.get(SELECT_ALL_RULES_BTN).click(); - // Current selection should be 0 rules - cy.get(SELECTED_RULES_NUMBER_LABEL).should('contain.text', '0'); - // Bulk selection button should be back to displaying all rules - getAvailablePrebuiltRulesCount().then((availablePrebuiltRulesCount) => { - cy.get(SELECT_ALL_RULES_BTN).should('contain.text', availablePrebuiltRulesCount); + // Current selection should be 0 rules + cy.get(SELECTED_RULES_NUMBER_LABEL).should('contain.text', '0'); + // Bulk selection button should be back to displaying all rules + getAvailablePrebuiltRulesCount().then((availablePrebuiltRulesCount) => { + cy.get(SELECT_ALL_RULES_BTN).should('contain.text', availablePrebuiltRulesCount); + }); }); - }); - it('should correctly update the selection label when rules are bulk selected and then unselected via the table select all checkbox', () => { - waitForPrebuiltDetectionRulesToBeLoaded(); + it('should correctly update the selection label when rules are bulk selected and then unselected via the table select all checkbox', () => { + waitForPrebuiltDetectionRulesToBeLoaded(); - cy.get(SELECT_ALL_RULES_BTN).click(); + cy.get(SELECT_ALL_RULES_BTN).click(); - getAvailablePrebuiltRulesCount().then((availablePrebuiltRulesCount) => { - cy.get(SELECTED_RULES_NUMBER_LABEL).should('contain.text', availablePrebuiltRulesCount); - }); + getAvailablePrebuiltRulesCount().then((availablePrebuiltRulesCount) => { + cy.get(SELECTED_RULES_NUMBER_LABEL).should('contain.text', availablePrebuiltRulesCount); + }); - // Un-select all rules via the Un-select All checkbox from the table - cy.get(SELECT_ALL_RULES_ON_PAGE_CHECKBOX).click(); + // Un-select all rules via the Un-select All checkbox from the table + cy.get(SELECT_ALL_RULES_ON_PAGE_CHECKBOX).click(); - // Current selection should be 0 rules - cy.get(SELECTED_RULES_NUMBER_LABEL).should('contain.text', '0'); - // Bulk selection button should be back to displaying all rules - getAvailablePrebuiltRulesCount().then((availablePrebuiltRulesCount) => { - cy.get(SELECT_ALL_RULES_BTN).should('contain.text', availablePrebuiltRulesCount); + // Current selection should be 0 rules + cy.get(SELECTED_RULES_NUMBER_LABEL).should('contain.text', '0'); + // Bulk selection button should be back to displaying all rules + getAvailablePrebuiltRulesCount().then((availablePrebuiltRulesCount) => { + cy.get(SELECT_ALL_RULES_BTN).should('contain.text', availablePrebuiltRulesCount); + }); }); - }); -}); + } +); diff --git a/x-pack/test/security_solution_cypress/cypress/e2e/detection_response/rule_management/rules_table/rules_table_sorting.cy.ts b/x-pack/test/security_solution_cypress/cypress/e2e/detection_response/rule_management/rules_table/rules_table_sorting.cy.ts index d61d6fca98958..f132f89b248a1 100644 --- a/x-pack/test/security_solution_cypress/cypress/e2e/detection_response/rule_management/rules_table/rules_table_sorting.cy.ts +++ b/x-pack/test/security_solution_cypress/cypress/e2e/detection_response/rule_management/rules_table/rules_table_sorting.cy.ts @@ -36,6 +36,7 @@ import { } from '../../../../tasks/table_pagination'; import { TABLE_FIRST_PAGE, TABLE_SECOND_PAGE } from '../../../../screens/table_pagination'; +// TODO: https://github.com/elastic/kibana/issues/161540 describe('Rules table: sorting', { tags: ['@ess', '@serverless', '@brokenInServerless'] }, () => { before(() => { cleanKibana(); diff --git a/x-pack/test/security_solution_cypress/cypress/e2e/detection_response/value_lists/value_lists.cy.ts b/x-pack/test/security_solution_cypress/cypress/e2e/detection_response/value_lists/value_lists.cy.ts index 4cacc2ddeb24b..c74fe01f9ce50 100644 --- a/x-pack/test/security_solution_cypress/cypress/e2e/detection_response/value_lists/value_lists.cy.ts +++ b/x-pack/test/security_solution_cypress/cypress/e2e/detection_response/value_lists/value_lists.cy.ts @@ -34,8 +34,10 @@ const TEXT_LIST_FILE_NAME = 'value_list.txt'; const IPS_LIST_FILE_NAME = 'ip_list.txt'; const CIDRS_LIST_FILE_NAME = 'cidr_list.txt'; +// TODO: https://github.com/elastic/kibana/issues/161539 // FLAKY: https://github.com/elastic/kibana/issues/165699 -describe('value lists', () => { +describe('value lists', { tags: ['@ess', '@serverless', '@skipInServerless'] }, () => { + // TODO: https://github.com/elastic/kibana/issues/161539 describe('management modal', { tags: ['@ess', '@serverless', '@brokenInServerless'] }, () => { beforeEach(() => { login(); @@ -51,6 +53,7 @@ describe('value lists', () => { closeValueListsModal(); }); + // TODO: https://github.com/elastic/kibana/issues/161539 // Flaky in serverless tests describe('create list types', { tags: ['@brokenInServerless'] }, () => { beforeEach(() => { @@ -110,6 +113,7 @@ describe('value lists', () => { }); }); + // TODO: https://github.com/elastic/kibana/issues/161539 // Flaky in serverless tests describe('delete list types', { tags: ['@brokenInServerless'] }, () => { it('deletes a "keyword" list from an uploaded file', () => { @@ -157,6 +161,7 @@ describe('value lists', () => { }); }); + // TODO: https://github.com/elastic/kibana/issues/161539 // Flaky in serverless tests describe('export list types', { tags: ['@brokenInServerless'] }, () => { it('exports a "keyword" list from an uploaded file', () => { @@ -254,11 +259,17 @@ describe('value lists', () => { }); }); - describe('user with restricted access role', { tags: '@ess' }, () => { - it('Does not allow a t1 analyst user to upload a value list', () => { - login(ROLES.t1_analyst); - visitWithoutDateRange(DETECTIONS_RULE_MANAGEMENT_URL, ROLES.t1_analyst); - cy.get(VALUE_LISTS_MODAL_ACTIVATOR).should('have.attr', 'disabled'); - }); - }); + // TODO: https://github.com/elastic/kibana/issues/164451 We should find a way to make this spec work in Serverless + // TODO: https://github.com/elastic/kibana/issues/161539 + describe( + 'user with restricted access role', + { tags: ['@ess', '@serverless', '@skipInServerless'] }, + () => { + it('Does not allow a t1 analyst user to upload a value list', () => { + login(ROLES.t1_analyst); + visitWithoutDateRange(DETECTIONS_RULE_MANAGEMENT_URL, ROLES.t1_analyst); + cy.get(VALUE_LISTS_MODAL_ACTIVATOR).should('have.attr', 'disabled'); + }); + } + ); }); diff --git a/x-pack/test/security_solution_cypress/cypress/e2e/entity_analytics/entity_analytics_management_page.cy.ts b/x-pack/test/security_solution_cypress/cypress/e2e/entity_analytics/entity_analytics_management_page.cy.ts index 36bc18210863f..fca7699af7843 100644 --- a/x-pack/test/security_solution_cypress/cypress/e2e/entity_analytics/entity_analytics_management_page.cy.ts +++ b/x-pack/test/security_solution_cypress/cypress/e2e/entity_analytics/entity_analytics_management_page.cy.ts @@ -39,13 +39,14 @@ import { previewErrorButtonClick, } from '../../tasks/entity_analytics'; +// TODO: https://github.com/elastic/kibana/issues/161539 describe( 'Entity analytics management page', { env: { ftrConfig: { enableExperimental: ['riskScoringRoutesEnabled', 'riskScoringPersistence'] }, }, - tags: ['@ess', '@brokenInServerless'], + tags: ['@ess', '@serverless', '@brokenInServerless'], }, () => { before(() => { diff --git a/x-pack/test/security_solution_cypress/cypress/e2e/exceptions/alerts_table_flow/endpoint_exceptions.cy.ts b/x-pack/test/security_solution_cypress/cypress/e2e/exceptions/alerts_table_flow/endpoint_exceptions.cy.ts index e9c07294e62d3..0ddd3792a7bd6 100644 --- a/x-pack/test/security_solution_cypress/cypress/e2e/exceptions/alerts_table_flow/endpoint_exceptions.cy.ts +++ b/x-pack/test/security_solution_cypress/cypress/e2e/exceptions/alerts_table_flow/endpoint_exceptions.cy.ts @@ -37,10 +37,11 @@ import { } from '../../../screens/exceptions'; import { goToEndpointExceptionsTab, waitForTheRuleToBeExecuted } from '../../../tasks/rule_details'; +// TODO: https://github.com/elastic/kibana/issues/161539 // See https://github.com/elastic/kibana/issues/163967 describe.skip( 'Endpoint Exceptions workflows from Alert', - { tags: ['@ess', '@brokenInServerless'] }, + { tags: ['@ess', '@serverless', '@brokenInServerless'] }, () => { const ITEM_NAME = 'Sample Exception List Item'; const ITEM_NAME_EDIT = 'Sample Exception List Item'; diff --git a/x-pack/test/security_solution_cypress/cypress/e2e/exceptions/alerts_table_flow/rule_exceptions/auto_populate_with_alert_data.cy.ts b/x-pack/test/security_solution_cypress/cypress/e2e/exceptions/alerts_table_flow/rule_exceptions/auto_populate_with_alert_data.cy.ts index 14d002b96b7b4..8c582666514fa 100644 --- a/x-pack/test/security_solution_cypress/cypress/e2e/exceptions/alerts_table_flow/rule_exceptions/auto_populate_with_alert_data.cy.ts +++ b/x-pack/test/security_solution_cypress/cypress/e2e/exceptions/alerts_table_flow/rule_exceptions/auto_populate_with_alert_data.cy.ts @@ -38,10 +38,11 @@ import { } from '../../../../screens/exceptions'; import { waitForAlertsToPopulate } from '../../../../tasks/create_new_rule'; +// TODO: https://github.com/elastic/kibana/issues/161539 // See https://github.com/elastic/kibana/issues/163967 describe.skip( 'Auto populate exception with Alert data', - { tags: ['@ess', '@brokenInServerless'] }, + { tags: ['@ess', '@serverless', '@brokenInServerless'] }, () => { const ITEM_NAME = 'Sample Exception Item'; const ITEM_NAME_EDIT = 'Sample Exception Item Edit'; diff --git a/x-pack/test/security_solution_cypress/cypress/e2e/exceptions/alerts_table_flow/rule_exceptions/closing_all_matching_alerts.cy.ts b/x-pack/test/security_solution_cypress/cypress/e2e/exceptions/alerts_table_flow/rule_exceptions/closing_all_matching_alerts.cy.ts index 9c4a575dccb4e..7baf3651f68a3 100644 --- a/x-pack/test/security_solution_cypress/cypress/e2e/exceptions/alerts_table_flow/rule_exceptions/closing_all_matching_alerts.cy.ts +++ b/x-pack/test/security_solution_cypress/cypress/e2e/exceptions/alerts_table_flow/rule_exceptions/closing_all_matching_alerts.cy.ts @@ -27,8 +27,9 @@ import { submitNewExceptionItem, } from '../../../../tasks/exceptions'; +// TODO: https://github.com/elastic/kibana/issues/161539 // See https://github.com/elastic/kibana/issues/163967 -describe('Close matching Alerts ', () => { +describe('Close matching Alerts ', { tags: ['@ess', '@serverless', '@skipInServerless'] }, () => { const newRule = getNewRule(); const ITEM_NAME = 'Sample Exception Item'; diff --git a/x-pack/test/security_solution_cypress/cypress/e2e/exceptions/entry/flyout_validation.cy.ts b/x-pack/test/security_solution_cypress/cypress/e2e/exceptions/entry/flyout_validation.cy.ts index e11cace87d8e8..d1fa25ee700de 100644 --- a/x-pack/test/security_solution_cypress/cypress/e2e/exceptions/entry/flyout_validation.cy.ts +++ b/x-pack/test/security_solution_cypress/cypress/e2e/exceptions/entry/flyout_validation.cy.ts @@ -57,6 +57,7 @@ import { } from '../../../tasks/api_calls/exceptions'; import { getExceptionList } from '../../../objects/exception'; +// TODO: https://github.com/elastic/kibana/issues/161539 // Test Skipped until we fix the Flyout rerendering issue // https://github.com/elastic/kibana/issues/154994 @@ -65,7 +66,7 @@ import { getExceptionList } from '../../../objects/exception'; // to test in enzyme and very small changes can inadvertently add // bugs. As the complexity within the builder grows, these should // ensure the most basic logic holds. -describe.skip('Exceptions flyout', { tags: ['@ess', '@serverless'] }, () => { +describe.skip('Exceptions flyout', { tags: ['@ess', '@serverless', '@skipInServerless'] }, () => { before(() => { cy.task('esArchiverResetKibana'); // this is a made-up index that has just the necessary diff --git a/x-pack/test/security_solution_cypress/cypress/e2e/exceptions/entry/multiple_conditions.cy.ts b/x-pack/test/security_solution_cypress/cypress/e2e/exceptions/entry/multiple_conditions.cy.ts index e1e396af156b5..6bb98275466bc 100644 --- a/x-pack/test/security_solution_cypress/cypress/e2e/exceptions/entry/multiple_conditions.cy.ts +++ b/x-pack/test/security_solution_cypress/cypress/e2e/exceptions/entry/multiple_conditions.cy.ts @@ -28,12 +28,13 @@ import { import { DETECTIONS_RULE_MANAGEMENT_URL } from '../../../urls/navigation'; +// TODO: https://github.com/elastic/kibana/issues/161539 // FLAKY: https://github.com/elastic/kibana/issues/165651 // FLAKY: https://github.com/elastic/kibana/issues/165734 // FLAKY: https://github.com/elastic/kibana/issues/165652 describe( 'Add multiple conditions and validate the generated exceptions', - { tags: ['@ess', '@serverless', '@brokenInServerless'] }, + { tags: ['@ess', '@serverless', '@skipInServerless'] }, () => { beforeEach(() => { cy.task('esArchiverResetKibana'); diff --git a/x-pack/test/security_solution_cypress/cypress/e2e/exceptions/entry/use_value_list.cy.ts b/x-pack/test/security_solution_cypress/cypress/e2e/exceptions/entry/use_value_list.cy.ts index b1e2c81b4c420..47c5dd4ed44f9 100644 --- a/x-pack/test/security_solution_cypress/cypress/e2e/exceptions/entry/use_value_list.cy.ts +++ b/x-pack/test/security_solution_cypress/cypress/e2e/exceptions/entry/use_value_list.cy.ts @@ -50,10 +50,11 @@ const goToRulesAndOpenValueListModal = () => { openValueListsModal(); }; +// TODO: https://github.com/elastic/kibana/issues/161539 // Flaky on serverless describe( 'Use Value list in exception entry', - { tags: ['@ess', '@serverless', '@brokenInServerless'] }, + { tags: ['@ess', '@serverless', '@skipInServerless'] }, () => { before(() => { cleanKibana(); diff --git a/x-pack/test/security_solution_cypress/cypress/e2e/exceptions/rule_details_flow/add_edit_endpoint_exception.cy.ts b/x-pack/test/security_solution_cypress/cypress/e2e/exceptions/rule_details_flow/add_edit_endpoint_exception.cy.ts index f3b84ebb98f7a..da62590d5dbb5 100644 --- a/x-pack/test/security_solution_cypress/cypress/e2e/exceptions/rule_details_flow/add_edit_endpoint_exception.cy.ts +++ b/x-pack/test/security_solution_cypress/cypress/e2e/exceptions/rule_details_flow/add_edit_endpoint_exception.cy.ts @@ -44,10 +44,11 @@ import { } from '../../../screens/exceptions'; import { createEndpointExceptionList } from '../../../tasks/api_calls/exceptions'; +// TODO: https://github.com/elastic/kibana/issues/161539 // FLAKY: https://github.com/elastic/kibana/issues/165736 describe( 'Add endpoint exception from rule details', - { tags: ['@ess', '@serverless', '@brokenInServerless'] }, + { tags: ['@ess', '@serverless', '@skipInServerless'] }, () => { const ITEM_NAME = 'Sample Exception List Item'; diff --git a/x-pack/test/security_solution_cypress/cypress/e2e/exceptions/rule_details_flow/add_edit_exception.cy.ts b/x-pack/test/security_solution_cypress/cypress/e2e/exceptions/rule_details_flow/add_edit_exception.cy.ts index 18537145ec582..f05e6f5eef4e5 100644 --- a/x-pack/test/security_solution_cypress/cypress/e2e/exceptions/rule_details_flow/add_edit_exception.cy.ts +++ b/x-pack/test/security_solution_cypress/cypress/e2e/exceptions/rule_details_flow/add_edit_exception.cy.ts @@ -59,277 +59,285 @@ import { } from '../../../tasks/api_calls/exceptions'; import { waitForAlertsToPopulate } from '../../../tasks/create_new_rule'; -describe('Add/edit exception from rule details', { tags: ['@ess', '@brokenInServerless'] }, () => { - const NUMBER_OF_AUDITBEAT_EXCEPTIONS_ALERTS = '1 alert'; - const FIELD_DIFFERENT_FROM_EXISTING_ITEM_FIELD = 'agent.name'; - const ITEM_FIELD = 'unique_value.test'; - - before(() => { - cy.task('esArchiverResetKibana'); - cy.task('esArchiverLoad', { archiveName: 'exceptions' }); - login(); - }); - - after(() => { - cy.task('esArchiverUnload', 'exceptions'); - }); - - describe('existing list and items', () => { - const exceptionList = getExceptionList(); - beforeEach(() => { - deleteAlertsAndRules(); - deleteExceptionList(exceptionList.list_id, exceptionList.namespace_type); - // create rule with exceptions - createExceptionList(exceptionList, exceptionList.list_id).then((response) => { - createRule( - getNewRule({ - query: 'agent.name:*', - index: ['exceptions*'], - exceptions_list: [ +// TODO: https://github.com/elastic/kibana/issues/161539 +describe( + 'Add/edit exception from rule details', + { tags: ['@ess', '@serverless', '@brokenInServerless'] }, + () => { + const NUMBER_OF_AUDITBEAT_EXCEPTIONS_ALERTS = '1 alert'; + const FIELD_DIFFERENT_FROM_EXISTING_ITEM_FIELD = 'agent.name'; + const ITEM_FIELD = 'unique_value.test'; + + before(() => { + cy.task('esArchiverResetKibana'); + cy.task('esArchiverLoad', { archiveName: 'exceptions' }); + login(); + }); + + after(() => { + cy.task('esArchiverUnload', 'exceptions'); + }); + + describe('existing list and items', () => { + const exceptionList = getExceptionList(); + beforeEach(() => { + deleteAlertsAndRules(); + deleteExceptionList(exceptionList.list_id, exceptionList.namespace_type); + // create rule with exceptions + createExceptionList(exceptionList, exceptionList.list_id).then((response) => { + createRule( + getNewRule({ + query: 'agent.name:*', + index: ['exceptions*'], + exceptions_list: [ + { + id: response.body.id, + list_id: exceptionList.list_id, + type: exceptionList.type, + namespace_type: exceptionList.namespace_type, + }, + ], + rule_id: '2', + }) + ); + createExceptionListItem(exceptionList.list_id, { + list_id: exceptionList.list_id, + item_id: 'simple_list_item', + tags: [], + type: 'simple', + description: 'Test exception item 2', + name: 'Sample Exception List Item 2', + namespace_type: 'single', + entries: [ { - id: response.body.id, - list_id: exceptionList.list_id, - type: exceptionList.type, - namespace_type: exceptionList.namespace_type, + field: ITEM_FIELD, + operator: 'included', + type: 'match_any', + value: ['foo'], }, ], - rule_id: '2', - }) - ); - createExceptionListItem(exceptionList.list_id, { - list_id: exceptionList.list_id, - item_id: 'simple_list_item', - tags: [], - type: 'simple', - description: 'Test exception item 2', - name: 'Sample Exception List Item 2', - namespace_type: 'single', - entries: [ - { - field: ITEM_FIELD, - operator: 'included', - type: 'match_any', - value: ['foo'], - }, - ], + }); }); - }); - login(); - visitWithoutDateRange(DETECTIONS_RULE_MANAGEMENT_URL); - goToRuleDetails(); - goToExceptionsTab(); - }); + login(); + visitWithoutDateRange(DETECTIONS_RULE_MANAGEMENT_URL); + goToRuleDetails(); + goToExceptionsTab(); + }); - it('Edits an exception item', () => { - const NEW_ITEM_NAME = 'Exception item-EDITED'; - const ITEM_NAME = 'Sample Exception List Item 2'; + it('Edits an exception item', () => { + const NEW_ITEM_NAME = 'Exception item-EDITED'; + const ITEM_NAME = 'Sample Exception List Item 2'; - // displays existing exception items - cy.get(EXCEPTION_ITEM_VIEWER_CONTAINER).should('have.length', 1); - cy.get(NO_EXCEPTIONS_EXIST_PROMPT).should('not.exist'); - cy.get(EXCEPTION_CARD_ITEM_NAME).should('have.text', ITEM_NAME); - cy.get(EXCEPTION_CARD_ITEM_CONDITIONS).should('have.text', ' unique_value.testis one of foo'); + // displays existing exception items + cy.get(EXCEPTION_ITEM_VIEWER_CONTAINER).should('have.length', 1); + cy.get(NO_EXCEPTIONS_EXIST_PROMPT).should('not.exist'); + cy.get(EXCEPTION_CARD_ITEM_NAME).should('have.text', ITEM_NAME); + cy.get(EXCEPTION_CARD_ITEM_CONDITIONS).should( + 'have.text', + ' unique_value.testis one of foo' + ); - // open edit exception modal - openEditException(); + // open edit exception modal + openEditException(); - // edit exception item name - editExceptionFlyoutItemName(NEW_ITEM_NAME); + // edit exception item name + editExceptionFlyoutItemName(NEW_ITEM_NAME); - // check that the existing item's field is being populated - cy.get(EXCEPTION_ITEM_CONTAINER) - .eq(0) - .find(FIELD_INPUT_PARENT) - .eq(0) - .should('have.text', ITEM_FIELD); - cy.get(VALUES_MATCH_ANY_INPUT).should('have.text', 'foo'); + // check that the existing item's field is being populated + cy.get(EXCEPTION_ITEM_CONTAINER) + .eq(0) + .find(FIELD_INPUT_PARENT) + .eq(0) + .should('have.text', ITEM_FIELD); + cy.get(VALUES_MATCH_ANY_INPUT).should('have.text', 'foo'); - // edit conditions - editException(FIELD_DIFFERENT_FROM_EXISTING_ITEM_FIELD, 0, 0); + // edit conditions + editException(FIELD_DIFFERENT_FROM_EXISTING_ITEM_FIELD, 0, 0); - // submit - submitEditedExceptionItem(); + // submit + submitEditedExceptionItem(); - // new exception item displays - cy.get(EXCEPTION_ITEM_VIEWER_CONTAINER).should('have.length', 1); + // new exception item displays + cy.get(EXCEPTION_ITEM_VIEWER_CONTAINER).should('have.length', 1); - // check that updates stuck - cy.get(EXCEPTION_CARD_ITEM_NAME).should('have.text', NEW_ITEM_NAME); - cy.get(EXCEPTION_CARD_ITEM_CONDITIONS).should('have.text', ' agent.nameIS foo'); - }); + // check that updates stuck + cy.get(EXCEPTION_CARD_ITEM_NAME).should('have.text', NEW_ITEM_NAME); + cy.get(EXCEPTION_CARD_ITEM_CONDITIONS).should('have.text', ' agent.nameIS foo'); + }); - describe('rule with existing shared exceptions', () => { - it('Creates an exception item to add to shared list', () => { - // displays existing exception items - cy.get(EXCEPTION_ITEM_VIEWER_CONTAINER).should('have.length', 1); - cy.get(NO_EXCEPTIONS_EXIST_PROMPT).should('not.exist'); + describe('rule with existing shared exceptions', () => { + it('Creates an exception item to add to shared list', () => { + // displays existing exception items + cy.get(EXCEPTION_ITEM_VIEWER_CONTAINER).should('have.length', 1); + cy.get(NO_EXCEPTIONS_EXIST_PROMPT).should('not.exist'); - // open add exception modal - addExceptionFlyoutFromViewerHeader(); + // open add exception modal + addExceptionFlyoutFromViewerHeader(); - // add exception item conditions - addExceptionConditions(getException()); + // add exception item conditions + addExceptionConditions(getException()); - // Name is required so want to check that submit is still disabled - cy.get(CONFIRM_BTN).should('have.attr', 'disabled'); + // Name is required so want to check that submit is still disabled + cy.get(CONFIRM_BTN).should('have.attr', 'disabled'); - // add exception item name - addExceptionFlyoutItemName('My item name'); + // add exception item name + addExceptionFlyoutItemName('My item name'); - // select to add exception item to a shared list - selectSharedListToAddExceptionTo(1); + // select to add exception item to a shared list + selectSharedListToAddExceptionTo(1); - // not testing close alert functionality here, just ensuring that the options appear as expected - cy.get(CLOSE_ALERTS_CHECKBOX).should('exist'); - cy.get(CLOSE_ALERTS_CHECKBOX).should('not.have.attr', 'disabled'); + // not testing close alert functionality here, just ensuring that the options appear as expected + cy.get(CLOSE_ALERTS_CHECKBOX).should('exist'); + cy.get(CLOSE_ALERTS_CHECKBOX).should('not.have.attr', 'disabled'); - // submit - submitNewExceptionItem(); + // submit + submitNewExceptionItem(); - // new exception item displays - cy.get(EXCEPTION_ITEM_VIEWER_CONTAINER).should('have.length', 2); - }); + // new exception item displays + cy.get(EXCEPTION_ITEM_VIEWER_CONTAINER).should('have.length', 2); + }); - it('Creates an exception item to add to rule only', () => { - // displays existing exception items - cy.get(EXCEPTION_ITEM_VIEWER_CONTAINER).should('have.length', 1); - cy.get(NO_EXCEPTIONS_EXIST_PROMPT).should('not.exist'); + it('Creates an exception item to add to rule only', () => { + // displays existing exception items + cy.get(EXCEPTION_ITEM_VIEWER_CONTAINER).should('have.length', 1); + cy.get(NO_EXCEPTIONS_EXIST_PROMPT).should('not.exist'); - // open add exception modal - addExceptionFlyoutFromViewerHeader(); + // open add exception modal + addExceptionFlyoutFromViewerHeader(); - // add exception item conditions - addExceptionConditions(getException()); + // add exception item conditions + addExceptionConditions(getException()); - // Name is required so want to check that submit is still disabled - cy.get(CONFIRM_BTN).should('have.attr', 'disabled'); + // Name is required so want to check that submit is still disabled + cy.get(CONFIRM_BTN).should('have.attr', 'disabled'); - // add exception item name - addExceptionFlyoutItemName('My item name'); + // add exception item name + addExceptionFlyoutItemName('My item name'); - // select to add exception item to rule only - selectAddToRuleRadio(); + // select to add exception item to rule only + selectAddToRuleRadio(); - // not testing close alert functionality here, just ensuring that the options appear as expected - cy.get(CLOSE_ALERTS_CHECKBOX).should('exist'); - cy.get(CLOSE_ALERTS_CHECKBOX).should('not.have.attr', 'disabled'); + // not testing close alert functionality here, just ensuring that the options appear as expected + cy.get(CLOSE_ALERTS_CHECKBOX).should('exist'); + cy.get(CLOSE_ALERTS_CHECKBOX).should('not.have.attr', 'disabled'); - // submit - submitNewExceptionItem(); + // submit + submitNewExceptionItem(); - // new exception item displays - cy.get(EXCEPTION_ITEM_VIEWER_CONTAINER).should('have.length', 2); - }); + // new exception item displays + cy.get(EXCEPTION_ITEM_VIEWER_CONTAINER).should('have.length', 2); + }); - // Trying to figure out with EUI why the search won't trigger - it('Can search for items', () => { - // displays existing exception items - cy.get(EXCEPTION_ITEM_VIEWER_CONTAINER).should('have.length', 1); - cy.get(NO_EXCEPTIONS_EXIST_PROMPT).should('not.exist'); + // Trying to figure out with EUI why the search won't trigger + it('Can search for items', () => { + // displays existing exception items + cy.get(EXCEPTION_ITEM_VIEWER_CONTAINER).should('have.length', 1); + cy.get(NO_EXCEPTIONS_EXIST_PROMPT).should('not.exist'); - // can search for an exception value - searchForExceptionItem('foo'); + // can search for an exception value + searchForExceptionItem('foo'); - // new exception item displays - cy.get(EXCEPTION_ITEM_VIEWER_CONTAINER).should('have.length', 1); + // new exception item displays + cy.get(EXCEPTION_ITEM_VIEWER_CONTAINER).should('have.length', 1); - // displays empty search result view if no matches found - searchForExceptionItem('abc'); + // displays empty search result view if no matches found + searchForExceptionItem('abc'); - // new exception item displays - cy.get(NO_EXCEPTIONS_SEARCH_RESULTS_PROMPT).should('exist'); + // new exception item displays + cy.get(NO_EXCEPTIONS_SEARCH_RESULTS_PROMPT).should('exist'); + }); }); }); - }); - - describe('rule without existing exceptions', () => { - beforeEach(() => { - deleteAlertsAndRules(); - createRule( - getNewRule({ - query: 'agent.name:*', - index: ['exceptions*'], - interval: '10s', - rule_id: 'rule_testing', - }) - ); - login(); - visitWithoutDateRange(DETECTIONS_RULE_MANAGEMENT_URL); - goToRuleDetails(); - goToExceptionsTab(); - }); - afterEach(() => { - cy.task('esArchiverUnload', 'exceptions_2'); - }); + describe('rule without existing exceptions', () => { + beforeEach(() => { + deleteAlertsAndRules(); + createRule( + getNewRule({ + query: 'agent.name:*', + index: ['exceptions*'], + interval: '10s', + rule_id: 'rule_testing', + }) + ); + login(); + visitWithoutDateRange(DETECTIONS_RULE_MANAGEMENT_URL); + goToRuleDetails(); + goToExceptionsTab(); + }); - it('Cannot create an item to add to rule but not shared list as rule has no lists attached', () => { - // when no exceptions exist, empty component shows with action to add exception - cy.get(NO_EXCEPTIONS_EXIST_PROMPT).should('exist'); + afterEach(() => { + cy.task('esArchiverUnload', 'exceptions_2'); + }); - // open add exception modal - openExceptionFlyoutFromEmptyViewerPrompt(); + it('Cannot create an item to add to rule but not shared list as rule has no lists attached', () => { + // when no exceptions exist, empty component shows with action to add exception + cy.get(NO_EXCEPTIONS_EXIST_PROMPT).should('exist'); - // add exception item conditions - addExceptionConditions({ - field: 'agent.name', - operator: 'is', - values: ['foo'], - }); + // open add exception modal + openExceptionFlyoutFromEmptyViewerPrompt(); + + // add exception item conditions + addExceptionConditions({ + field: 'agent.name', + operator: 'is', + values: ['foo'], + }); - // Name is required so want to check that submit is still disabled - cy.get(CONFIRM_BTN).should('have.attr', 'disabled'); + // Name is required so want to check that submit is still disabled + cy.get(CONFIRM_BTN).should('have.attr', 'disabled'); - // add exception item name - addExceptionFlyoutItemName('My item name'); + // add exception item name + addExceptionFlyoutItemName('My item name'); - // select to add exception item to rule only - selectAddToRuleRadio(); + // select to add exception item to rule only + selectAddToRuleRadio(); - // Check that add to shared list is disabled, should be unless - // rule has shared lists attached to it already - cy.get(ADD_TO_SHARED_LIST_RADIO_INPUT).should('have.attr', 'disabled'); + // Check that add to shared list is disabled, should be unless + // rule has shared lists attached to it already + cy.get(ADD_TO_SHARED_LIST_RADIO_INPUT).should('have.attr', 'disabled'); - // Close matching alerts - selectBulkCloseAlerts(); + // Close matching alerts + selectBulkCloseAlerts(); - // submit - submitNewExceptionItem(); + // submit + submitNewExceptionItem(); - // new exception item displays - cy.get(EXCEPTION_ITEM_VIEWER_CONTAINER).should('have.length', 1); + // new exception item displays + cy.get(EXCEPTION_ITEM_VIEWER_CONTAINER).should('have.length', 1); - // Alerts table should now be empty from having added exception and closed - // matching alert - goToAlertsTab(); - cy.get(EMPTY_ALERT_TABLE).should('exist'); + // Alerts table should now be empty from having added exception and closed + // matching alert + goToAlertsTab(); + cy.get(EMPTY_ALERT_TABLE).should('exist'); - // Closed alert should appear in table - goToClosedAlertsOnRuleDetailsPage(); - cy.get(ALERTS_COUNT).should('exist'); - cy.get(ALERTS_COUNT).should('have.text', `${NUMBER_OF_AUDITBEAT_EXCEPTIONS_ALERTS}`); + // Closed alert should appear in table + goToClosedAlertsOnRuleDetailsPage(); + cy.get(ALERTS_COUNT).should('exist'); + cy.get(ALERTS_COUNT).should('have.text', `${NUMBER_OF_AUDITBEAT_EXCEPTIONS_ALERTS}`); - // Remove the exception and load an event that would have matched that exception - // to show that said exception now starts to show up again - goToExceptionsTab(); + // Remove the exception and load an event that would have matched that exception + // to show that said exception now starts to show up again + goToExceptionsTab(); - // when removing exception and again, no more exist, empty screen shows again - removeException(); - cy.get(NO_EXCEPTIONS_EXIST_PROMPT).should('exist'); + // when removing exception and again, no more exist, empty screen shows again + removeException(); + cy.get(NO_EXCEPTIONS_EXIST_PROMPT).should('exist'); - // load more docs - cy.task('esArchiverLoad', { archiveName: 'exceptions_2' }); + // load more docs + cy.task('esArchiverLoad', { archiveName: 'exceptions_2' }); - // now that there are no more exceptions, the docs should match and populate alerts - goToAlertsTab(); - waitForAlertsToPopulate(); - goToOpenedAlertsOnRuleDetailsPage(); - waitForTheRuleToBeExecuted(); - waitForAlertsToPopulate(); + // now that there are no more exceptions, the docs should match and populate alerts + goToAlertsTab(); + waitForAlertsToPopulate(); + goToOpenedAlertsOnRuleDetailsPage(); + waitForTheRuleToBeExecuted(); + waitForAlertsToPopulate(); - cy.get(ALERTS_COUNT).should('exist'); - cy.get(ALERTS_COUNT).should('have.text', '2 alerts'); + cy.get(ALERTS_COUNT).should('exist'); + cy.get(ALERTS_COUNT).should('have.text', '2 alerts'); + }); }); - }); -}); + } +); diff --git a/x-pack/test/security_solution_cypress/cypress/e2e/exceptions/rule_details_flow/add_edit_exception_data_view.cy.ts b/x-pack/test/security_solution_cypress/cypress/e2e/exceptions/rule_details_flow/add_edit_exception_data_view.cy.ts index 229cfce25b9fa..2bce4f5d14884 100644 --- a/x-pack/test/security_solution_cypress/cypress/e2e/exceptions/rule_details_flow/add_edit_exception_data_view.cy.ts +++ b/x-pack/test/security_solution_cypress/cypress/e2e/exceptions/rule_details_flow/add_edit_exception_data_view.cy.ts @@ -41,9 +41,10 @@ import { } from '../../../screens/exceptions'; import { waitForAlertsToPopulate } from '../../../tasks/create_new_rule'; +// TODO: https://github.com/elastic/kibana/issues/161539 describe( 'Add exception using data views from rule details', - { tags: ['@ess', '@brokenInServerless'] }, + { tags: ['@ess', '@serverless', '@brokenInServerless'] }, () => { const NUMBER_OF_AUDITBEAT_EXCEPTIONS_ALERTS = '1 alert'; const ITEM_NAME = 'Sample Exception List Item'; diff --git a/x-pack/test/security_solution_cypress/cypress/e2e/exceptions/rule_details_flow/read_only_view.cy.ts b/x-pack/test/security_solution_cypress/cypress/e2e/exceptions/rule_details_flow/read_only_view.cy.ts index 6ecb3c1e40602..e26494398c7fc 100644 --- a/x-pack/test/security_solution_cypress/cypress/e2e/exceptions/rule_details_flow/read_only_view.cy.ts +++ b/x-pack/test/security_solution_cypress/cypress/e2e/exceptions/rule_details_flow/read_only_view.cy.ts @@ -26,7 +26,8 @@ import { deleteExceptionList, } from '../../../tasks/api_calls/exceptions'; -describe('Exceptions viewer read only', { tags: '@ess' }, () => { +// TODO: https://github.com/elastic/kibana/issues/161539 Do we need this to run in Serverless? +describe('Exceptions viewer read only', { tags: ['@ess', '@skipInServerless'] }, () => { const exceptionList = getExceptionList(); beforeEach(() => { diff --git a/x-pack/test/security_solution_cypress/cypress/e2e/exceptions/shared_exception_lists_management/list_detail_page/list_details.cy.ts b/x-pack/test/security_solution_cypress/cypress/e2e/exceptions/shared_exception_lists_management/list_detail_page/list_details.cy.ts index 74c47b853d95c..2c5ccd93f3cab 100644 --- a/x-pack/test/security_solution_cypress/cypress/e2e/exceptions/shared_exception_lists_management/list_detail_page/list_details.cy.ts +++ b/x-pack/test/security_solution_cypress/cypress/e2e/exceptions/shared_exception_lists_management/list_detail_page/list_details.cy.ts @@ -40,10 +40,11 @@ const getExceptionList1 = () => ({ const EXCEPTION_LIST_NAME = 'Newly created list'; +// TODO: https://github.com/elastic/kibana/issues/161539 // FLAKY: https://github.com/elastic/kibana/issues/165640 describe( 'Exception list detail page', - { tags: ['@ess', '@serverless', '@brokenInServerless'] }, + { tags: ['@ess', '@serverless', '@skipInServerless'] }, () => { before(() => { cy.task('esArchiverResetKibana'); diff --git a/x-pack/test/security_solution_cypress/cypress/e2e/exceptions/shared_exception_lists_management/manage_exceptions.cy.ts b/x-pack/test/security_solution_cypress/cypress/e2e/exceptions/shared_exception_lists_management/manage_exceptions.cy.ts index 20baf9de25e10..2ae959bdd563a 100644 --- a/x-pack/test/security_solution_cypress/cypress/e2e/exceptions/shared_exception_lists_management/manage_exceptions.cy.ts +++ b/x-pack/test/security_solution_cypress/cypress/e2e/exceptions/shared_exception_lists_management/manage_exceptions.cy.ts @@ -38,10 +38,11 @@ import { waitForExceptionsTableToBeLoaded, } from '../../../tasks/exceptions_table'; +// TODO: https://github.com/elastic/kibana/issues/161539 // FLAKY: https://github.com/elastic/kibana/issues/165795 describe( 'Add, edit and delete exception', - { tags: ['@ess', '@serverless', '@brokenInServerless'] }, + { tags: ['@ess', '@serverless', '@skipInServerless'] }, () => { before(() => { cy.task('esArchiverResetKibana'); @@ -64,90 +65,95 @@ describe( const FIELD_DIFFERENT_FROM_EXISTING_ITEM_FIELD = 'agent.name'; const EXCEPTION_LIST_NAME = 'Newly created list'; - describe('Add, Edit and delete Exception item', { tags: ['@ess', '@serverless'] }, () => { - it('should create exception item from Shared Exception List page and linked to a Rule', () => { - // Click on "Create shared exception list" button on the header - // Click on "Create exception item" - addExceptionListFromSharedExceptionListHeaderMenu(); + // TODO: https://github.com/elastic/kibana/issues/161539 + describe( + 'Add, Edit and delete Exception item', + { tags: ['@ess', '@serverless', '@skipInServerless'] }, + () => { + it('should create exception item from Shared Exception List page and linked to a Rule', () => { + // Click on "Create shared exception list" button on the header + // Click on "Create exception item" + addExceptionListFromSharedExceptionListHeaderMenu(); - // Add exception item name - addExceptionFlyoutItemName(exceptionName); + // Add exception item name + addExceptionFlyoutItemName(exceptionName); - // Add Condition - editException(FIELD_DIFFERENT_FROM_EXISTING_ITEM_FIELD, 0, 0); + // Add Condition + editException(FIELD_DIFFERENT_FROM_EXISTING_ITEM_FIELD, 0, 0); - // Confirm button should disabled until a rule(s) is selected - cy.get(CONFIRM_BTN).should('have.attr', 'disabled'); + // Confirm button should disabled until a rule(s) is selected + cy.get(CONFIRM_BTN).should('have.attr', 'disabled'); - // select rule - linkFirstRuleOnExceptionFlyout(); + // select rule + linkFirstRuleOnExceptionFlyout(); - // should be able to submit - cy.get(CONFIRM_BTN).should('not.have.attr', 'disabled'); + // should be able to submit + cy.get(CONFIRM_BTN).should('not.have.attr', 'disabled'); - submitNewExceptionItem(); + submitNewExceptionItem(); - // Navigate to Rule page - visitWithoutDateRange(DETECTIONS_RULE_MANAGEMENT_URL); - goToRuleDetails(); + // Navigate to Rule page + visitWithoutDateRange(DETECTIONS_RULE_MANAGEMENT_URL); + goToRuleDetails(); - goToExceptionsTab(); + goToExceptionsTab(); - // Only one Exception should generated - cy.get(EXCEPTION_ITEM_VIEWER_CONTAINER).should('have.length', 1); + // Only one Exception should generated + cy.get(EXCEPTION_ITEM_VIEWER_CONTAINER).should('have.length', 1); - // validate the And operator is displayed correctly - cy.get(EXCEPTION_CARD_ITEM_NAME).should('have.text', exceptionName); - }); + // validate the And operator is displayed correctly + cy.get(EXCEPTION_CARD_ITEM_NAME).should('have.text', exceptionName); + }); - it('should create exception item from Shared Exception List page, linked to a Shared List and validate Edit/delete in list detail page', function () { - createSharedExceptionList( - { name: 'Newly created list', description: 'This is my list.' }, - true - ); + it('should create exception item from Shared Exception List page, linked to a Shared List and validate Edit/delete in list detail page', function () { + createSharedExceptionList( + { name: 'Newly created list', description: 'This is my list.' }, + true + ); - // After creation - directed to list detail page - cy.get(EXCEPTIONS_LIST_MANAGEMENT_NAME).should('have.text', EXCEPTION_LIST_NAME); + // After creation - directed to list detail page + cy.get(EXCEPTIONS_LIST_MANAGEMENT_NAME).should('have.text', EXCEPTION_LIST_NAME); - // Go back to Shared Exception List - visitWithoutDateRange(EXCEPTIONS_URL); + // Go back to Shared Exception List + visitWithoutDateRange(EXCEPTIONS_URL); - // Click on "Create shared exception list" button on the header - // Click on "Create exception item" - addExceptionListFromSharedExceptionListHeaderMenu(); + // Click on "Create shared exception list" button on the header + // Click on "Create exception item" + addExceptionListFromSharedExceptionListHeaderMenu(); - // Add exception item name - addExceptionFlyoutItemName(exceptionName); + // Add exception item name + addExceptionFlyoutItemName(exceptionName); - // Add Condition - editException(FIELD_DIFFERENT_FROM_EXISTING_ITEM_FIELD, 0, 0); + // Add Condition + editException(FIELD_DIFFERENT_FROM_EXISTING_ITEM_FIELD, 0, 0); - // select shared list radio option and select the first one - linkFirstSharedListOnExceptionFlyout(); + // select shared list radio option and select the first one + linkFirstSharedListOnExceptionFlyout(); - submitNewExceptionItem(); + submitNewExceptionItem(); - // New exception is added to the new List - findSharedExceptionListItemsByName(`${EXCEPTION_LIST_NAME}`, [exceptionName]); + // New exception is added to the new List + findSharedExceptionListItemsByName(`${EXCEPTION_LIST_NAME}`, [exceptionName]); - // Click on the first exception overflow menu items - // Open the edit modal - editFirstExceptionItemInListDetailPage(); - // edit exception item name - editExceptionFlyoutItemName(exceptionNameEdited); + // Click on the first exception overflow menu items + // Open the edit modal + editFirstExceptionItemInListDetailPage(); + // edit exception item name + editExceptionFlyoutItemName(exceptionNameEdited); - // submit - submitEditedExceptionItem(); + // submit + submitEditedExceptionItem(); - // check the new name after edit - cy.get(EXECPTION_ITEM_CARD_HEADER_TITLE).should('have.text', exceptionNameEdited); + // check the new name after edit + cy.get(EXECPTION_ITEM_CARD_HEADER_TITLE).should('have.text', exceptionNameEdited); - // Click on the first exception overflow menu items - // delete the exception - deleteFirstExceptionItemInListDetailPage(); + // Click on the first exception overflow menu items + // delete the exception + deleteFirstExceptionItemInListDetailPage(); - cy.get(EMPTY_EXCEPTIONS_VIEWER).should('exist'); - }); - }); + cy.get(EMPTY_EXCEPTIONS_VIEWER).should('exist'); + }); + } + ); } ); diff --git a/x-pack/test/security_solution_cypress/cypress/e2e/exceptions/shared_exception_lists_management/shared_exception_list_page/duplicate_lists.cy.ts b/x-pack/test/security_solution_cypress/cypress/e2e/exceptions/shared_exception_lists_management/shared_exception_list_page/duplicate_lists.cy.ts index b296ff05e3b5b..f28b1fc2ed25a 100644 --- a/x-pack/test/security_solution_cypress/cypress/e2e/exceptions/shared_exception_lists_management/shared_exception_list_page/duplicate_lists.cy.ts +++ b/x-pack/test/security_solution_cypress/cypress/e2e/exceptions/shared_exception_lists_management/shared_exception_list_page/duplicate_lists.cy.ts @@ -40,8 +40,9 @@ const getExceptionList2 = () => ({ list_id: 'exception_list_2', }); +// TODO: https://github.com/elastic/kibana/issues/161539 // Flaky in serverless tests -describe('Duplicate List', { tags: ['@ess', '@serverless', '@brokenInServerless'] }, () => { +describe('Duplicate List', { tags: ['@ess', '@serverless', '@skipInServerless'] }, () => { beforeEach(() => { cy.task('esArchiverResetKibana'); login(); diff --git a/x-pack/test/security_solution_cypress/cypress/e2e/exceptions/shared_exception_lists_management/shared_exception_list_page/filter_table.cy.ts b/x-pack/test/security_solution_cypress/cypress/e2e/exceptions/shared_exception_lists_management/shared_exception_list_page/filter_table.cy.ts index 8fc3acdb2c7ec..6f8411c2d5ada 100644 --- a/x-pack/test/security_solution_cypress/cypress/e2e/exceptions/shared_exception_lists_management/shared_exception_list_page/filter_table.cy.ts +++ b/x-pack/test/security_solution_cypress/cypress/e2e/exceptions/shared_exception_lists_management/shared_exception_list_page/filter_table.cy.ts @@ -35,7 +35,9 @@ const getExceptionList2 = () => ({ name: EXCEPTION_LIST_NAME_TWO, list_id: 'exception_list_2', }); -describe('Filter Lists', { tags: ['@ess', '@serverless'] }, () => { + +// TODO: https://github.com/elastic/kibana/issues/161539 +describe('Filter Lists', { tags: ['@ess', '@serverless', '@skipInServerless'] }, () => { beforeEach(() => { cy.task('esArchiverResetKibana'); login(); diff --git a/x-pack/test/security_solution_cypress/cypress/e2e/exceptions/shared_exception_lists_management/shared_exception_list_page/import_lists.cy.ts b/x-pack/test/security_solution_cypress/cypress/e2e/exceptions/shared_exception_lists_management/shared_exception_list_page/import_lists.cy.ts index ac10e916d762f..7d24c9009e31d 100644 --- a/x-pack/test/security_solution_cypress/cypress/e2e/exceptions/shared_exception_lists_management/shared_exception_list_page/import_lists.cy.ts +++ b/x-pack/test/security_solution_cypress/cypress/e2e/exceptions/shared_exception_lists_management/shared_exception_list_page/import_lists.cy.ts @@ -20,8 +20,9 @@ import { import { login, visitWithoutDateRange } from '../../../../tasks/login'; import { EXCEPTIONS_URL } from '../../../../urls/navigation'; +// TODO: https://github.com/elastic/kibana/issues/161539 // Flaky in serverless -describe('Import Lists', { tags: ['@ess', '@serverless', '@brokenInServerless'] }, () => { +describe('Import Lists', { tags: ['@ess', '@serverless', '@skipInServerless'] }, () => { const LIST_TO_IMPORT_FILENAME = 'cypress/fixtures/7_16_exception_list.ndjson'; before(() => { cy.task('esArchiverResetKibana'); diff --git a/x-pack/test/security_solution_cypress/cypress/e2e/exceptions/shared_exception_lists_management/shared_exception_list_page/manage_lists.cy.ts b/x-pack/test/security_solution_cypress/cypress/e2e/exceptions/shared_exception_lists_management/shared_exception_list_page/manage_lists.cy.ts index 9f2b655fdfbb4..b740eb5d9d63e 100644 --- a/x-pack/test/security_solution_cypress/cypress/e2e/exceptions/shared_exception_lists_management/shared_exception_list_page/manage_lists.cy.ts +++ b/x-pack/test/security_solution_cypress/cypress/e2e/exceptions/shared_exception_lists_management/shared_exception_list_page/manage_lists.cy.ts @@ -47,10 +47,11 @@ const getExceptionList2 = () => ({ let exceptionListResponse: Cypress.Response; +// TODO: https://github.com/elastic/kibana/issues/161539 // FLAKY: https://github.com/elastic/kibana/issues/165690 describe( 'Manage lists from "Shared Exception Lists" page', - { tags: ['@ess', '@serverless', '@brokenInServerless'] }, + { tags: ['@ess', '@serverless', '@skipInServerless'] }, () => { describe('Create/Export/Delete List', () => { before(() => { diff --git a/x-pack/test/security_solution_cypress/cypress/e2e/exceptions/shared_exception_lists_management/shared_exception_list_page/read_only.cy.ts b/x-pack/test/security_solution_cypress/cypress/e2e/exceptions/shared_exception_lists_management/shared_exception_list_page/read_only.cy.ts index c6ac43547fadb..d028f5a3949c1 100644 --- a/x-pack/test/security_solution_cypress/cypress/e2e/exceptions/shared_exception_lists_management/shared_exception_list_page/read_only.cy.ts +++ b/x-pack/test/security_solution_cypress/cypress/e2e/exceptions/shared_exception_lists_management/shared_exception_list_page/read_only.cy.ts @@ -21,7 +21,8 @@ import { import { login, visitWithoutDateRange } from '../../../../tasks/login'; import { EXCEPTIONS_URL } from '../../../../urls/navigation'; -describe('Shared exception lists - read only', { tags: '@ess' }, () => { +// TODO: https://github.com/elastic/kibana/issues/161539 Do we need to run it in Serverless? +describe('Shared exception lists - read only', { tags: ['@ess', '@skipInServerless'] }, () => { before(() => { cy.task('esArchiverResetKibana'); }); diff --git a/x-pack/test/security_solution_cypress/cypress/e2e/overview/cti_link_panel.cy.ts b/x-pack/test/security_solution_cypress/cypress/e2e/overview/cti_link_panel.cy.ts index fa99225543e89..6fed0acc748c0 100644 --- a/x-pack/test/security_solution_cypress/cypress/e2e/overview/cti_link_panel.cy.ts +++ b/x-pack/test/security_solution_cypress/cypress/e2e/overview/cti_link_panel.cy.ts @@ -15,8 +15,9 @@ import { import { login, visit } from '../../tasks/login'; import { OVERVIEW_URL } from '../../urls/navigation'; +// TODO: https://github.com/elastic/kibana/issues/161539 // FLAKY: https://github.com/elastic/kibana/issues/165709 -describe.skip('CTI Link Panel', { tags: ['@ess', '@serverless'] }, () => { +describe.skip('CTI Link Panel', { tags: ['@ess', '@serverless', '@skipInServerless'] }, () => { beforeEach(() => { login(); }); @@ -31,35 +32,40 @@ describe.skip('CTI Link Panel', { tags: ['@ess', '@serverless'] }, () => { .and('match', /app\/integrations\/browse\/threat_intel/); }); - describe('enabled threat intel module', { tags: ['@brokenInServerless'] }, () => { - before(() => { - // illegal_argument_exception: unknown setting [index.lifecycle.name] - cy.task('esArchiverLoad', { archiveName: 'threat_indicator' }); - }); + // TODO: https://github.com/elastic/kibana/issues/161539 + describe( + 'enabled threat intel module', + { tags: ['@ess', '@serverless', '@brokenInServerless'] }, + () => { + before(() => { + // illegal_argument_exception: unknown setting [index.lifecycle.name] + cy.task('esArchiverLoad', { archiveName: 'threat_indicator' }); + }); - beforeEach(() => { - login(); - }); + beforeEach(() => { + login(); + }); - after(() => { - cy.task('esArchiverUnload', 'threat_indicator'); - }); + after(() => { + cy.task('esArchiverUnload', 'threat_indicator'); + }); - it('renders disabled dashboard module as expected when there are no events in the selected time period', () => { - visit( - `${OVERVIEW_URL}?sourcerer=(timerange:(from:%272021-07-08T04:00:00.000Z%27,kind:absolute,to:%272021-07-09T03:59:59.999Z%27))` - ); - cy.get(`${OVERVIEW_CTI_LINKS}`).should('exist'); - cy.get(`${OVERVIEW_CTI_TOTAL_EVENT_COUNT}`).should('have.text', 'Showing: 0 indicators'); - }); + it('renders disabled dashboard module as expected when there are no events in the selected time period', () => { + visit( + `${OVERVIEW_URL}?sourcerer=(timerange:(from:%272021-07-08T04:00:00.000Z%27,kind:absolute,to:%272021-07-09T03:59:59.999Z%27))` + ); + cy.get(`${OVERVIEW_CTI_LINKS}`).should('exist'); + cy.get(`${OVERVIEW_CTI_TOTAL_EVENT_COUNT}`).should('have.text', 'Showing: 0 indicators'); + }); - it('renders dashboard module as expected when there are events in the selected time period', () => { - visit(OVERVIEW_URL); + it('renders dashboard module as expected when there are events in the selected time period', () => { + visit(OVERVIEW_URL); - cy.get(`${OVERVIEW_CTI_LINKS}`).should('exist'); - cy.get(OVERVIEW_CTI_LINKS).should('not.contain.text', 'Anomali'); - cy.get(OVERVIEW_CTI_LINKS).should('contain.text', 'AbuseCH malware'); - cy.get(`${OVERVIEW_CTI_TOTAL_EVENT_COUNT}`).should('have.text', 'Showing: 1 indicator'); - }); - }); + cy.get(`${OVERVIEW_CTI_LINKS}`).should('exist'); + cy.get(OVERVIEW_CTI_LINKS).should('not.contain.text', 'Anomali'); + cy.get(OVERVIEW_CTI_LINKS).should('contain.text', 'AbuseCH malware'); + cy.get(`${OVERVIEW_CTI_TOTAL_EVENT_COUNT}`).should('have.text', 'Showing: 1 indicator'); + }); + } + ); });