[Security Solution] Restructure Cypress tests under security_solution/cypress/e2e/detection_rules folder (#162373)

**Epic:** https://github.com/elastic/kibana/issues/153633
**Partially addresses:** https://github.com/elastic/kibana/issues/153645

## Summary

This PR builds upon https://github.com/elastic/kibana/pull/161900 and
moves tests located in the `e2e/detection_rules` folder into
`e2e/detection_response` and splits them into multiple sub-folders
according to the Detection Engine subdomains we have. It also updates
the CODEOWNERS file accordingly.

<img width="451" alt="Screenshot 2023-07-25 at 21 03 08"
src="fb6052c9-3c5d-4547-98f1-61f44b9f7187">

## Details

Specifically, changes in this PR include:

- The `e2e/detections_response` folder was renamed to
`e2e/detection_response`.
- The `e2e/detections_response/bulk_actions` folder became
`e2e/detection_response/rule_management/rule_actions/bulk_actions`.
- Cypress tests for rule types (which actually test rule creation for
different rule types) were moved to
`e2e/detection_response/rule_creation`.
- The CODEOWNERS file was updated.

Things not addressed in this PR:

- No ownership was assigned for `e2e/detection_response/rule_actions`.
Will need to figure this out with @yctercero.
- No restructuring was done for `security_solution/cypress/screens` and
`security_solution/cypress/tasks`. Will be done in follow-up PRs.
- No refactoring was done for the tests themselves. Some of this work is
also upcoming.

The full file structure of the `detection_response` tests looks like
this:

<img width="452" alt="Screenshot 2023-07-25 at 21 03 44"
src="2b89c6d2-9f2d-4cf6-914f-a71c3fa93595">
This commit is contained in:
Georgii Gorbachev 2023-07-25 22:31:04 +02:00 committed by GitHub
parent 8b42e0f79b
commit 4087316960
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
33 changed files with 380 additions and 341 deletions

18
.github/CODEOWNERS vendored
View file

@ -1114,17 +1114,19 @@ x-pack/plugins/cloud_integrations/cloud_full_story/server/config.ts @elastic/kib
/x-pack/plugins/stack_connectors/common/gen_ai @elastic/security-threat-hunting-explore
## Security Solution sub teams - Detection Rule Management
/x-pack/plugins/security_solution/common/api/detection_engine/model/rule_schema @elastic/security-detection-rule-management @elastic/security-detection-engine
/x-pack/plugins/security_solution/common/api/detection_engine/fleet_integrations @elastic/security-detection-rule-management
/x-pack/plugins/security_solution/common/api/detection_engine/prebuilt_rules @elastic/security-detection-rule-management
/x-pack/plugins/security_solution/common/api/detection_engine/rule_management @elastic/security-detection-rule-management
/x-pack/plugins/security_solution/common/api/detection_engine/rule_monitoring @elastic/security-detection-rule-management
/x-pack/plugins/security_solution/common/api/detection_engine/model/rule_schema @elastic/security-detection-rule-management @elastic/security-detection-engine
/x-pack/plugins/security_solution/common/detection_engine/fleet_integrations @elastic/security-detection-rule-management
/x-pack/plugins/security_solution/common/detection_engine/prebuilt_rules @elastic/security-detection-rule-management
/x-pack/plugins/security_solution/common/detection_engine/rule_management @elastic/security-detection-rule-management
/x-pack/plugins/security_solution/common/detection_engine/rule_monitoring @elastic/security-detection-rule-management
/x-pack/plugins/security_solution/cypress/e2e/detection_response/prebuilt_rules @elastic/security-detection-rule-management
/x-pack/plugins/security_solution/cypress/e2e/detection_response/rule_management @elastic/security-detection-rule-management
/x-pack/plugins/security_solution/docs/testing/test_plans/detection_response/prebuilt_rules @elastic/security-detection-rule-management
/x-pack/plugins/security_solution/docs/testing/test_plans/detection_response/rule_management @elastic/security-detection-rule-management
@ -1145,15 +1147,12 @@ x-pack/plugins/cloud_integrations/cloud_full_story/server/config.ts @elastic/kib
/x-pack/plugins/security_solution/public/detections/mitre @elastic/security-detection-rule-management
/x-pack/plugins/security_solution/public/detections/pages/detection_engine/rules @elastic/security-detection-rule-management
/x-pack/plugins/security_solution/public/rules @elastic/security-detection-rule-management
/x-pack/plugins/security_solution/public/entity_analytics @elastic/security-detection-engine
/x-pack/plugins/security_solution/server/lib/detection_engine/fleet_integrations @elastic/security-detection-rule-management
/x-pack/plugins/security_solution/server/lib/detection_engine/prebuilt_rules @elastic/security-detection-rule-management
/x-pack/plugins/security_solution/server/lib/detection_engine/rule_management @elastic/security-detection-rule-management
/x-pack/plugins/security_solution/server/lib/detection_engine/rule_monitoring @elastic/security-detection-rule-management
/x-pack/plugins/security_solution/server/lib/detection_engine/rule_schema @elastic/security-detection-rule-management @elastic/security-detection-engine
/x-pack/plugins/security_solution/server/utils @elastic/security-detection-rule-management
## Security Solution sub teams - Detection Engine
@ -1163,6 +1162,7 @@ x-pack/plugins/cloud_integrations/cloud_full_story/server/config.ts @elastic/kib
/x-pack/plugins/security_solution/public/detection_engine/rule_creation_ui @elastic/security-detection-engine
/x-pack/plugins/security_solution/public/detections/pages/alerts @elastic/security-detection-engine
/x-pack/plugins/security_solution/public/entity_analytics @elastic/security-detection-engine
/x-pack/plugins/security_solution/server/lib/detection_engine/migrations @elastic/security-detection-engine
/x-pack/plugins/security_solution/server/lib/detection_engine/rule_preview @elastic/security-detection-engine
@ -1171,9 +1171,11 @@ x-pack/plugins/cloud_integrations/cloud_full_story/server/config.ts @elastic/kib
/x-pack/plugins/security_solution/server/lib/detection_engine/routes/signals @elastic/security-detection-engine
/x-pack/plugins/security_solution/cypress/e2e/data_sources @elastic/security-detection-engine
/x-pack/plugins/security_solution/cypress/e2e/exceptions @elastic/security-detection-engine
/x-pack/plugins/security_solution/cypress/e2e/value_lists @elastic/security-detection-engine
/x-pack/plugins/security_solution/cypress/e2e/detection_response/rule_creation @elastic/security-detection-engine
/x-pack/plugins/security_solution/cypress/e2e/detection_response/value_lists @elastic/security-detection-engine
/x-pack/plugins/security_solution/cypress/e2e/entity_analytics @elastic/security-detection-engine
/x-pack/plugins/security_solution/cypress/e2e/exceptions @elastic/security-detection-engine
/x-pack/plugins/security_solution/cypress/e2e/overview @elastic/security-detection-engine
/x-pack/plugins/security_solution/common/detection_engine/rule_exceptions @elastic/security-detection-engine
@ -1187,8 +1189,6 @@ x-pack/plugins/cloud_integrations/cloud_full_story/server/config.ts @elastic/kib
/x-pack/plugins/security_solution/server/lib/detection_engine/rule_actions_legacy @elastic/security-detection-engine
/x-pack/plugins/security_solution/server/lib/detection_engine/rule_exceptions @elastic/security-detection-engine
/x-pack/plugins/security_solution/server/lib/sourcerer @elastic/security-detection-engine
/x-pack/plugins/security_solution/cypress/e2e/overview @elastic/security-detection-engine
## Security Threat Intelligence - Under Security Platform
/x-pack/plugins/security_solution/public/common/components/threat_match @elastic/security-detection-engine

View file

@ -5,14 +5,14 @@
* 2.0.
*/
import { APP_PATH, RULES_ADD_PATH, RULES_UPDATES } from '../../../common/constants';
import { createRuleAssetSavedObject } from '../../helpers/rules';
import { waitForRulesTableToBeLoaded } from '../../tasks/alerts_detection_rules';
import { createAndInstallMockedPrebuiltRules } from '../../tasks/api_calls/prebuilt_rules';
import { resetRulesTableState, deleteAlertsAndRules } from '../../tasks/common';
import { login, waitForPageWithoutDateRange } from '../../tasks/login';
import { SECURITY_DETECTIONS_RULES_URL } from '../../urls/navigation';
import { ROLES } from '../../../common/test';
import { APP_PATH, RULES_ADD_PATH, RULES_UPDATES } from '../../../../common/constants';
import { createRuleAssetSavedObject } from '../../../helpers/rules';
import { waitForRulesTableToBeLoaded } from '../../../tasks/alerts_detection_rules';
import { createAndInstallMockedPrebuiltRules } from '../../../tasks/api_calls/prebuilt_rules';
import { resetRulesTableState, deleteAlertsAndRules } from '../../../tasks/common';
import { login, waitForPageWithoutDateRange } from '../../../tasks/login';
import { SECURITY_DETECTIONS_RULES_URL } from '../../../urls/navigation';
import { ROLES } from '../../../../common/test';
import {
ADD_ELASTIC_RULES_BTN,
getInstallSingleRuleButtonByRuleId,
@ -21,7 +21,7 @@ import {
RULES_UPDATES_TAB,
RULE_CHECKBOX,
UPGRADE_ALL_RULES_BUTTON,
} from '../../screens/alerts_detection_rules';
} from '../../../screens/alerts_detection_rules';
const RULE_1_ID = 'rule_1';
const RULE_2_ID = 'rule_2';

View file

@ -5,12 +5,12 @@
* 2.0.
*/
import { createRuleAssetSavedObject } from '../../helpers/rules';
import { waitForRulesTableToBeLoaded } from '../../tasks/alerts_detection_rules';
import { createAndInstallMockedPrebuiltRules } from '../../tasks/api_calls/prebuilt_rules';
import { resetRulesTableState, deleteAlertsAndRules, reload } from '../../tasks/common';
import { login, visitWithoutDateRange } from '../../tasks/login';
import { SECURITY_DETECTIONS_RULES_URL } from '../../urls/navigation';
import { createRuleAssetSavedObject } from '../../../helpers/rules';
import { waitForRulesTableToBeLoaded } from '../../../tasks/alerts_detection_rules';
import { createAndInstallMockedPrebuiltRules } from '../../../tasks/api_calls/prebuilt_rules';
import { resetRulesTableState, deleteAlertsAndRules, reload } from '../../../tasks/common';
import { login, visitWithoutDateRange } from '../../../tasks/login';
import { SECURITY_DETECTIONS_RULES_URL } from '../../../urls/navigation';
import {
addElasticRulesButtonClick,
assertRuleAvailableForInstallAndInstallOne,
@ -22,7 +22,7 @@ import {
assertRuleUpgradeAvailableAndUpgradeAllInPage,
assertRuleUpgradeAvailableAndUpgradeAll,
ruleUpdatesTabClick,
} from '../../tasks/prebuilt_rules';
} from '../../../tasks/prebuilt_rules';
describe('Detection rules, Prebuilt Rules Installation and Update - Error handling', () => {
beforeEach(() => {

View file

@ -6,8 +6,8 @@
*/
import type { BulkInstallPackageInfo } from '@kbn/fleet-plugin/common';
import type { Rule } from '../../../public/detection_engine/rule_management/logic/types';
import { createRuleAssetSavedObject } from '../../helpers/rules';
import type { Rule } from '../../../../public/detection_engine/rule_management/logic/types';
import { createRuleAssetSavedObject } from '../../../helpers/rules';
import {
GO_BACK_TO_RULES_TABLE_BUTTON,
INSTALL_ALL_RULES_BUTTON,
@ -18,15 +18,15 @@ import {
RULE_CHECKBOX,
SELECT_ALL_RULES_ON_PAGE_CHECKBOX,
TOASTER,
} from '../../screens/alerts_detection_rules';
import { waitForRulesTableToBeLoaded } from '../../tasks/alerts_detection_rules';
} from '../../../screens/alerts_detection_rules';
import { waitForRulesTableToBeLoaded } from '../../../tasks/alerts_detection_rules';
import {
getRuleAssets,
createAndInstallMockedPrebuiltRules,
} from '../../tasks/api_calls/prebuilt_rules';
import { resetRulesTableState, deleteAlertsAndRules, reload } from '../../tasks/common';
import { login, visitWithoutDateRange } from '../../tasks/login';
import { SECURITY_DETECTIONS_RULES_URL } from '../../urls/navigation';
} from '../../../tasks/api_calls/prebuilt_rules';
import { resetRulesTableState, deleteAlertsAndRules, reload } from '../../../tasks/common';
import { login, visitWithoutDateRange } from '../../../tasks/login';
import { SECURITY_DETECTIONS_RULES_URL } from '../../../urls/navigation';
import {
addElasticRulesButtonClick,
assertRuleAvailableForInstallAndInstallOne,
@ -38,7 +38,7 @@ import {
assertRuleUpgradeAvailableAndUpgradeAllInPage,
assertRuleUpgradeAvailableAndUpgradeAll,
ruleUpdatesTabClick,
} from '../../tasks/prebuilt_rules';
} from '../../../tasks/prebuilt_rules';
describe('Detection rules, Prebuilt Rules Installation and Update workflow', () => {
beforeEach(() => {

View file

@ -5,7 +5,7 @@
* 2.0.
*/
import { createRuleAssetSavedObject } from '../../helpers/rules';
import { createRuleAssetSavedObject } from '../../../helpers/rules';
import {
COLLAPSED_ACTION_BTN,
ELASTIC_RULES_BTN,
@ -17,7 +17,7 @@ import {
RULE_SWITCH,
SELECT_ALL_RULES_ON_PAGE_CHECKBOX,
INSTALL_ALL_RULES_BUTTON,
} from '../../screens/alerts_detection_rules';
} from '../../../screens/alerts_detection_rules';
import {
confirmRulesDelete,
deleteFirstRule,
@ -25,19 +25,23 @@ import {
selectNumberOfRules,
waitForPrebuiltDetectionRulesToBeLoaded,
waitForRuleToUpdate,
} from '../../tasks/alerts_detection_rules';
} from '../../../tasks/alerts_detection_rules';
import {
deleteSelectedRules,
disableSelectedRules,
enableSelectedRules,
} from '../../tasks/rules_bulk_actions';
} from '../../../tasks/rules_bulk_actions';
import {
createAndInstallMockedPrebuiltRules,
getAvailablePrebuiltRulesCount,
} from '../../tasks/api_calls/prebuilt_rules';
import { cleanKibana, deleteAlertsAndRules, deletePrebuiltRulesAssets } from '../../tasks/common';
import { login, visitWithoutDateRange } from '../../tasks/login';
import { DETECTIONS_RULE_MANAGEMENT_URL } from '../../urls/navigation';
} from '../../../tasks/api_calls/prebuilt_rules';
import {
cleanKibana,
deleteAlertsAndRules,
deletePrebuiltRulesAssets,
} from '../../../tasks/common';
import { login, visitWithoutDateRange } from '../../../tasks/login';
import { DETECTIONS_RULE_MANAGEMENT_URL } from '../../../urls/navigation';
const rules = Array.from(Array(5)).map((_, i) => {
return createRuleAssetSavedObject({

View file

@ -5,21 +5,24 @@
* 2.0.
*/
import { createRuleAssetSavedObject } from '../../helpers/rules';
import { ADD_ELASTIC_RULES_BTN, RULES_UPDATES_TAB } from '../../screens/alerts_detection_rules';
import { deleteFirstRule, waitForRulesTableToBeLoaded } from '../../tasks/alerts_detection_rules';
import { createRuleAssetSavedObject } from '../../../helpers/rules';
import { ADD_ELASTIC_RULES_BTN, RULES_UPDATES_TAB } from '../../../screens/alerts_detection_rules';
import {
deleteFirstRule,
waitForRulesTableToBeLoaded,
} from '../../../tasks/alerts_detection_rules';
import {
installAllPrebuiltRulesRequest,
createAndInstallMockedPrebuiltRules,
} from '../../tasks/api_calls/prebuilt_rules';
} from '../../../tasks/api_calls/prebuilt_rules';
import {
resetRulesTableState,
deleteAlertsAndRules,
reload,
deletePrebuiltRulesAssets,
} from '../../tasks/common';
import { login, visitWithoutDateRange } from '../../tasks/login';
import { SECURITY_DETECTIONS_RULES_URL } from '../../urls/navigation';
} from '../../../tasks/common';
import { login, visitWithoutDateRange } from '../../../tasks/login';
import { SECURITY_DETECTIONS_RULES_URL } from '../../../urls/navigation';
const RULE_1 = createRuleAssetSavedObject({
name: 'Test rule 1',

View file

@ -5,27 +5,27 @@
* 2.0.
*/
import { getIndexConnector } from '../../objects/connector';
import { getSimpleCustomQueryRule } from '../../objects/rule';
import { getIndexConnector } from '../../../objects/connector';
import { getSimpleCustomQueryRule } from '../../../objects/rule';
import { goToRuleDetails } from '../../tasks/alerts_detection_rules';
import { deleteIndex, waitForNewDocumentToBeIndexed } from '../../tasks/api_calls/elasticsearch';
import { goToRuleDetails } from '../../../tasks/alerts_detection_rules';
import { deleteIndex, waitForNewDocumentToBeIndexed } from '../../../tasks/api_calls/elasticsearch';
import {
cleanKibana,
deleteAlertsAndRules,
deleteConnectors,
deleteDataView,
} from '../../tasks/common';
} from '../../../tasks/common';
import {
createAndEnableRule,
fillAboutRuleAndContinue,
fillDefineCustomRuleAndContinue,
fillRuleAction,
fillScheduleRuleAndContinue,
} from '../../tasks/create_new_rule';
import { login, visit } from '../../tasks/login';
} from '../../../tasks/create_new_rule';
import { login, visit } from '../../../tasks/login';
import { RULE_CREATION } from '../../urls/navigation';
import { RULE_CREATION } from '../../../urls/navigation';
describe('Rule actions during detection rule creation', () => {
const indexConnector = getIndexConnector();

View file

@ -5,10 +5,15 @@
* 2.0.
*/
import { ruleFields } from '../../data/detection_engine';
import { getNewRule, getExistingRule, getEditedRule, getNewOverrideRule } from '../../objects/rule';
import { getTimeline } from '../../objects/timeline';
import { ALERTS_COUNT, ALERT_GRID_CELL } from '../../screens/alerts';
import { ruleFields } from '../../../data/detection_engine';
import {
getNewRule,
getExistingRule,
getEditedRule,
getNewOverrideRule,
} from '../../../objects/rule';
import { getTimeline } from '../../../objects/timeline';
import { ALERTS_COUNT, ALERT_GRID_CELL } from '../../../screens/alerts';
import {
CUSTOM_RULES_BTN,
@ -18,11 +23,11 @@ import {
RULES_MANAGEMENT_TABLE,
RULE_SWITCH,
SEVERITY,
} from '../../screens/alerts_detection_rules';
} from '../../../screens/alerts_detection_rules';
import {
ACTIONS_NOTIFY_WHEN_BUTTON,
ACTIONS_SUMMARY_BUTTON,
} from '../../screens/common/rule_actions';
} from '../../../screens/common/rule_actions';
import {
ABOUT_CONTINUE_BTN,
ABOUT_EDIT_BUTTON,
@ -39,7 +44,7 @@ import {
SEVERITY_DROPDOWN,
TAGS_CLEAR_BUTTON,
TAGS_FIELD,
} from '../../screens/create_new_rule';
} from '../../../screens/create_new_rule';
import {
ADDITIONAL_LOOK_BACK_DETAILS,
ABOUT_DETAILS,
@ -64,7 +69,7 @@ import {
THREAT_TACTIC,
THREAT_TECHNIQUE,
THREAT_SUBTECHNIQUE,
} from '../../screens/rule_details';
} from '../../../screens/rule_details';
import {
deleteFirstRule,
@ -72,12 +77,12 @@ import {
editFirstRule,
goToRuleDetails,
selectNumberOfRules,
} from '../../tasks/alerts_detection_rules';
import { deleteSelectedRules } from '../../tasks/rules_bulk_actions';
import { createRule } from '../../tasks/api_calls/rules';
import { createTimeline } from '../../tasks/api_calls/timelines';
import { cleanKibana, deleteAlertsAndRules, deleteConnectors } from '../../tasks/common';
import { addEmailConnectorAndRuleAction } from '../../tasks/common/rule_actions';
} from '../../../tasks/alerts_detection_rules';
import { deleteSelectedRules } from '../../../tasks/rules_bulk_actions';
import { createRule } from '../../../tasks/api_calls/rules';
import { createTimeline } from '../../../tasks/api_calls/timelines';
import { cleanKibana, deleteAlertsAndRules, deleteConnectors } from '../../../tasks/common';
import { addEmailConnectorAndRuleAction } from '../../../tasks/common/rule_actions';
import {
createAndEnableRule,
expandAdvancedSettings,
@ -100,12 +105,12 @@ import {
importSavedQuery,
waitForAlertsToPopulate,
waitForTheRuleToBeExecuted,
} from '../../tasks/create_new_rule';
import { saveEditedRule } from '../../tasks/edit_rule';
import { login, visit } from '../../tasks/login';
import { enablesRule, getDetails } from '../../tasks/rule_details';
} from '../../../tasks/create_new_rule';
import { saveEditedRule } from '../../../tasks/edit_rule';
import { login, visit } from '../../../tasks/login';
import { enablesRule, getDetails } from '../../../tasks/rule_details';
import { RULE_CREATION, DETECTIONS_RULE_MANAGEMENT_URL } from '../../urls/navigation';
import { RULE_CREATION, DETECTIONS_RULE_MANAGEMENT_URL } from '../../../urls/navigation';
describe('Custom query rules', () => {
before(() => {

View file

@ -5,9 +5,9 @@
* 2.0.
*/
import { formatMitreAttackDescription, getHumanizedDuration } from '../../helpers/rules';
import { getDataViewRule } from '../../objects/rule';
import { ALERTS_COUNT, ALERT_GRID_CELL } from '../../screens/alerts';
import { formatMitreAttackDescription, getHumanizedDuration } from '../../../helpers/rules';
import { getDataViewRule } from '../../../objects/rule';
import { ALERTS_COUNT, ALERT_GRID_CELL } from '../../../screens/alerts';
import {
CUSTOM_RULES_BTN,
@ -17,12 +17,12 @@ import {
RULES_MANAGEMENT_TABLE,
RULE_SWITCH,
SEVERITY,
} from '../../screens/alerts_detection_rules';
} from '../../../screens/alerts_detection_rules';
import {
ABOUT_CONTINUE_BTN,
RULE_DESCRIPTION_INPUT,
RULE_NAME_INPUT,
} from '../../screens/create_new_rule';
} from '../../../screens/create_new_rule';
import {
ADDITIONAL_LOOK_BACK_DETAILS,
@ -48,10 +48,10 @@ import {
TIMELINE_TEMPLATE_DETAILS,
DATA_VIEW_DETAILS,
EDIT_RULE_SETTINGS_LINK,
} from '../../screens/rule_details';
} from '../../../screens/rule_details';
import { goToRuleDetails } from '../../tasks/alerts_detection_rules';
import { postDataView } from '../../tasks/common';
import { goToRuleDetails } from '../../../tasks/alerts_detection_rules';
import { postDataView } from '../../../tasks/common';
import {
createAndEnableRule,
createRuleWithoutEnabling,
@ -60,12 +60,12 @@ import {
fillScheduleRuleAndContinue,
waitForAlertsToPopulate,
waitForTheRuleToBeExecuted,
} from '../../tasks/create_new_rule';
} from '../../../tasks/create_new_rule';
import { login, visit } from '../../tasks/login';
import { getDetails } from '../../tasks/rule_details';
import { login, visit } from '../../../tasks/login';
import { getDetails } from '../../../tasks/rule_details';
import { RULE_CREATION } from '../../urls/navigation';
import { RULE_CREATION } from '../../../urls/navigation';
describe('Custom query rules', () => {
describe('Custom detection rules creation with data views', () => {

View file

@ -5,15 +5,15 @@
* 2.0.
*/
import { getNewRule, getSavedQueryRule } from '../../objects/rule';
import { getNewRule, getSavedQueryRule } from '../../../objects/rule';
import {
DEFINE_CONTINUE_BUTTON,
CUSTOM_QUERY_BAR,
LOAD_QUERY_DYNAMICALLY_CHECKBOX,
QUERY_BAR,
} from '../../screens/create_new_rule';
import { TOASTER } from '../../screens/alerts_detection_rules';
} from '../../../screens/create_new_rule';
import { TOASTER } from '../../../screens/alerts_detection_rules';
import {
RULE_NAME_HEADER,
SAVED_QUERY_NAME_DETAILS,
@ -21,11 +21,11 @@ import {
SAVED_QUERY_FILTERS_DETAILS,
DEFINE_RULE_PANEL_PROGRESS,
CUSTOM_QUERY_DETAILS,
} from '../../screens/rule_details';
} from '../../../screens/rule_details';
import { goToRuleDetails, editFirstRule } from '../../tasks/alerts_detection_rules';
import { createSavedQuery, deleteSavedQueries } from '../../tasks/api_calls/saved_queries';
import { cleanKibana, deleteAlertsAndRules } from '../../tasks/common';
import { goToRuleDetails, editFirstRule } from '../../../tasks/alerts_detection_rules';
import { createSavedQuery, deleteSavedQueries } from '../../../tasks/api_calls/saved_queries';
import { cleanKibana, deleteAlertsAndRules } from '../../../tasks/common';
import {
createAndEnableRule,
fillAboutRuleAndContinue,
@ -34,13 +34,13 @@ import {
getCustomQueryInput,
checkLoadQueryDynamically,
uncheckLoadQueryDynamically,
} from '../../tasks/create_new_rule';
import { saveEditedRule } from '../../tasks/edit_rule';
import { login, visit } from '../../tasks/login';
import { getDetails } from '../../tasks/rule_details';
import { createRule } from '../../tasks/api_calls/rules';
} from '../../../tasks/create_new_rule';
import { saveEditedRule } from '../../../tasks/edit_rule';
import { login, visit } from '../../../tasks/login';
import { getDetails } from '../../../tasks/rule_details';
import { createRule } from '../../../tasks/api_calls/rules';
import { RULE_CREATION, SECURITY_DETECTIONS_RULES_URL } from '../../urls/navigation';
import { RULE_CREATION, SECURITY_DETECTIONS_RULES_URL } from '../../../urls/navigation';
const savedQueryName = 'custom saved query';
const savedQueryQuery = 'process.name: test';

View file

@ -5,10 +5,10 @@
* 2.0.
*/
import { formatMitreAttackDescription, getHumanizedDuration } from '../../helpers/rules';
import { getEqlRule, getEqlSequenceRule, getIndexPatterns } from '../../objects/rule';
import { formatMitreAttackDescription, getHumanizedDuration } from '../../../helpers/rules';
import { getEqlRule, getEqlSequenceRule, getIndexPatterns } from '../../../objects/rule';
import { ALERTS_COUNT, ALERT_DATA_GRID } from '../../screens/alerts';
import { ALERTS_COUNT, ALERT_DATA_GRID } from '../../../screens/alerts';
import {
CUSTOM_RULES_BTN,
RISK_SCORE,
@ -16,7 +16,7 @@ import {
RULE_NAME,
RULE_SWITCH,
SEVERITY,
} from '../../screens/alerts_detection_rules';
} from '../../../screens/alerts_detection_rules';
import {
ABOUT_DETAILS,
ABOUT_INVESTIGATION_NOTES,
@ -39,15 +39,15 @@ import {
SEVERITY_DETAILS,
TAGS_DETAILS,
TIMELINE_TEMPLATE_DETAILS,
} from '../../screens/rule_details';
} from '../../../screens/rule_details';
import { getDetails } from '../../tasks/rule_details';
import { getDetails } from '../../../tasks/rule_details';
import {
expectNumberOfRules,
goToRuleDetails,
goToTheRuleDetailsOf,
} from '../../tasks/alerts_detection_rules';
import { cleanKibana, deleteAlertsAndRules } from '../../tasks/common';
} from '../../../tasks/alerts_detection_rules';
import { cleanKibana, deleteAlertsAndRules } from '../../../tasks/common';
import {
createAndEnableRule,
fillAboutRuleAndContinue,
@ -56,10 +56,10 @@ import {
selectEqlRuleType,
waitForAlertsToPopulate,
waitForTheRuleToBeExecuted,
} from '../../tasks/create_new_rule';
import { login, visit } from '../../tasks/login';
} from '../../../tasks/create_new_rule';
import { login, visit } from '../../../tasks/login';
import { RULE_CREATION } from '../../urls/navigation';
import { RULE_CREATION } from '../../../urls/navigation';
describe('EQL rules', () => {
before(() => {

View file

@ -5,20 +5,20 @@
* 2.0.
*/
import { formatMitreAttackDescription, getHumanizedDuration } from '../../helpers/rules';
import { formatMitreAttackDescription, getHumanizedDuration } from '../../../helpers/rules';
import {
getIndexPatterns,
getNewThreatIndicatorRule,
getThreatIndexPatterns,
indicatorRuleMatchingDoc,
} from '../../objects/rule';
} from '../../../objects/rule';
import {
ALERT_RULE_NAME,
ALERT_RISK_SCORE,
ALERT_SEVERITY,
ALERTS_COUNT,
} from '../../screens/alerts';
} from '../../../screens/alerts';
import {
CUSTOM_RULES_BTN,
RISK_SCORE,
@ -26,7 +26,7 @@ import {
RULE_NAME,
RULE_SWITCH,
SEVERITY,
} from '../../screens/alerts_detection_rules';
} from '../../../screens/alerts_detection_rules';
import {
ABOUT_DETAILS,
ABOUT_INVESTIGATION_NOTES,
@ -53,9 +53,9 @@ import {
SEVERITY_DETAILS,
TAGS_DETAILS,
TIMELINE_TEMPLATE_DETAILS,
} from '../../screens/rule_details';
import { INDICATOR_MATCH_ROW_RENDER, PROVIDER_BADGE } from '../../screens/timeline';
import { investigateFirstAlertInTimeline } from '../../tasks/alerts';
} from '../../../screens/rule_details';
import { INDICATOR_MATCH_ROW_RENDER, PROVIDER_BADGE } from '../../../screens/timeline';
import { investigateFirstAlertInTimeline } from '../../../tasks/alerts';
import {
duplicateFirstRule,
duplicateRuleFromMenu,
@ -63,11 +63,11 @@ import {
selectNumberOfRules,
checkDuplicatedRule,
expectNumberOfRules,
} from '../../tasks/alerts_detection_rules';
import { duplicateSelectedRulesWithExceptions } from '../../tasks/rules_bulk_actions';
import { createRule } from '../../tasks/api_calls/rules';
import { loadPrepackagedTimelineTemplates } from '../../tasks/api_calls/timelines';
import { cleanKibana, deleteAlertsAndRules } from '../../tasks/common';
} from '../../../tasks/alerts_detection_rules';
import { duplicateSelectedRulesWithExceptions } from '../../../tasks/rules_bulk_actions';
import { createRule } from '../../../tasks/api_calls/rules';
import { loadPrepackagedTimelineTemplates } from '../../../tasks/api_calls/timelines';
import { cleanKibana, deleteAlertsAndRules } from '../../../tasks/common';
import {
createAndEnableRule,
fillAboutRuleAndContinue,
@ -93,18 +93,18 @@ import {
selectIndicatorMatchType,
waitForAlertsToPopulate,
waitForTheRuleToBeExecuted,
} from '../../tasks/create_new_rule';
} from '../../../tasks/create_new_rule';
import {
SCHEDULE_INTERVAL_AMOUNT_INPUT,
SCHEDULE_INTERVAL_UNITS_INPUT,
SCHEDULE_LOOKBACK_AMOUNT_INPUT,
SCHEDULE_LOOKBACK_UNITS_INPUT,
} from '../../screens/create_new_rule';
import { goBackToRuleDetails } from '../../tasks/edit_rule';
import { login, visit, visitWithoutDateRange } from '../../tasks/login';
import { goBackToRulesTable, getDetails } from '../../tasks/rule_details';
} from '../../../screens/create_new_rule';
import { goBackToRuleDetails } from '../../../tasks/edit_rule';
import { login, visit, visitWithoutDateRange } from '../../../tasks/login';
import { goBackToRulesTable, getDetails } from '../../../tasks/rule_details';
import { DETECTIONS_RULE_MANAGEMENT_URL, RULE_CREATION } from '../../urls/navigation';
import { DETECTIONS_RULE_MANAGEMENT_URL, RULE_CREATION } from '../../../urls/navigation';
const DEFAULT_THREAT_MATCH_QUERY = '@timestamp >= "now-30d/d"';

View file

@ -7,8 +7,8 @@
import { isArray } from 'lodash';
import { formatMitreAttackDescription, getHumanizedDuration } from '../../helpers/rules';
import { getMachineLearningRule } from '../../objects/rule';
import { formatMitreAttackDescription, getHumanizedDuration } from '../../../helpers/rules';
import { getMachineLearningRule } from '../../../objects/rule';
import {
CUSTOM_RULES_BTN,
@ -17,7 +17,7 @@ import {
RULE_NAME,
RULE_SWITCH,
SEVERITY,
} from '../../screens/alerts_detection_rules';
} from '../../../screens/alerts_detection_rules';
import {
ABOUT_DETAILS,
ABOUT_RULE_DESCRIPTION,
@ -38,21 +38,21 @@ import {
SEVERITY_DETAILS,
TAGS_DETAILS,
TIMELINE_TEMPLATE_DETAILS,
} from '../../screens/rule_details';
} from '../../../screens/rule_details';
import { getDetails } from '../../tasks/rule_details';
import { expectNumberOfRules, goToRuleDetails } from '../../tasks/alerts_detection_rules';
import { cleanKibana } from '../../tasks/common';
import { getDetails } from '../../../tasks/rule_details';
import { expectNumberOfRules, goToRuleDetails } from '../../../tasks/alerts_detection_rules';
import { cleanKibana } from '../../../tasks/common';
import {
createAndEnableRule,
fillAboutRuleAndContinue,
fillDefineMachineLearningRuleAndContinue,
fillScheduleRuleAndContinue,
selectMachineLearningRuleType,
} from '../../tasks/create_new_rule';
import { login, visitWithoutDateRange } from '../../tasks/login';
} from '../../../tasks/create_new_rule';
import { login, visitWithoutDateRange } from '../../../tasks/login';
import { RULE_CREATION } from '../../urls/navigation';
import { RULE_CREATION } from '../../../urls/navigation';
describe('Detection rules, machine learning', () => {
const expectedUrls = (getMachineLearningRule().references ?? []).join('');

View file

@ -5,10 +5,10 @@
* 2.0.
*/
import { formatMitreAttackDescription, getHumanizedDuration } from '../../helpers/rules';
import { getIndexPatterns, getNewTermsRule } from '../../objects/rule';
import { formatMitreAttackDescription, getHumanizedDuration } from '../../../helpers/rules';
import { getIndexPatterns, getNewTermsRule } from '../../../objects/rule';
import { ALERT_DATA_GRID } from '../../screens/alerts';
import { ALERT_DATA_GRID } from '../../../screens/alerts';
import {
CUSTOM_RULES_BTN,
RISK_SCORE,
@ -16,7 +16,7 @@ import {
RULE_NAME,
RULE_SWITCH,
SEVERITY,
} from '../../screens/alerts_detection_rules';
} from '../../../screens/alerts_detection_rules';
import {
ABOUT_DETAILS,
ABOUT_INVESTIGATION_NOTES,
@ -41,11 +41,11 @@ import {
TIMELINE_TEMPLATE_DETAILS,
NEW_TERMS_HISTORY_WINDOW_DETAILS,
NEW_TERMS_FIELDS_DETAILS,
} from '../../screens/rule_details';
} from '../../../screens/rule_details';
import { getDetails } from '../../tasks/rule_details';
import { expectNumberOfRules, goToRuleDetails } from '../../tasks/alerts_detection_rules';
import { cleanKibana, deleteAlertsAndRules } from '../../tasks/common';
import { getDetails } from '../../../tasks/rule_details';
import { expectNumberOfRules, goToRuleDetails } from '../../../tasks/alerts_detection_rules';
import { cleanKibana, deleteAlertsAndRules } from '../../../tasks/common';
import {
createAndEnableRule,
fillAboutRuleAndContinue,
@ -54,10 +54,10 @@ import {
selectNewTermsRuleType,
waitForAlertsToPopulate,
waitForTheRuleToBeExecuted,
} from '../../tasks/create_new_rule';
import { login, visit } from '../../tasks/login';
} from '../../../tasks/create_new_rule';
import { login, visit } from '../../../tasks/login';
import { RULE_CREATION } from '../../urls/navigation';
import { RULE_CREATION } from '../../../urls/navigation';
describe('New Terms rules', () => {
before(() => {

View file

@ -5,10 +5,10 @@
* 2.0.
*/
import { formatMitreAttackDescription, getHumanizedDuration } from '../../helpers/rules';
import { getIndexPatterns, getNewOverrideRule, getSeveritiesOverride } from '../../objects/rule';
import { formatMitreAttackDescription, getHumanizedDuration } from '../../../helpers/rules';
import { getIndexPatterns, getNewOverrideRule, getSeveritiesOverride } from '../../../objects/rule';
import { ALERT_GRID_CELL, ALERTS_COUNT } from '../../screens/alerts';
import { ALERT_GRID_CELL, ALERTS_COUNT } from '../../../screens/alerts';
import {
CUSTOM_RULES_BTN,
@ -17,7 +17,7 @@ import {
RULE_NAME,
RULE_SWITCH,
SEVERITY,
} from '../../screens/alerts_detection_rules';
} from '../../../screens/alerts_detection_rules';
import {
ABOUT_INVESTIGATION_NOTES,
ABOUT_DETAILS,
@ -45,9 +45,9 @@ import {
TAGS_DETAILS,
TIMELINE_TEMPLATE_DETAILS,
TIMESTAMP_OVERRIDE_DETAILS,
} from '../../screens/rule_details';
} from '../../../screens/rule_details';
import { expectNumberOfRules, goToRuleDetails } from '../../tasks/alerts_detection_rules';
import { expectNumberOfRules, goToRuleDetails } from '../../../tasks/alerts_detection_rules';
import {
createAndEnableRule,
fillAboutRuleWithOverrideAndContinue,
@ -55,11 +55,11 @@ import {
fillScheduleRuleAndContinue,
waitForAlertsToPopulate,
waitForTheRuleToBeExecuted,
} from '../../tasks/create_new_rule';
import { login, visitWithoutDateRange } from '../../tasks/login';
import { getDetails } from '../../tasks/rule_details';
} from '../../../tasks/create_new_rule';
import { login, visitWithoutDateRange } from '../../../tasks/login';
import { getDetails } from '../../../tasks/rule_details';
import { RULE_CREATION } from '../../urls/navigation';
import { RULE_CREATION } from '../../../urls/navigation';
describe('Detection rules, override', () => {
const rule = getNewOverrideRule();

View file

@ -5,10 +5,10 @@
* 2.0.
*/
import { formatMitreAttackDescription, getHumanizedDuration } from '../../helpers/rules';
import { getIndexPatterns, getNewThresholdRule } from '../../objects/rule';
import { formatMitreAttackDescription, getHumanizedDuration } from '../../../helpers/rules';
import { getIndexPatterns, getNewThresholdRule } from '../../../objects/rule';
import { ALERTS_COUNT, ALERT_GRID_CELL } from '../../screens/alerts';
import { ALERTS_COUNT, ALERT_GRID_CELL } from '../../../screens/alerts';
import {
CUSTOM_RULES_BTN,
@ -17,7 +17,7 @@ import {
RULE_NAME,
RULE_SWITCH,
SEVERITY,
} from '../../screens/alerts_detection_rules';
} from '../../../screens/alerts_detection_rules';
import {
ABOUT_DETAILS,
ABOUT_INVESTIGATION_NOTES,
@ -41,11 +41,11 @@ import {
TAGS_DETAILS,
THRESHOLD_DETAILS,
TIMELINE_TEMPLATE_DETAILS,
} from '../../screens/rule_details';
} from '../../../screens/rule_details';
import { getDetails } from '../../tasks/rule_details';
import { expectNumberOfRules, goToRuleDetails } from '../../tasks/alerts_detection_rules';
import { cleanKibana, deleteAlertsAndRules } from '../../tasks/common';
import { getDetails } from '../../../tasks/rule_details';
import { expectNumberOfRules, goToRuleDetails } from '../../../tasks/alerts_detection_rules';
import { cleanKibana, deleteAlertsAndRules } from '../../../tasks/common';
import {
createAndEnableRule,
fillAboutRuleAndContinue,
@ -54,10 +54,10 @@ import {
selectThresholdRuleType,
waitForAlertsToPopulate,
waitForTheRuleToBeExecuted,
} from '../../tasks/create_new_rule';
import { login, visitWithoutDateRange } from '../../tasks/login';
} from '../../../tasks/create_new_rule';
import { login, visitWithoutDateRange } from '../../../tasks/login';
import { RULE_CREATION } from '../../urls/navigation';
import { RULE_CREATION } from '../../../urls/navigation';
describe('Detection rules, threshold', () => {
const rule = getNewThresholdRule();

View file

@ -5,20 +5,24 @@
* 2.0.
*/
import { ROLES } from '../../../common/test';
import { getNewRule } from '../../objects/rule';
import { ROLES } from '../../../../../common/test';
import { getNewRule } from '../../../../objects/rule';
import {
COLLAPSED_ACTION_BTN,
RULE_CHECKBOX,
RULE_NAME,
} from '../../screens/alerts_detection_rules';
import { VALUE_LISTS_MODAL_ACTIVATOR } from '../../screens/lists';
import { waitForRulesTableToBeLoaded } from '../../tasks/alerts_detection_rules';
import { createRule } from '../../tasks/api_calls/rules';
import { cleanKibana } from '../../tasks/common';
import { dismissCallOut, getCallOut, waitForCallOutToBeShown } from '../../tasks/common/callouts';
import { login, visitWithoutDateRange } from '../../tasks/login';
import { SECURITY_DETECTIONS_RULES_URL } from '../../urls/navigation';
} from '../../../../screens/alerts_detection_rules';
import { VALUE_LISTS_MODAL_ACTIVATOR } from '../../../../screens/lists';
import { waitForRulesTableToBeLoaded } from '../../../../tasks/alerts_detection_rules';
import { createRule } from '../../../../tasks/api_calls/rules';
import { cleanKibana } from '../../../../tasks/common';
import {
dismissCallOut,
getCallOut,
waitForCallOutToBeShown,
} from '../../../../tasks/common/callouts';
import { login, visitWithoutDateRange } from '../../../../tasks/login';
import { SECURITY_DETECTIONS_RULES_URL } from '../../../../urls/navigation';
const MISSING_PRIVILEGES_CALLOUT = 'missing-user-privileges';

View file

@ -8,9 +8,9 @@
import { INTERNAL_ALERTING_API_MAINTENANCE_WINDOW_PATH } from '@kbn/alerting-plugin/common';
import type { MaintenanceWindowCreateBody } from '@kbn/alerting-plugin/common';
import type { AsApiContract } from '@kbn/alerting-plugin/server/routes/lib';
import { cleanKibana } from '../../tasks/common';
import { login, visit } from '../../tasks/login';
import { DETECTIONS_RULE_MANAGEMENT_URL } from '../../urls/navigation';
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', () => {
let maintenanceWindowId = '';

View file

@ -5,36 +5,36 @@
* 2.0.
*/
import { DETECTIONS_RULE_MANAGEMENT_URL } from '../../urls/navigation';
import { DETECTIONS_RULE_MANAGEMENT_URL } from '../../../../urls/navigation';
import { FIELD } from '../../screens/alerts_details';
import { INTEGRATIONS, INTEGRATIONS_STATUS } from '../../screens/rule_details';
import { FIELD } from '../../../../screens/alerts_details';
import { INTEGRATIONS, INTEGRATIONS_STATUS } from '../../../../screens/rule_details';
import {
INTEGRATIONS_POPOVER,
INTEGRATIONS_POPOVER_TITLE,
RULE_NAME,
} from '../../screens/alerts_detection_rules';
} from '../../../../screens/alerts_detection_rules';
import { cleanFleet } from '../../tasks/api_calls/fleet';
import { importRule } from '../../tasks/api_calls/rules';
import { cleanFleet } from '../../../../tasks/api_calls/fleet';
import { importRule } from '../../../../tasks/api_calls/rules';
import {
disableRelatedIntegrations,
enableRelatedIntegrations,
} from '../../tasks/api_calls/kibana_advanced_settings';
} from '../../../../tasks/api_calls/kibana_advanced_settings';
import { cleanKibana } from '../../tasks/common';
import { login, visit } from '../../tasks/login';
import { expandFirstAlert } from '../../tasks/alerts';
import { filterBy, openTable } from '../../tasks/alerts_details';
import { waitForAlertsToPopulate } from '../../tasks/create_new_rule';
import { installAwsCloudFrontWithPolicy } from '../../tasks/integrations';
import { cleanKibana } from '../../../../tasks/common';
import { login, visit } from '../../../../tasks/login';
import { expandFirstAlert } from '../../../../tasks/alerts';
import { filterBy, openTable } from '../../../../tasks/alerts_details';
import { waitForAlertsToPopulate } from '../../../../tasks/create_new_rule';
import { installAwsCloudFrontWithPolicy } from '../../../../tasks/integrations';
import {
enableRule,
goToTheRuleDetailsOf,
openIntegrationsPopover,
waitForRulesTableToShow,
waitForRuleToUpdate,
} from '../../tasks/alerts_detection_rules';
} from '../../../../tasks/alerts_detection_rules';
/*
Note that the rule we are using for testing purposes has the following characteristics, changing that may affect the coverage.

View file

@ -10,27 +10,31 @@ import {
goToTheRuleDetailsOf,
selectNumberOfRules,
expectManagementTableRules,
} from '../../../../tasks/alerts_detection_rules';
} from '../../../../../tasks/alerts_detection_rules';
import {
duplicateSelectedRulesWithoutExceptions,
duplicateSelectedRulesWithExceptions,
duplicateSelectedRulesWithNonExpiredExceptions,
} from '../../../../tasks/rules_bulk_actions';
import { goToExceptionsTab, viewExpiredExceptionItems } from '../../../../tasks/rule_details';
import { login, visitWithoutDateRange } from '../../../../tasks/login';
} from '../../../../../tasks/rules_bulk_actions';
import { goToExceptionsTab, viewExpiredExceptionItems } from '../../../../../tasks/rule_details';
import { login, visitWithoutDateRange } from '../../../../../tasks/login';
import { SECURITY_DETECTIONS_RULES_URL } from '../../../../urls/navigation';
import { createRule } from '../../../../tasks/api_calls/rules';
import { cleanKibana, resetRulesTableState, deleteAlertsAndRules } from '../../../../tasks/common';
import { SECURITY_DETECTIONS_RULES_URL } from '../../../../../urls/navigation';
import { createRule } from '../../../../../tasks/api_calls/rules';
import {
cleanKibana,
resetRulesTableState,
deleteAlertsAndRules,
} from '../../../../../tasks/common';
import { getNewRule } from '../../../../objects/rule';
import { getNewRule } from '../../../../../objects/rule';
import { createRuleExceptionItem } from '../../../../tasks/api_calls/exceptions';
import { EXCEPTION_CARD_ITEM_NAME } from '../../../../screens/exceptions';
import { createRuleExceptionItem } from '../../../../../tasks/api_calls/exceptions';
import { EXCEPTION_CARD_ITEM_NAME } from '../../../../../screens/exceptions';
import {
assertExceptionItemsExists,
assertNumberOfExceptionItemsExists,
} from '../../../../tasks/exceptions';
} from '../../../../../tasks/exceptions';
const RULE_NAME = 'Custom rule for bulk actions';

View file

@ -11,7 +11,7 @@ import {
RULE_CHECKBOX,
RULES_TAGS_POPOVER_BTN,
MODAL_ERROR_BODY,
} from '../../../../screens/alerts_detection_rules';
} from '../../../../../screens/alerts_detection_rules';
import {
RULES_BULK_EDIT_INDEX_PATTERNS_WARNING,
@ -20,11 +20,11 @@ import {
TAGS_RULE_BULK_MENU_ITEM,
INDEX_PATTERNS_RULE_BULK_MENU_ITEM,
APPLY_TIMELINE_RULE_BULK_MENU_ITEM,
} from '../../../../screens/rules_bulk_actions';
} from '../../../../../screens/rules_bulk_actions';
import { TIMELINE_TEMPLATE_DETAILS } from '../../../../screens/rule_details';
import { TIMELINE_TEMPLATE_DETAILS } from '../../../../../screens/rule_details';
import { EUI_FILTER_SELECT_ITEM } from '../../../../screens/common/controls';
import { EUI_FILTER_SELECT_ITEM } from '../../../../../screens/common/controls';
import {
waitForRulesTableToBeLoaded,
@ -38,7 +38,7 @@ import {
clickErrorToastBtn,
unselectRuleByName,
cancelConfirmationModal,
} from '../../../../tasks/alerts_detection_rules';
} from '../../../../../tasks/alerts_detection_rules';
import {
typeIndexPatterns,
@ -69,15 +69,19 @@ import {
assertRuleScheduleValues,
assertUpdateScheduleWarningExists,
assertDefaultValuesAreAppliedToScheduleFields,
} from '../../../../tasks/rules_bulk_actions';
} from '../../../../../tasks/rules_bulk_actions';
import { hasIndexPatterns, getDetails } from '../../../../tasks/rule_details';
import { login, visitWithoutDateRange } from '../../../../tasks/login';
import { hasIndexPatterns, getDetails } from '../../../../../tasks/rule_details';
import { login, visitWithoutDateRange } from '../../../../../tasks/login';
import { SECURITY_DETECTIONS_RULES_URL } from '../../../../urls/navigation';
import { createRule } from '../../../../tasks/api_calls/rules';
import { loadPrepackagedTimelineTemplates } from '../../../../tasks/api_calls/timelines';
import { cleanKibana, resetRulesTableState, deleteAlertsAndRules } from '../../../../tasks/common';
import { SECURITY_DETECTIONS_RULES_URL } from '../../../../../urls/navigation';
import { createRule } from '../../../../../tasks/api_calls/rules';
import { loadPrepackagedTimelineTemplates } from '../../../../../tasks/api_calls/timelines';
import {
cleanKibana,
resetRulesTableState,
deleteAlertsAndRules,
} from '../../../../../tasks/common';
import {
getEqlRule,
@ -86,13 +90,13 @@ import {
getNewThresholdRule,
getMachineLearningRule,
getNewTermsRule,
} from '../../../../objects/rule';
} from '../../../../../objects/rule';
import {
getAvailablePrebuiltRulesCount,
excessivelyInstallAllPrebuiltRules,
} from '../../../../tasks/api_calls/prebuilt_rules';
import { setRowsPerPageTo } from '../../../../tasks/table_pagination';
} from '../../../../../tasks/api_calls/prebuilt_rules';
import { setRowsPerPageTo } from '../../../../../tasks/table_pagination';
const RULE_NAME = 'Custom rule for bulk actions';
const EUI_SELECTABLE_LIST_ITEM_SR_TEXT = '. To check this option, press Enter.';

View file

@ -6,17 +6,17 @@
*/
import type { RuleActionArray } from '@kbn/securitysolution-io-ts-alerting-types';
import { ROLES } from '../../../../../common/test';
import { ROLES } from '../../../../../../common/test';
import {
RULES_BULK_EDIT_ACTIONS_INFO,
RULES_BULK_EDIT_ACTIONS_WARNING,
ADD_RULE_ACTIONS_MENU_ITEM,
} from '../../../../screens/rules_bulk_actions';
import { actionFormSelector } from '../../../../screens/common/rule_actions';
} from '../../../../../screens/rules_bulk_actions';
import { actionFormSelector } from '../../../../../screens/common/rule_actions';
import { cleanKibana, deleteAlertsAndRules, deleteConnectors } from '../../../../tasks/common';
import type { RuleActionCustomFrequency } from '../../../../tasks/common/rule_actions';
import { cleanKibana, deleteAlertsAndRules, deleteConnectors } from '../../../../../tasks/common';
import type { RuleActionCustomFrequency } from '../../../../../tasks/common/rule_actions';
import {
addSlackRuleAction,
assertSlackRuleAction,
@ -28,25 +28,25 @@ import {
pickCustomFrequencyOption,
pickPerRuleRunFrequencyOption,
pickSummaryOfAlertsOption,
} from '../../../../tasks/common/rule_actions';
} from '../../../../../tasks/common/rule_actions';
import {
waitForRulesTableToBeLoaded,
selectNumberOfRules,
goToEditRuleActionsSettingsOf,
} from '../../../../tasks/alerts_detection_rules';
} from '../../../../../tasks/alerts_detection_rules';
import {
waitForBulkEditActionToFinish,
submitBulkEditForm,
checkOverwriteRuleActionsCheckbox,
openBulkEditRuleActionsForm,
openBulkActionsMenu,
} from '../../../../tasks/rules_bulk_actions';
import { login, visitWithoutDateRange } from '../../../../tasks/login';
} from '../../../../../tasks/rules_bulk_actions';
import { login, visitWithoutDateRange } from '../../../../../tasks/login';
import { SECURITY_DETECTIONS_RULES_URL } from '../../../../urls/navigation';
import { SECURITY_DETECTIONS_RULES_URL } from '../../../../../urls/navigation';
import { createRule } from '../../../../tasks/api_calls/rules';
import { createSlackConnector } from '../../../../tasks/api_calls/connectors';
import { createRule } from '../../../../../tasks/api_calls/rules';
import { createSlackConnector } from '../../../../../tasks/api_calls/connectors';
import {
getEqlRule,
@ -55,8 +55,8 @@ import {
getNewThresholdRule,
getMachineLearningRule,
getNewTermsRule,
} from '../../../../objects/rule';
import { excessivelyInstallAllPrebuiltRules } from '../../../../tasks/api_calls/prebuilt_rules';
} from '../../../../../objects/rule';
import { excessivelyInstallAllPrebuiltRules } from '../../../../../tasks/api_calls/prebuilt_rules';
const ruleNameToAssert = 'Custom rule name with actions';
const expectedNumberOfCustomRulesToBeEdited = 7;

View file

@ -8,16 +8,16 @@
import {
RULES_BULK_EDIT_DATA_VIEWS_WARNING,
RULES_BULK_EDIT_OVERWRITE_DATA_VIEW_CHECKBOX,
} from '../../../../screens/rules_bulk_actions';
} from '../../../../../screens/rules_bulk_actions';
import { DATA_VIEW_DETAILS, INDEX_PATTERNS_DETAILS } from '../../../../screens/rule_details';
import { DATA_VIEW_DETAILS, INDEX_PATTERNS_DETAILS } from '../../../../../screens/rule_details';
import {
waitForRulesTableToBeLoaded,
goToRuleDetails,
selectNumberOfRules,
goToTheRuleDetailsOf,
} from '../../../../tasks/alerts_detection_rules';
} from '../../../../../tasks/alerts_detection_rules';
import {
typeIndexPatterns,
@ -27,18 +27,18 @@ import {
checkOverwriteIndexPatternsCheckbox,
openBulkEditAddIndexPatternsForm,
openBulkEditDeleteIndexPatternsForm,
} from '../../../../tasks/rules_bulk_actions';
} from '../../../../../tasks/rules_bulk_actions';
import {
hasIndexPatterns,
getDetails,
assertDetailsNotExist,
} from '../../../../tasks/rule_details';
import { login, visitWithoutDateRange } from '../../../../tasks/login';
} from '../../../../../tasks/rule_details';
import { login, visitWithoutDateRange } from '../../../../../tasks/login';
import { SECURITY_DETECTIONS_RULES_URL } from '../../../../urls/navigation';
import { createRule } from '../../../../tasks/api_calls/rules';
import { cleanKibana, deleteAlertsAndRules, postDataView } from '../../../../tasks/common';
import { SECURITY_DETECTIONS_RULES_URL } from '../../../../../urls/navigation';
import { createRule } from '../../../../../tasks/api_calls/rules';
import { cleanKibana, deleteAlertsAndRules, postDataView } from '../../../../../tasks/common';
import {
getEqlRule,
@ -46,7 +46,7 @@ import {
getNewRule,
getNewThresholdRule,
getNewTermsRule,
} from '../../../../objects/rule';
} from '../../../../../objects/rule';
const DATA_VIEW_ID = 'auditbeat';

View file

@ -7,13 +7,13 @@
import path from 'path';
import { expectedExportedRule, getNewRule } from '../../objects/rule';
import { expectedExportedRule, getNewRule } from '../../../../../objects/rule';
import {
TOASTER_BODY,
MODAL_CONFIRMATION_BODY,
MODAL_CONFIRMATION_BTN,
TOASTER,
} from '../../screens/alerts_detection_rules';
} from '../../../../../screens/alerts_detection_rules';
import {
filterByElasticRules,
selectNumberOfRules,
@ -22,26 +22,29 @@ import {
exportRule,
importRules,
expectManagementTableRules,
} from '../../tasks/alerts_detection_rules';
import { bulkExportRules } from '../../tasks/rules_bulk_actions';
import { createExceptionList, deleteExceptionList } from '../../tasks/api_calls/exceptions';
import { getExceptionList } from '../../objects/exception';
import { createRule } from '../../tasks/api_calls/rules';
} from '../../../../../tasks/alerts_detection_rules';
import { bulkExportRules } from '../../../../../tasks/rules_bulk_actions';
import {
createExceptionList,
deleteExceptionList,
} from '../../../../../tasks/api_calls/exceptions';
import { getExceptionList } from '../../../../../objects/exception';
import { createRule } from '../../../../../tasks/api_calls/rules';
import {
cleanKibana,
resetRulesTableState,
deleteAlertsAndRules,
reload,
} from '../../tasks/common';
import { login, visitWithoutDateRange } from '../../tasks/login';
} from '../../../../../tasks/common';
import { login, visitWithoutDateRange } from '../../../../../tasks/login';
import { DETECTIONS_RULE_MANAGEMENT_URL } from '../../urls/navigation';
import { DETECTIONS_RULE_MANAGEMENT_URL } from '../../../../../urls/navigation';
import {
createAndInstallMockedPrebuiltRules,
getAvailablePrebuiltRulesCount,
preventPrebuiltRulesPackageInstallation,
} from '../../tasks/api_calls/prebuilt_rules';
import { createRuleAssetSavedObject } from '../../helpers/rules';
} from '../../../../../tasks/api_calls/prebuilt_rules';
import { createRuleAssetSavedObject } from '../../../../../helpers/rules';
const EXPORTED_RULES_FILENAME = 'rules_export.ndjson';
const exceptionList = getExceptionList();

View file

@ -5,16 +5,16 @@
* 2.0.
*/
import { TOASTER } from '../../screens/alerts_detection_rules';
import { TOASTER } from '../../../../../screens/alerts_detection_rules';
import {
expectManagementTableRules,
importRules,
importRulesWithOverwriteAll,
} from '../../tasks/alerts_detection_rules';
import { cleanKibana, deleteAlertsAndRules, reload } from '../../tasks/common';
import { login, visitWithoutDateRange } from '../../tasks/login';
} from '../../../../../tasks/alerts_detection_rules';
import { cleanKibana, deleteAlertsAndRules, reload } from '../../../../../tasks/common';
import { login, visitWithoutDateRange } from '../../../../../tasks/login';
import { DETECTIONS_RULE_MANAGEMENT_URL } from '../../urls/navigation';
import { DETECTIONS_RULE_MANAGEMENT_URL } from '../../../../../urls/navigation';
const RULES_TO_IMPORT_FILENAME = 'cypress/fixtures/7_16_rules.ndjson';
describe('Import rules', () => {

View file

@ -6,14 +6,18 @@
*/
import { INTERNAL_ALERTING_API_FIND_RULES_PATH } from '@kbn/alerting-plugin/common';
import type { RuleResponse } from '../../../common/api/detection_engine';
import { createRule, snoozeRule as snoozeRuleViaAPI } from '../../tasks/api_calls/rules';
import { cleanKibana, deleteAlertsAndRules, deleteConnectors } from '../../tasks/common';
import { login, visitWithoutDateRange } from '../../tasks/login';
import { getNewRule } from '../../objects/rule';
import { ruleDetailsUrl, ruleEditUrl, SECURITY_DETECTIONS_RULES_URL } from '../../urls/navigation';
import { internalAlertingSnoozeRule } from '../../urls/routes';
import { RULES_MANAGEMENT_TABLE, RULE_NAME } from '../../screens/alerts_detection_rules';
import type { RuleResponse } from '../../../../../../common/api/detection_engine';
import { createRule, snoozeRule as snoozeRuleViaAPI } from '../../../../../tasks/api_calls/rules';
import { cleanKibana, deleteAlertsAndRules, deleteConnectors } from '../../../../../tasks/common';
import { login, visitWithoutDateRange } from '../../../../../tasks/login';
import { getNewRule } from '../../../../../objects/rule';
import {
ruleDetailsUrl,
ruleEditUrl,
SECURITY_DETECTIONS_RULES_URL,
} from '../../../../../urls/navigation';
import { internalAlertingSnoozeRule } from '../../../../../urls/routes';
import { RULES_MANAGEMENT_TABLE, RULE_NAME } from '../../../../../screens/alerts_detection_rules';
import {
expectRuleSnoozed,
expectRuleSnoozedInTable,
@ -25,17 +29,17 @@ import {
snoozeRule,
snoozeRuleInTable,
unsnoozeRuleInTable,
} from '../../tasks/rule_snoozing';
import { createSlackConnector } from '../../tasks/api_calls/connectors';
import { duplicateFirstRule, importRules } from '../../tasks/alerts_detection_rules';
import { goToActionsStepTab } from '../../tasks/create_new_rule';
import { goToRuleEditSettings } from '../../tasks/rule_details';
import { actionFormSelector } from '../../screens/common/rule_actions';
import { RULE_INDICES } from '../../screens/create_new_rule';
import { addEmailConnectorAndRuleAction } from '../../tasks/common/rule_actions';
import { saveEditedRule } from '../../tasks/edit_rule';
import { DISABLED_SNOOZE_BADGE } from '../../screens/rule_snoozing';
import { TOOLTIP } from '../../screens/common';
} from '../../../../../tasks/rule_snoozing';
import { createSlackConnector } from '../../../../../tasks/api_calls/connectors';
import { duplicateFirstRule, importRules } from '../../../../../tasks/alerts_detection_rules';
import { goToActionsStepTab } from '../../../../../tasks/create_new_rule';
import { goToRuleEditSettings } from '../../../../../tasks/rule_details';
import { actionFormSelector } from '../../../../../screens/common/rule_actions';
import { RULE_INDICES } from '../../../../../screens/create_new_rule';
import { addEmailConnectorAndRuleAction } from '../../../../../tasks/common/rule_actions';
import { saveEditedRule } from '../../../../../tasks/edit_rule';
import { DISABLED_SNOOZE_BADGE } from '../../../../../screens/rule_snoozing';
import { TOOLTIP } from '../../../../../screens/common';
const RULES_TO_IMPORT_FILENAME = 'cypress/fixtures/7_16_rules.ndjson';

View file

@ -10,7 +10,7 @@ import {
REFRESH_RULES_STATUS,
REFRESH_SETTINGS_SWITCH,
REFRESH_SETTINGS_SELECTION_NOTE,
} from '../../screens/alerts_detection_rules';
} from '../../../../screens/alerts_detection_rules';
import {
checkAutoRefresh,
waitForRulesTableToBeLoaded,
@ -22,19 +22,19 @@ import {
disableAutoRefresh,
checkAutoRefreshIsDisabled,
checkAutoRefreshIsEnabled,
} from '../../tasks/alerts_detection_rules';
import { login, visit, visitWithoutDateRange } from '../../tasks/login';
} from '../../../../tasks/alerts_detection_rules';
import { login, visit, visitWithoutDateRange } from '../../../../tasks/login';
import { DETECTIONS_RULE_MANAGEMENT_URL } from '../../urls/navigation';
import { createRule } from '../../tasks/api_calls/rules';
import { cleanKibana } from '../../tasks/common';
import { getNewRule } from '../../objects/rule';
import { setRowsPerPageTo } from '../../tasks/table_pagination';
import { DETECTIONS_RULE_MANAGEMENT_URL } from '../../../../urls/navigation';
import { createRule } from '../../../../tasks/api_calls/rules';
import { cleanKibana } from '../../../../tasks/common';
import { getNewRule } from '../../../../objects/rule';
import { setRowsPerPageTo } from '../../../../tasks/table_pagination';
const DEFAULT_RULE_REFRESH_INTERVAL_VALUE = 60000;
// TODO: See https://github.com/elastic/kibana/issues/154694
describe.skip('Alerts detection rules table auto-refresh', () => {
describe.skip('Rules table: auto-refresh', () => {
before(() => {
cleanKibana();
login();

View file

@ -5,24 +5,28 @@
* 2.0.
*/
import { cleanKibana, resetRulesTableState, deleteAlertsAndRules } from '../../tasks/common';
import { login, visitWithoutDateRange } from '../../tasks/login';
import { cleanKibana, resetRulesTableState, deleteAlertsAndRules } from '../../../../tasks/common';
import { login, visitWithoutDateRange } from '../../../../tasks/login';
import {
expectRulesWithExecutionStatus,
filterByExecutionStatus,
expectNumberOfRulesShownOnPage,
} from '../../tasks/rule_filters';
} from '../../../../tasks/rule_filters';
import { SECURITY_DETECTIONS_RULES_URL } from '../../urls/navigation';
import { SECURITY_DETECTIONS_RULES_URL } from '../../../../urls/navigation';
import { waitForRulesTableToBeLoaded } from '../../tasks/alerts_detection_rules';
import { waitForRulesTableToBeLoaded } from '../../../../tasks/alerts_detection_rules';
import { createRule, waitForRulesToFinishExecution } from '../../tasks/api_calls/rules';
import { deleteIndex, createIndex, createDocument } from '../../tasks/api_calls/elasticsearch';
import { createRule, waitForRulesToFinishExecution } from '../../../../tasks/api_calls/rules';
import {
deleteIndex,
createIndex,
createDocument,
} from '../../../../tasks/api_calls/elasticsearch';
import { getNewRule } from '../../objects/rule';
import { getNewRule } from '../../../../objects/rule';
describe('Rule management filters', () => {
describe('Rules table: filtering', () => {
before(() => {
cleanKibana();
});

View file

@ -5,14 +5,14 @@
* 2.0.
*/
import { getNewRule } from '../../objects/rule';
import { RULES_MONITORING_TAB, RULE_NAME } from '../../screens/alerts_detection_rules';
import { createRule } from '../../tasks/api_calls/rules';
import { cleanKibana, deleteAlertsAndRules } from '../../tasks/common';
import { login, visitWithoutDateRange } from '../../tasks/login';
import { DETECTIONS_RULE_MANAGEMENT_URL } from '../../urls/navigation';
import { getNewRule } from '../../../../objects/rule';
import { RULES_MONITORING_TAB, RULE_NAME } from '../../../../screens/alerts_detection_rules';
import { createRule } from '../../../../tasks/api_calls/rules';
import { cleanKibana, deleteAlertsAndRules } from '../../../../tasks/common';
import { login, visitWithoutDateRange } from '../../../../tasks/login';
import { DETECTIONS_RULE_MANAGEMENT_URL } from '../../../../urls/navigation';
describe('Rules talbes links', () => {
describe('Rules table: links', () => {
before(() => {
cleanKibana();
});

View file

@ -6,16 +6,16 @@
*/
import { encode } from '@kbn/rison';
import { cleanKibana, resetRulesTableState } from '../../tasks/common';
import { login, visit } from '../../tasks/login';
import { cleanKibana, resetRulesTableState } from '../../../../tasks/common';
import { login, visit } from '../../../../tasks/login';
import {
DASHBOARDS_URL,
KIBANA_HOME,
SECURITY_DETECTIONS_RULES_MANAGEMENT_URL,
SECURITY_DETECTIONS_RULES_MONITORING_URL,
SECURITY_DETECTIONS_RULES_URL,
} from '../../urls/navigation';
import { getNewRule } from '../../objects/rule';
} from '../../../../urls/navigation';
import { getNewRule } from '../../../../objects/rule';
import {
filterByCustomRules,
filterBySearchTerm,
@ -34,8 +34,8 @@ import {
expectFilterByPrebuiltRules,
expectFilterByEnabledRules,
expectManagementTableRules,
} from '../../tasks/alerts_detection_rules';
import { createRule } from '../../tasks/api_calls/rules';
} from '../../../../tasks/alerts_detection_rules';
import { createRule } from '../../../../tasks/api_calls/rules';
import {
expectRowsPerPage,
expectTablePage,
@ -43,7 +43,7 @@ import {
goToTablePage,
setRowsPerPageTo,
sortByTableColumn,
} from '../../tasks/table_pagination';
} from '../../../../tasks/table_pagination';
function createTestRules(): void {
createRule(getNewRule({ rule_id: '1', name: 'test 1', tags: ['tag-a'], enabled: false }));
@ -98,7 +98,7 @@ function expectDefaultRulesTableState(): void {
expectTablePage(1);
}
describe('Persistent rules table state', () => {
describe('Rules table: persistent state', () => {
before(() => {
cleanKibana();
createTestRules();

View file

@ -4,24 +4,24 @@
* 2.0; you may not use this file except in compliance with the Elastic License
* 2.0.
*/
import { createRuleAssetSavedObject } from '../../helpers/rules';
import { createRuleAssetSavedObject } from '../../../../helpers/rules';
import {
SELECTED_RULES_NUMBER_LABEL,
SELECT_ALL_RULES_BTN,
SELECT_ALL_RULES_ON_PAGE_CHECKBOX,
} from '../../screens/alerts_detection_rules';
} from '../../../../screens/alerts_detection_rules';
import {
selectNumberOfRules,
unselectNumberOfRules,
waitForPrebuiltDetectionRulesToBeLoaded,
} from '../../tasks/alerts_detection_rules';
} from '../../../../tasks/alerts_detection_rules';
import {
getAvailablePrebuiltRulesCount,
createAndInstallMockedPrebuiltRules,
} from '../../tasks/api_calls/prebuilt_rules';
import { cleanKibana } from '../../tasks/common';
import { login, visitWithoutDateRange } from '../../tasks/login';
import { DETECTIONS_RULE_MANAGEMENT_URL } from '../../urls/navigation';
} from '../../../../tasks/api_calls/prebuilt_rules';
import { cleanKibana } from '../../../../tasks/common';
import { login, visitWithoutDateRange } from '../../../../tasks/login';
import { DETECTIONS_RULE_MANAGEMENT_URL } from '../../../../urls/navigation';
const RULE_1 = createRuleAssetSavedObject({
name: 'Test rule 1',
@ -32,7 +32,7 @@ const RULE_2 = createRuleAssetSavedObject({
rule_id: 'rule_2',
});
describe('Rules selection', () => {
describe('Rules table: selection', () => {
before(() => {
cleanKibana();
});

View file

@ -13,27 +13,31 @@ import {
FOURTH_RULE,
RULES_MANAGEMENT_TABLE,
RULES_ROW,
} from '../../screens/alerts_detection_rules';
} from '../../../../screens/alerts_detection_rules';
import {
enableRule,
waitForRulesTableToBeLoaded,
waitForRuleToUpdate,
} from '../../tasks/alerts_detection_rules';
import { login, visit } from '../../tasks/login';
} from '../../../../tasks/alerts_detection_rules';
import { login, visit } from '../../../../tasks/login';
import { DETECTIONS_RULE_MANAGEMENT_URL } from '../../urls/navigation';
import { createRule } from '../../tasks/api_calls/rules';
import { cleanKibana } from '../../tasks/common';
import { DETECTIONS_RULE_MANAGEMENT_URL } from '../../../../urls/navigation';
import { createRule } from '../../../../tasks/api_calls/rules';
import { cleanKibana } from '../../../../tasks/common';
import {
getExistingRule,
getNewOverrideRule,
getNewRule,
getNewThresholdRule,
} from '../../objects/rule';
import { goToTablePage, setRowsPerPageTo, sortByTableColumn } from '../../tasks/table_pagination';
import { TABLE_FIRST_PAGE, TABLE_SECOND_PAGE } from '../../screens/table_pagination';
} from '../../../../objects/rule';
import {
goToTablePage,
setRowsPerPageTo,
sortByTableColumn,
} from '../../../../tasks/table_pagination';
import { TABLE_FIRST_PAGE, TABLE_SECOND_PAGE } from '../../../../screens/table_pagination';
describe('Alerts detection rules', () => {
describe('Rules table: sorting', () => {
before(() => {
cleanKibana();
login();

View file

@ -5,9 +5,9 @@
* 2.0.
*/
import { ROLES } from '../../../common/test';
import { deleteRoleAndUser, login, visitWithoutDateRange } from '../../tasks/login';
import { DETECTIONS_RULE_MANAGEMENT_URL } from '../../urls/navigation';
import { ROLES } from '../../../../common/test';
import { deleteRoleAndUser, login, visitWithoutDateRange } from '../../../tasks/login';
import { DETECTIONS_RULE_MANAGEMENT_URL } from '../../../urls/navigation';
import {
createListsIndex,
waitForValueListsModalToBeLoaded,
@ -21,12 +21,12 @@ import {
deleteValueListsFile,
exportValueList,
waitForListsIndex,
} from '../../tasks/lists';
} from '../../../tasks/lists';
import {
VALUE_LISTS_TABLE,
VALUE_LISTS_ROW,
VALUE_LISTS_MODAL_ACTIVATOR,
} from '../../screens/lists';
} from '../../../screens/lists';
describe('value lists', () => {
describe('management modal', () => {