Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix: [Rules > Add Elastic rules][SCREEN READER]: Rule non-modal flyout must announce itself on render and manage focus #181427

Merged
merged 4 commits into from
Apr 25, 2024

Conversation

alexwizp
Copy link
Contributor

@alexwizp alexwizp commented Apr 23, 2024

Closes: https://github.com/elastic/security-team/issues/8657

Summary

The part about announcing the title was fixed in that PR: #180888. This PR removed the incorrect 'ownFocus = { false }' parameter for EuiFlyout. Since that flyout overlaps the table, we should not open it with that option.

Screen

image

Eui documentation

https://eui.elastic.co/#/layout/flyout#without-ownfocus

@alexwizp
Copy link
Contributor Author

/сi

@alexwizp alexwizp added v8.14.0 v8.15.0 Team: SecuritySolution Security Solutions Team working on SIEM, Endpoint, Timeline, Resolver, etc. release_note:skip Skip the PR/issue when compiling release notes Feature:Rule Management Security Solution Detection Rule Management area Team:Detection Rule Management Security Detection Rule Management Team labels Apr 23, 2024
@alexwizp alexwizp marked this pull request as ready for review April 23, 2024 12:36
@alexwizp alexwizp requested a review from a team as a code owner April 23, 2024 12:36
@alexwizp alexwizp requested a review from dplumlee April 23, 2024 12:36
@elasticmachine
Copy link
Contributor

Pinging @elastic/security-solution (Team: SecuritySolution)

@elasticmachine
Copy link
Contributor

Pinging @elastic/security-detection-rule-management (Team:Detection Rule Management)

@kibana-ci
Copy link
Collaborator

💛 Build succeeded, but was flaky

Failed CI Steps

Test Failures

  • [job] [logs] Jest Tests #5 / useGetEndpointSecurityPackage hook throws when the service fails to retrieve the endpoint package

Metrics [docs]

✅ unchanged

History

To update your PR or re-run it, just comment with:
@elasticmachine merge upstream

@alexwizp alexwizp merged commit 482766e into elastic:main Apr 25, 2024
35 checks passed
kibanamachine pushed a commit to kibanamachine/kibana that referenced this pull request Apr 25, 2024
…t must announce itself on render and manage focus (elastic#181427)

Closes: elastic/security-team#8657

## Summary

The part about announcing the title was fixed in that PR:
elastic#180888. This PR removed the
incorrect 'ownFocus = { false }' parameter for `EuiFlyout`. Since that
flyout overlaps the table, we should not open it with that option.

### Screen

![image](https://github.com/elastic/kibana/assets/20072247/50883abb-7a76-4819-8df4-530c81d1a48c)

#### Eui documentation
https://eui.elastic.co/#/layout/flyout#without-ownfocus
(cherry picked from commit 482766e)
@kibanamachine
Copy link
Contributor

💚 All backports created successfully

Status Branch Result
8.14

Note: Successful backport PRs will be merged automatically after passing CI.

Questions ?

Please refer to the Backport tool documentation

kibanamachine added a commit that referenced this pull request Apr 25, 2024
…odal flyout must announce itself on render and manage focus (#181427) (#181658)

# Backport

This will backport the following commits from `main` to `8.14`:
- [fix: [Rules > Add Elastic rules][SCREEN READER]: Rule non-modal
flyout must announce itself on render and manage focus
(#181427)](#181427)

<!--- Backport version: 9.4.3 -->

### Questions ?
Please refer to the [Backport tool
documentation](https://github.com/sqren/backport)

<!--BACKPORT [{"author":{"name":"Alexey
Antonov","email":"alexwizp@gmail.com"},"sourceCommit":{"committedDate":"2024-04-25T08:11:43Z","message":"fix:
[Rules > Add Elastic rules][SCREEN READER]: Rule non-modal flyout must
announce itself on render and manage focus (#181427)\n\nCloses:
https://github.com/elastic/security-team/issues/8657\r\n\r\n##
Summary\r\n\r\nThe part about announcing the title was fixed in that
PR:\r\nhttps://github.com//pull/180888. This PR removed
the\r\nincorrect 'ownFocus = { false }' parameter for `EuiFlyout`. Since
that\r\nflyout overlaps the table, we should not open it with that
option.\r\n\r\n### Screen
\r\n\r\n\r\n![image](https://github.com/elastic/kibana/assets/20072247/50883abb-7a76-4819-8df4-530c81d1a48c)\r\n\r\n####
Eui
documentation\r\nhttps://eui.elastic.co/#/layout/flyout#without-ownfocus","sha":"482766e0bfcf2a2297135a3084e0286e22bed888","branchLabelMapping":{"^v8.15.0$":"main","^v(\\d+).(\\d+).\\d+$":"$1.$2"}},"sourcePullRequest":{"labels":["release_note:skip","Team:
SecuritySolution","Feature:Rule Management","Team:Detection Rule
Management","v8.14.0","v8.15.0"],"title":"fix: [Rules > Add Elastic
rules][SCREEN READER]: Rule non-modal flyout must announce itself on
render and manage
focus","number":181427,"url":"https://github.com/elastic/kibana/pull/181427","mergeCommit":{"message":"fix:
[Rules > Add Elastic rules][SCREEN READER]: Rule non-modal flyout must
announce itself on render and manage focus (#181427)\n\nCloses:
https://github.com/elastic/security-team/issues/8657\r\n\r\n##
Summary\r\n\r\nThe part about announcing the title was fixed in that
PR:\r\nhttps://github.com//pull/180888. This PR removed
the\r\nincorrect 'ownFocus = { false }' parameter for `EuiFlyout`. Since
that\r\nflyout overlaps the table, we should not open it with that
option.\r\n\r\n### Screen
\r\n\r\n\r\n![image](https://github.com/elastic/kibana/assets/20072247/50883abb-7a76-4819-8df4-530c81d1a48c)\r\n\r\n####
Eui
documentation\r\nhttps://eui.elastic.co/#/layout/flyout#without-ownfocus","sha":"482766e0bfcf2a2297135a3084e0286e22bed888"}},"sourceBranch":"main","suggestedTargetBranches":["8.14"],"targetPullRequestStates":[{"branch":"8.14","label":"v8.14.0","branchLabelMappingKey":"^v(\\d+).(\\d+).\\d+$","isSourceBranch":false,"state":"NOT_CREATED"},{"branch":"main","label":"v8.15.0","branchLabelMappingKey":"^v8.15.0$","isSourceBranch":true,"state":"MERGED","url":"https://github.com/elastic/kibana/pull/181427","number":181427,"mergeCommit":{"message":"fix:
[Rules > Add Elastic rules][SCREEN READER]: Rule non-modal flyout must
announce itself on render and manage focus (#181427)\n\nCloses:
https://github.com/elastic/security-team/issues/8657\r\n\r\n##
Summary\r\n\r\nThe part about announcing the title was fixed in that
PR:\r\nhttps://github.com//pull/180888. This PR removed
the\r\nincorrect 'ownFocus = { false }' parameter for `EuiFlyout`. Since
that\r\nflyout overlaps the table, we should not open it with that
option.\r\n\r\n### Screen
\r\n\r\n\r\n![image](https://github.com/elastic/kibana/assets/20072247/50883abb-7a76-4819-8df4-530c81d1a48c)\r\n\r\n####
Eui
documentation\r\nhttps://eui.elastic.co/#/layout/flyout#without-ownfocus","sha":"482766e0bfcf2a2297135a3084e0286e22bed888"}}]}]
BACKPORT-->

Co-authored-by: Alexey Antonov <alexwizp@gmail.com>
kpatticha pushed a commit to kpatticha/kibana that referenced this pull request Apr 26, 2024
…t must announce itself on render and manage focus (elastic#181427)

Closes: elastic/security-team#8657

## Summary

The part about announcing the title was fixed in that PR:
elastic#180888. This PR removed the
incorrect 'ownFocus = { false }' parameter for `EuiFlyout`. Since that
flyout overlaps the table, we should not open it with that option.

### Screen 


![image](https://github.com/elastic/kibana/assets/20072247/50883abb-7a76-4819-8df4-530c81d1a48c)

#### Eui documentation
https://eui.elastic.co/#/layout/flyout#without-ownfocus
@nikitaindik
Copy link
Contributor

Actually in this case being able to click on the table items with the flyout open is a feature. User may want to quickly switch between rules to preview the diff.

Schermopname.2024-09-05.om.16.54.44.mov

We even had a Cypress test here to check this behaviour, but it stopped running on CI at some point due to a misconfiguration 🤦.

Anyways, just FYI, I'll revert this change in PR #191978.

nikitaindik added a commit that referenced this pull request Sep 13, 2024
… 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
kibanamachine pushed a commit to kibanamachine/kibana that referenced this pull request Sep 13, 2024
… in CI (elastic#191978)

**Resolves: elastic#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](elastic#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)
kibanamachine pushed a commit to kibanamachine/kibana that referenced this pull request Sep 13, 2024
… in CI (elastic#191978)

**Resolves: elastic#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](elastic#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)
nikitaindik added a commit to nikitaindik/kibana that referenced this pull request Sep 13, 2024
… in CI (elastic#191978)

**Resolves: elastic#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](elastic#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)
kibanamachine added a commit that referenced this pull request Sep 13, 2024
…running in CI (#191978) (#192852)

# Backport

This will backport the following commits from `main` to `8.15`:
- [[Security Solution] Fix some Prebuilt Rules Cypress tests not running
in CI (#191978)](#191978)

<!--- Backport version: 9.4.3 -->

### Questions ?
Please refer to the [Backport tool
documentation](https://github.com/sqren/backport)

<!--BACKPORT [{"author":{"name":"Nikita
Indik","email":"nikita.indik@elastic.co"},"sourceCommit":{"committedDate":"2024-09-13T12:00:57Z","message":"[Security
Solution] Fix some Prebuilt Rules Cypress tests not running in CI
(#191978)\n\n**Resolves:
https://github.com/elastic/kibana/issues/192256**\r\n\r\n##
Summary\r\n\r\nThis PR re-enables two Cypress test files that didn't run
on CI:\r\n`update_workflow.cy.ts` and `prebuilt_rules_preview.cy.ts`. It
also\r\nfixes failing tests in
`prebuilt_rules_preview.cy.ts`.\r\n\r\n### Changes\r\n- Renamed
`update_workflow.ts` -> `update_workflow.cy.ts`. It didn't run\r\non CI
because it wasn't picked up by a
glob\r\n[here](https://github.com/elastic/kibana/blob/main/x-pack/test/security_solution_cypress/package.json#L14).\r\n
- `prebuilt_rules_preview.cy.ts`:\r\n- Moved `{ tags: ['@ess',
'@serverless'] }` to the top-level `describe`\r\nblock instead of having
it in a variable that is used in every\r\n`describe`. Apparently the
tool we use to parse tags doesn't recognize\r\ntags in variables
anymore, so this test didn't run in either ESS or\r\nServerless
pipelines.\r\n- Removed `describe('All environments' ... ` wrappers
since they don't\r\nadd any value anymore. Didn't remove any actual
tests.\r\n- Reverted a change from
this\r\n[PR](#181427) that added
a\r\nbackdrop to the modal which doesn't allow user to switch rules
without\r\nclosing the modal. We have
a\r\n[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)\r\nthat
checks that such switching is possible and this test started to\r\nfail
once I reactivated the test file.\r\n- Fixed selectors that grab filters
in the Overview tab. The old ones\r\nstopped working. Probably because
of a change to the filters component\r\nthat is built by another
team.\r\n\r\n\r\n#### Correct behaviour: Switching between rules with
flyout
open\r\n\r\nhttps://github.com/user-attachments/assets/da4a0902-657c-45fe-adc1-eb44ad0de798","sha":"c65c2ae4900a9f75db872cee056af35ff5f79cdc","branchLabelMapping":{"^v9.0.0$":"main","^v8.16.0$":"8.x","^v(\\d+).(\\d+).\\d+$":"$1.$2"}},"sourcePullRequest":{"labels":["release_note:skip","v9.0.0","Team:Detections
and Resp","Team: SecuritySolution","Team:Detection Rule
Management","backport:prev-major","v8.16.0"],"title":"[Security
Solution] Fix some Prebuilt Rules Cypress tests not running in
CI","number":191978,"url":"https://github.com/elastic/kibana/pull/191978","mergeCommit":{"message":"[Security
Solution] Fix some Prebuilt Rules Cypress tests not running in CI
(#191978)\n\n**Resolves:
https://github.com/elastic/kibana/issues/192256**\r\n\r\n##
Summary\r\n\r\nThis PR re-enables two Cypress test files that didn't run
on CI:\r\n`update_workflow.cy.ts` and `prebuilt_rules_preview.cy.ts`. It
also\r\nfixes failing tests in
`prebuilt_rules_preview.cy.ts`.\r\n\r\n### Changes\r\n- Renamed
`update_workflow.ts` -> `update_workflow.cy.ts`. It didn't run\r\non CI
because it wasn't picked up by a
glob\r\n[here](https://github.com/elastic/kibana/blob/main/x-pack/test/security_solution_cypress/package.json#L14).\r\n
- `prebuilt_rules_preview.cy.ts`:\r\n- Moved `{ tags: ['@ess',
'@serverless'] }` to the top-level `describe`\r\nblock instead of having
it in a variable that is used in every\r\n`describe`. Apparently the
tool we use to parse tags doesn't recognize\r\ntags in variables
anymore, so this test didn't run in either ESS or\r\nServerless
pipelines.\r\n- Removed `describe('All environments' ... ` wrappers
since they don't\r\nadd any value anymore. Didn't remove any actual
tests.\r\n- Reverted a change from
this\r\n[PR](#181427) that added
a\r\nbackdrop to the modal which doesn't allow user to switch rules
without\r\nclosing the modal. We have
a\r\n[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)\r\nthat
checks that such switching is possible and this test started to\r\nfail
once I reactivated the test file.\r\n- Fixed selectors that grab filters
in the Overview tab. The old ones\r\nstopped working. Probably because
of a change to the filters component\r\nthat is built by another
team.\r\n\r\n\r\n#### Correct behaviour: Switching between rules with
flyout
open\r\n\r\nhttps://github.com/user-attachments/assets/da4a0902-657c-45fe-adc1-eb44ad0de798","sha":"c65c2ae4900a9f75db872cee056af35ff5f79cdc"}},"sourceBranch":"main","suggestedTargetBranches":["8.x"],"targetPullRequestStates":[{"branch":"main","label":"v9.0.0","branchLabelMappingKey":"^v9.0.0$","isSourceBranch":true,"state":"MERGED","url":"https://github.com/elastic/kibana/pull/191978","number":191978,"mergeCommit":{"message":"[Security
Solution] Fix some Prebuilt Rules Cypress tests not running in CI
(#191978)\n\n**Resolves:
https://github.com/elastic/kibana/issues/192256**\r\n\r\n##
Summary\r\n\r\nThis PR re-enables two Cypress test files that didn't run
on CI:\r\n`update_workflow.cy.ts` and `prebuilt_rules_preview.cy.ts`. It
also\r\nfixes failing tests in
`prebuilt_rules_preview.cy.ts`.\r\n\r\n### Changes\r\n- Renamed
`update_workflow.ts` -> `update_workflow.cy.ts`. It didn't run\r\non CI
because it wasn't picked up by a
glob\r\n[here](https://github.com/elastic/kibana/blob/main/x-pack/test/security_solution_cypress/package.json#L14).\r\n
- `prebuilt_rules_preview.cy.ts`:\r\n- Moved `{ tags: ['@ess',
'@serverless'] }` to the top-level `describe`\r\nblock instead of having
it in a variable that is used in every\r\n`describe`. Apparently the
tool we use to parse tags doesn't recognize\r\ntags in variables
anymore, so this test didn't run in either ESS or\r\nServerless
pipelines.\r\n- Removed `describe('All environments' ... ` wrappers
since they don't\r\nadd any value anymore. Didn't remove any actual
tests.\r\n- Reverted a change from
this\r\n[PR](#181427) that added
a\r\nbackdrop to the modal which doesn't allow user to switch rules
without\r\nclosing the modal. We have
a\r\n[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)\r\nthat
checks that such switching is possible and this test started to\r\nfail
once I reactivated the test file.\r\n- Fixed selectors that grab filters
in the Overview tab. The old ones\r\nstopped working. Probably because
of a change to the filters component\r\nthat is built by another
team.\r\n\r\n\r\n#### Correct behaviour: Switching between rules with
flyout
open\r\n\r\nhttps://github.com/user-attachments/assets/da4a0902-657c-45fe-adc1-eb44ad0de798","sha":"c65c2ae4900a9f75db872cee056af35ff5f79cdc"}},{"branch":"8.x","label":"v8.16.0","branchLabelMappingKey":"^v8.16.0$","isSourceBranch":false,"state":"NOT_CREATED"}]}]
BACKPORT-->

Co-authored-by: Nikita Indik <nikita.indik@elastic.co>
kibanamachine added a commit that referenced this pull request Sep 13, 2024
…unning in CI (#191978) (#192853)

# Backport

This will backport the following commits from `main` to `8.x`:
- [[Security Solution] Fix some Prebuilt Rules Cypress tests not running
in CI (#191978)](#191978)

<!--- Backport version: 9.4.3 -->

### Questions ?
Please refer to the [Backport tool
documentation](https://github.com/sqren/backport)

<!--BACKPORT [{"author":{"name":"Nikita
Indik","email":"nikita.indik@elastic.co"},"sourceCommit":{"committedDate":"2024-09-13T12:00:57Z","message":"[Security
Solution] Fix some Prebuilt Rules Cypress tests not running in CI
(#191978)\n\n**Resolves:
https://github.com/elastic/kibana/issues/192256**\r\n\r\n##
Summary\r\n\r\nThis PR re-enables two Cypress test files that didn't run
on CI:\r\n`update_workflow.cy.ts` and `prebuilt_rules_preview.cy.ts`. It
also\r\nfixes failing tests in
`prebuilt_rules_preview.cy.ts`.\r\n\r\n### Changes\r\n- Renamed
`update_workflow.ts` -> `update_workflow.cy.ts`. It didn't run\r\non CI
because it wasn't picked up by a
glob\r\n[here](https://github.com/elastic/kibana/blob/main/x-pack/test/security_solution_cypress/package.json#L14).\r\n
- `prebuilt_rules_preview.cy.ts`:\r\n- Moved `{ tags: ['@ess',
'@serverless'] }` to the top-level `describe`\r\nblock instead of having
it in a variable that is used in every\r\n`describe`. Apparently the
tool we use to parse tags doesn't recognize\r\ntags in variables
anymore, so this test didn't run in either ESS or\r\nServerless
pipelines.\r\n- Removed `describe('All environments' ... ` wrappers
since they don't\r\nadd any value anymore. Didn't remove any actual
tests.\r\n- Reverted a change from
this\r\n[PR](#181427) that added
a\r\nbackdrop to the modal which doesn't allow user to switch rules
without\r\nclosing the modal. We have
a\r\n[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)\r\nthat
checks that such switching is possible and this test started to\r\nfail
once I reactivated the test file.\r\n- Fixed selectors that grab filters
in the Overview tab. The old ones\r\nstopped working. Probably because
of a change to the filters component\r\nthat is built by another
team.\r\n\r\n\r\n#### Correct behaviour: Switching between rules with
flyout
open\r\n\r\nhttps://github.com/user-attachments/assets/da4a0902-657c-45fe-adc1-eb44ad0de798","sha":"c65c2ae4900a9f75db872cee056af35ff5f79cdc","branchLabelMapping":{"^v9.0.0$":"main","^v8.16.0$":"8.x","^v(\\d+).(\\d+).\\d+$":"$1.$2"}},"sourcePullRequest":{"labels":["release_note:skip","v9.0.0","Team:Detections
and Resp","Team: SecuritySolution","Team:Detection Rule
Management","backport:prev-major","v8.16.0"],"title":"[Security
Solution] Fix some Prebuilt Rules Cypress tests not running in
CI","number":191978,"url":"https://github.com/elastic/kibana/pull/191978","mergeCommit":{"message":"[Security
Solution] Fix some Prebuilt Rules Cypress tests not running in CI
(#191978)\n\n**Resolves:
https://github.com/elastic/kibana/issues/192256**\r\n\r\n##
Summary\r\n\r\nThis PR re-enables two Cypress test files that didn't run
on CI:\r\n`update_workflow.cy.ts` and `prebuilt_rules_preview.cy.ts`. It
also\r\nfixes failing tests in
`prebuilt_rules_preview.cy.ts`.\r\n\r\n### Changes\r\n- Renamed
`update_workflow.ts` -> `update_workflow.cy.ts`. It didn't run\r\non CI
because it wasn't picked up by a
glob\r\n[here](https://github.com/elastic/kibana/blob/main/x-pack/test/security_solution_cypress/package.json#L14).\r\n
- `prebuilt_rules_preview.cy.ts`:\r\n- Moved `{ tags: ['@ess',
'@serverless'] }` to the top-level `describe`\r\nblock instead of having
it in a variable that is used in every\r\n`describe`. Apparently the
tool we use to parse tags doesn't recognize\r\ntags in variables
anymore, so this test didn't run in either ESS or\r\nServerless
pipelines.\r\n- Removed `describe('All environments' ... ` wrappers
since they don't\r\nadd any value anymore. Didn't remove any actual
tests.\r\n- Reverted a change from
this\r\n[PR](#181427) that added
a\r\nbackdrop to the modal which doesn't allow user to switch rules
without\r\nclosing the modal. We have
a\r\n[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)\r\nthat
checks that such switching is possible and this test started to\r\nfail
once I reactivated the test file.\r\n- Fixed selectors that grab filters
in the Overview tab. The old ones\r\nstopped working. Probably because
of a change to the filters component\r\nthat is built by another
team.\r\n\r\n\r\n#### Correct behaviour: Switching between rules with
flyout
open\r\n\r\nhttps://github.com/user-attachments/assets/da4a0902-657c-45fe-adc1-eb44ad0de798","sha":"c65c2ae4900a9f75db872cee056af35ff5f79cdc"}},"sourceBranch":"main","suggestedTargetBranches":["8.x"],"targetPullRequestStates":[{"branch":"main","label":"v9.0.0","branchLabelMappingKey":"^v9.0.0$","isSourceBranch":true,"state":"MERGED","url":"https://github.com/elastic/kibana/pull/191978","number":191978,"mergeCommit":{"message":"[Security
Solution] Fix some Prebuilt Rules Cypress tests not running in CI
(#191978)\n\n**Resolves:
https://github.com/elastic/kibana/issues/192256**\r\n\r\n##
Summary\r\n\r\nThis PR re-enables two Cypress test files that didn't run
on CI:\r\n`update_workflow.cy.ts` and `prebuilt_rules_preview.cy.ts`. It
also\r\nfixes failing tests in
`prebuilt_rules_preview.cy.ts`.\r\n\r\n### Changes\r\n- Renamed
`update_workflow.ts` -> `update_workflow.cy.ts`. It didn't run\r\non CI
because it wasn't picked up by a
glob\r\n[here](https://github.com/elastic/kibana/blob/main/x-pack/test/security_solution_cypress/package.json#L14).\r\n
- `prebuilt_rules_preview.cy.ts`:\r\n- Moved `{ tags: ['@ess',
'@serverless'] }` to the top-level `describe`\r\nblock instead of having
it in a variable that is used in every\r\n`describe`. Apparently the
tool we use to parse tags doesn't recognize\r\ntags in variables
anymore, so this test didn't run in either ESS or\r\nServerless
pipelines.\r\n- Removed `describe('All environments' ... ` wrappers
since they don't\r\nadd any value anymore. Didn't remove any actual
tests.\r\n- Reverted a change from
this\r\n[PR](#181427) that added
a\r\nbackdrop to the modal which doesn't allow user to switch rules
without\r\nclosing the modal. We have
a\r\n[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)\r\nthat
checks that such switching is possible and this test started to\r\nfail
once I reactivated the test file.\r\n- Fixed selectors that grab filters
in the Overview tab. The old ones\r\nstopped working. Probably because
of a change to the filters component\r\nthat is built by another
team.\r\n\r\n\r\n#### Correct behaviour: Switching between rules with
flyout
open\r\n\r\nhttps://github.com/user-attachments/assets/da4a0902-657c-45fe-adc1-eb44ad0de798","sha":"c65c2ae4900a9f75db872cee056af35ff5f79cdc"}},{"branch":"8.x","label":"v8.16.0","branchLabelMappingKey":"^v8.16.0$","isSourceBranch":false,"state":"NOT_CREATED"}]}]
BACKPORT-->

Co-authored-by: Nikita Indik <nikita.indik@elastic.co>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Feature:Rule Management Security Solution Detection Rule Management area release_note:skip Skip the PR/issue when compiling release notes Team:Detection Rule Management Security Detection Rule Management Team Team: SecuritySolution Security Solutions Team working on SIEM, Endpoint, Timeline, Resolver, etc. v8.14.0 v8.15.0
Projects
None yet
Development

Successfully merging this pull request may close these issues.

6 participants