diff --git a/x-pack/test/security_solution_cypress/cypress/e2e/detection_response/detection_engine/rule_creation/threshold_rule.cy.ts b/x-pack/test/security_solution_cypress/cypress/e2e/detection_response/detection_engine/rule_creation/threshold_rule.cy.ts index 11740c1f795f8..8af755c6ed328 100644 --- a/x-pack/test/security_solution_cypress/cypress/e2e/detection_response/detection_engine/rule_creation/threshold_rule.cy.ts +++ b/x-pack/test/security_solution_cypress/cypress/e2e/detection_response/detection_engine/rule_creation/threshold_rule.cy.ts @@ -58,6 +58,8 @@ import { fillScheduleRuleAndContinue, selectThresholdRuleType, waitForAlertsToPopulate, + fillDefineThresholdRule, + continueFromDefineStep, } from '../../../../tasks/create_new_rule'; import { login } from '../../../../tasks/login'; import { visit } from '../../../../tasks/navigation'; @@ -68,7 +70,7 @@ import { CREATE_RULE_URL } from '../../../../urls/navigation'; describe( 'Threshold rules', { - tags: ['@ess', '@serverless', '@skipInServerlessMKI'], + tags: ['@ess', '@serverless'], }, () => { const rule = getNewThresholdRule(); @@ -152,8 +154,10 @@ describe( it('Creates a new threshold rule with suppression enabled', () => { selectThresholdRuleType(); + fillDefineThresholdRule(rule); enablesAndPopulatesThresholdSuppression(5, 'h'); - fillDefineThresholdRuleAndContinue(rule); + continueFromDefineStep(); + // ensures duration displayed on define step in preview mode cy.get(DEFINITION_DETAILS).within(() => { getDetails(SUPPRESS_FOR_DETAILS).should('have.text', '5h'); diff --git a/x-pack/test/security_solution_cypress/cypress/tasks/create_new_rule.ts b/x-pack/test/security_solution_cypress/cypress/tasks/create_new_rule.ts index 68dc2cfffd908..501dd0461dd44 100644 --- a/x-pack/test/security_solution_cypress/cypress/tasks/create_new_rule.ts +++ b/x-pack/test/security_solution_cypress/cypress/tasks/create_new_rule.ts @@ -557,7 +557,7 @@ export const fillRuleActionFilters = (alertsFilter: AlertsFilter) => { .type(`{selectall}${alertsFilter.timeframe.timezone}{enter}`); }; -export const fillDefineThresholdRuleAndContinue = (rule: ThresholdRuleCreateProps) => { +export const fillDefineThresholdRule = (rule: ThresholdRuleCreateProps) => { const thresholdField = 0; const threshold = 1; @@ -578,7 +578,11 @@ export const fillDefineThresholdRuleAndContinue = (rule: ThresholdRuleCreateProp cy.wrap(inputs[threshold]).clear(); cy.wrap(inputs[threshold]).type(`${rule.threshold.value}`); }); - cy.get(DEFINE_CONTINUE_BUTTON).should('exist').click({ force: true }); +}; + +export const fillDefineThresholdRuleAndContinue = (rule: ThresholdRuleCreateProps) => { + fillDefineThresholdRule(rule); + continueFromDefineStep(); }; export const fillDefineEqlRule = (rule: EqlRuleCreateProps) => { @@ -908,6 +912,7 @@ export const enablesAndPopulatesThresholdSuppression = ( // enables suppression for threshold rule cy.get(THRESHOLD_ENABLE_SUPPRESSION_CHECKBOX).should('not.be.checked'); cy.get(THRESHOLD_ENABLE_SUPPRESSION_CHECKBOX).click(); + cy.get(THRESHOLD_ENABLE_SUPPRESSION_CHECKBOX).should('be.checked'); setAlertSuppressionDuration(interval, timeUnit);