Skip to content

Commit 652f18e

Browse files
committed
[Security Solution] Fix some Prebuilt Rules Cypress tests not running in CI (#191978)
**Resolves: #192256 ## Summary This PR re-enables two Cypress test files that didn't run on CI: `update_workflow.cy.ts` and `prebuilt_rules_preview.cy.ts`. It also fixes failing tests in `prebuilt_rules_preview.cy.ts`. ### Changes - Renamed `update_workflow.ts` -> `update_workflow.cy.ts`. It didn't run on CI because it wasn't picked up by a glob [here](https://github.com/elastic/kibana/blob/main/x-pack/test/security_solution_cypress/package.json#L14). - `prebuilt_rules_preview.cy.ts`: - Moved `{ tags: ['@ess', '@serverless'] }` to the top-level `describe` block instead of having it in a variable that is used in every `describe`. Apparently the tool we use to parse tags doesn't recognize tags in variables anymore, so this test didn't run in either ESS or Serverless pipelines. - Removed `describe('All environments' ... ` wrappers since they don't add any value anymore. Didn't remove any actual tests. - Reverted a change from this [PR](#181427) that added a backdrop to the modal which doesn't allow user to switch rules without closing the modal. We have a [test](https://github.com/elastic/kibana/blob/main/x-pack/test/security_solution_cypress/cypress/e2e/detection_response/rule_management/prebuilt_rules/prebuilt_rules_preview.cy.ts#L1182) that checks that such switching is possible and this test started to fail once I reactivated the test file. - Fixed selectors that grab filters in the Overview tab. The old ones stopped working. Probably because of a change to the filters component that is built by another team. #### Correct behaviour: Switching between rules with flyout open https://github.com/user-attachments/assets/da4a0902-657c-45fe-adc1-eb44ad0de798 (cherry picked from commit c65c2ae)
1 parent 21b86ae commit 652f18e

5 files changed

Lines changed: 643 additions & 680 deletions

File tree

x-pack/plugins/security_solution/docs/testing/test_plans/detection_response/prebuilt_rules/installation_and_upgrade.md

Lines changed: 6 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -631,13 +631,9 @@ Given no prebuilt rules are installed in Kibana
631631
And there are X prebuilt rules of all types available to install
632632
When user opens the Add Rules page
633633
Then all X rules available for installation should be displayed in the table
634-
When user opens the rule preview for the 1st rule
635-
Then the preview should open
636-
And all properties of the 1st rule should be displayed in the correct tab and section of the preview (see examples of rule properties above)
637-
When user selects the 2nd rule in the table
638-
Then the preview should be updated
639-
And all properties of the 2nd rule should be displayed in the correct tab and section of the preview (see examples of rule properties above)
640-
And user should be able to repeat this for all X rules
634+
When user opens a rule preview for any rule
635+
Then the preview should appear
636+
And all properties of a rule should be displayed in the correct tab and section of the preview (see examples of rule properties above)
641637
```
642638

643639
#### **Scenario: Tabs and sections without content should be hidden in preview before installing**
@@ -783,15 +779,11 @@ And for all of the installed rules there are new versions available
783779
And user is on the Rule Management page
784780
When user opens the Rule Updates table
785781
Then all X rules available for upgrade should be displayed in the table
786-
When user opens the rule preview for the 1st rule
787-
Then the preview should open
782+
When user opens a rule preview for any rule
783+
Then the preview should appear
788784
And the "Updates" tab should be active
789785
When user selects the "Overview" tab
790-
Then all properties of the new version of the 1st rule should be displayed in the correct tab and section of the preview (see examples of rule properties above)
791-
When user selects the 2nd rule in the table
792-
Then the preview should be updated
793-
And all properties of the new version of the 2nd rule should be displayed in the correct tab and section of the preview (see examples of rule properties above)
794-
And user should be able to repeat this for all X rules
786+
Then all properties of the new version of a rule should be displayed in the correct tab and section of the preview (see examples of rule properties above)
795787
```
796788

797789
#### **Scenario: Tabs and sections without content should be hidden in preview before upgrading**

0 commit comments

Comments
 (0)