-
Notifications
You must be signed in to change notification settings - Fork 8.3k
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
[Security Solution] Unskip Serverless Threshold rule creation Cypress test #167083
[Security Solution] Unskip Serverless Threshold rule creation Cypress test #167083
Conversation
37a8444
to
71db29d
Compare
Pinging @elastic/security-detections-response (Team:Detections and Resp) |
Pinging @elastic/security-solution (Team: SecuritySolution) |
@elasticmachine merge upstream |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thank you @maximpn, reviewed the diff and left some (mostly minor) comments!
...est/security_solution_cypress/cypress/e2e/detection_response/rule_actions/rule_actions.cy.ts
Outdated
Show resolved
Hide resolved
...ution_cypress/cypress/e2e/detection_response/rule_creation/custom_query_rule_data_view.cy.ts
Outdated
Show resolved
Hide resolved
..._solution_cypress/cypress/e2e/detection_response/rule_creation/custom_saved_query_rule.cy.ts
Outdated
Show resolved
Hide resolved
...y_solution_cypress/cypress/e2e/detection_response/rule_creation/event_correlation_rule.cy.ts
Outdated
Show resolved
Hide resolved
export const RULES_TABLE_BREADCRUMB = | ||
'[data-test-subj~="breadcrumb"][title="Detection rules (SIEM)"]'; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
(Some general thoughts) Breadcrumbs tend to change pretty often. Sometimes their structure changes (the tree), sometimes they are renamed. I think they changed at least twice during the last two releases.
So when SPA navigation is important for testing certain scenarios (such as making sure that the Rules table gets refreshed after some change), I think it might be OK-ish to use breadcrumbs for doing it. Although it would be great to use more stable UI elements (when they exist) or ways for doing SPA navigation. In theory, one way could be using the browser History API (.pushState()
and .back()
methods) directly from tests. There's an article with a short example: https://glebbahmutov.com/blog/cypress-history-api-example/
When SPA navigation is not required for testing something specific, we should be just opening pages by their URLs.
x-pack/test/security_solution_cypress/cypress/screens/breadcrumbs.ts
Outdated
Show resolved
Hide resolved
x-pack/test/security_solution_cypress/cypress/screens/breadcrumbs.ts
Outdated
Show resolved
Hide resolved
x-pack/test/security_solution_cypress/cypress/screens/breadcrumbs.ts
Outdated
Show resolved
Hide resolved
x-pack/test/security_solution_cypress/cypress/tasks/navigation.ts
Outdated
Show resolved
Hide resolved
x-pack/test/security_solution_cypress/cypress/tasks/navigation.ts
Outdated
Show resolved
Hide resolved
@elasticmachine merge upstream |
1254fc2
to
b1acbdb
Compare
b1acbdb
to
e1da76d
Compare
💛 Build succeeded, but was flaky
Failed CI StepsTest Failures
Metrics [docs]
History
To update your PR or re-run it, just comment with: cc @maximpn |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM 👍
Addresses: #161539
Summary
This PR unskips Threshold rule creation Cypress tests.
Details
To unskip the test with minimal changes it required to refactor navigation via breadcrumbs and update rules table breadcrumb selectors to make navigation back to the rules table work seamlessly between ESS and Serverless.
Flaky Test runner
Serverless threshold_rule.cy.ts 150 runs 🟢