From 59e0ff569c3919b3721202402574a283668321f0 Mon Sep 17 00:00:00 2001 From: Georgii Gorbachev Date: Sun, 17 Aug 2025 14:50:51 +0200 Subject: [PATCH 1/2] Unskip tests --- .../rule_management/rule_details/execution_log.cy.ts | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/x-pack/solutions/security/test/security_solution_cypress/cypress/e2e/detection_response/rule_management/rule_details/execution_log.cy.ts b/x-pack/solutions/security/test/security_solution_cypress/cypress/e2e/detection_response/rule_management/rule_details/execution_log.cy.ts index 6906ffb901e1b..040bdd563b72e 100644 --- a/x-pack/solutions/security/test/security_solution_cypress/cypress/e2e/detection_response/rule_management/rule_details/execution_log.cy.ts +++ b/x-pack/solutions/security/test/security_solution_cypress/cypress/e2e/detection_response/rule_management/rule_details/execution_log.cy.ts @@ -23,8 +23,7 @@ import { getNewRule } from '../../../../objects/rule'; import { EXECUTION_SHOWING } from '../../../../screens/rule_details'; import { manualRuleRun } from '../../../../tasks/api_calls/backfill'; -// FLAKY: https://github.com/elastic/kibana/issues/184360 -describe.skip( +describe( 'Event log', { tags: ['@ess', '@serverless'], From 0eca460a3bd4c3dde7f791840ebab9ed9caa347d Mon Sep 17 00:00:00 2001 From: Georgii Gorbachev Date: Sun, 17 Aug 2025 18:15:52 +0200 Subject: [PATCH 2/2] Fix tests --- .../rule_details/execution_log.cy.ts | 27 ++++++++++++++----- .../cypress/tasks/api_calls/backfill.ts | 3 +-- 2 files changed, 22 insertions(+), 8 deletions(-) diff --git a/x-pack/solutions/security/test/security_solution_cypress/cypress/e2e/detection_response/rule_management/rule_details/execution_log.cy.ts b/x-pack/solutions/security/test/security_solution_cypress/cypress/e2e/detection_response/rule_management/rule_details/execution_log.cy.ts index 040bdd563b72e..572237426a75b 100644 --- a/x-pack/solutions/security/test/security_solution_cypress/cypress/e2e/detection_response/rule_management/rule_details/execution_log.cy.ts +++ b/x-pack/solutions/security/test/security_solution_cypress/cypress/e2e/detection_response/rule_management/rule_details/execution_log.cy.ts @@ -12,14 +12,13 @@ import { login } from '../../../../tasks/login'; import { visit } from '../../../../tasks/navigation'; import { ruleDetailsUrl } from '../../../../urls/rule_details'; import { createRule } from '../../../../tasks/api_calls/rules'; -import { waitForAlertsToPopulate } from '../../../../tasks/create_new_rule'; import { goToExecutionLogTab, getExecutionLogTableRow, refreshRuleExecutionTable, filterByRunType, } from '../../../../tasks/rule_details'; -import { getNewRule } from '../../../../objects/rule'; +import { getCustomQueryRuleParams } from '../../../../objects/rule'; import { EXECUTION_SHOWING } from '../../../../screens/rule_details'; import { manualRuleRun } from '../../../../tasks/api_calls/backfill'; @@ -37,7 +36,9 @@ describe( login(); deleteAlertsAndRules(); createRule({ - ...getNewRule(), + ...getCustomQueryRuleParams({ + enabled: true, + }), }).then((rule) => { cy.wrap(rule.body.id).as('ruleId'); }); @@ -45,11 +46,23 @@ describe( it('should display the execution log', function () { visit(ruleDetailsUrl(this.ruleId)); - waitForAlertsToPopulate(); goToExecutionLogTab(); + cy.waitUntil( + () => { + cy.log('Waiting for execution logs to appear in execution log table'); + refreshRuleExecutionTable(); + return getExecutionLogTableRow().then((rows) => { + return rows.length > 0; + }); + }, + { interval: 5000, timeout: 20000 } + ); + cy.get(EXECUTION_SHOWING).contains('Showing 1 rule execution'); getExecutionLogTableRow().should('have.length', 1); + + cy.log('Scheduling a manual rule run'); manualRuleRun({ ruleId: this.ruleId, start: moment().subtract(5, 'm').toISOString(), @@ -61,14 +74,16 @@ describe( cy.log('Waiting for execution logs to appear in execution log table'); refreshRuleExecutionTable(); return getExecutionLogTableRow().then((rows) => { - return rows.length === 2; + return rows.length > 1; }); }, { interval: 5000, timeout: 20000 } ); + cy.get(EXECUTION_SHOWING).contains('Showing 2 rule executions'); - filterByRunType('Manual'); + getExecutionLogTableRow().should('have.length', 2); + filterByRunType('Manual'); getExecutionLogTableRow().should('have.length', 1); }); } diff --git a/x-pack/solutions/security/test/security_solution_cypress/cypress/tasks/api_calls/backfill.ts b/x-pack/solutions/security/test/security_solution_cypress/cypress/tasks/api_calls/backfill.ts index bfa495d78abd5..7bf7689962f01 100644 --- a/x-pack/solutions/security/test/security_solution_cypress/cypress/tasks/api_calls/backfill.ts +++ b/x-pack/solutions/security/test/security_solution_cypress/cypress/tasks/api_calls/backfill.ts @@ -27,8 +27,7 @@ export const manualRuleRun = ({ body: [ { rule_id: ruleId, - start, - end, + ranges: [{ start, end }], }, ], });