mirror of
https://github.com/elastic/kibana.git
synced 2025-04-24 17:59:23 -04:00
[Security Solution][Cypress] - Update cypress tests to undo a util change that was redundant (#130722)
Update cypress tests to undo a util change that was redundant.
This commit is contained in:
parent
f149a17871
commit
f5f035645e
2 changed files with 5 additions and 11 deletions
|
@ -11,7 +11,7 @@ import { getNewRule } from '../../objects/rule';
|
|||
import { ALERTS_COUNT, EMPTY_ALERT_TABLE, NUMBER_OF_ALERTS } from '../../screens/alerts';
|
||||
|
||||
import { addExceptionFromFirstAlert, goToClosedAlerts, goToOpenedAlerts } from '../../tasks/alerts';
|
||||
import { createCustomRule } from '../../tasks/api_calls/rules';
|
||||
import { createCustomRuleEnabled } from '../../tasks/api_calls/rules';
|
||||
import { goToRuleDetails } from '../../tasks/alerts_detection_rules';
|
||||
import { waitForAlertsToPopulate } from '../../tasks/create_new_rule';
|
||||
import { esArchiverLoad, esArchiverUnload } from '../../tasks/es_archiver';
|
||||
|
@ -39,11 +39,10 @@ describe('Adds rule exception', () => {
|
|||
|
||||
beforeEach(() => {
|
||||
deleteAlertsAndRules();
|
||||
createCustomRule(
|
||||
createCustomRuleEnabled(
|
||||
{ ...getNewRule(), customQuery: 'agent.name:*', index: ['exceptions*'] },
|
||||
'rule_testing',
|
||||
'5s',
|
||||
true
|
||||
'1s'
|
||||
);
|
||||
visitWithoutDateRange(DETECTIONS_RULE_MANAGEMENT_URL);
|
||||
goToRuleDetails();
|
||||
|
|
|
@ -7,12 +7,7 @@
|
|||
|
||||
import { CustomRule, ThreatIndicatorRule } from '../../objects/rule';
|
||||
|
||||
export const createCustomRule = (
|
||||
rule: CustomRule,
|
||||
ruleId = 'rule_testing',
|
||||
interval = '100m',
|
||||
enabled = false
|
||||
) =>
|
||||
export const createCustomRule = (rule: CustomRule, ruleId = 'rule_testing', interval = '100m') =>
|
||||
cy.request({
|
||||
method: 'POST',
|
||||
url: 'api/detection_engine/rules',
|
||||
|
@ -28,7 +23,7 @@ export const createCustomRule = (
|
|||
index: rule.index,
|
||||
query: rule.customQuery,
|
||||
language: 'kuery',
|
||||
enabled,
|
||||
enabled: false,
|
||||
exceptions_list: rule.exceptionLists ?? [],
|
||||
},
|
||||
headers: { 'kbn-xsrf': 'cypress-creds' },
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue