-
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] [Detections] Improves custom query rule upgrade test #114454
[Security Solution] [Detections] Improves custom query rule upgrade test #114454
Conversation
Pinging @elastic/security-solution (Team: SecuritySolution) |
Pinging @elastic/security-detections-response (Team:Detections and Resp) |
@elasticmachine merge upstream |
@elasticmachine merge upstream |
@elasticmachine merge upstream |
💚 Build SucceededMetrics [docs]
History
To update your PR or re-run it, just comment with: |
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.
Looks good in general, but I had one question about the behavior of tests without explicit assertions. Approving independent of an answer there, though.
We should update the cypress README to match these changes, if possible.
@@ -11,6 +11,7 @@ | |||
"cypress:open": "yarn cypress open --config-file ./cypress/cypress.json", | |||
"cypress:open:ccs": "yarn cypress:open --config integrationFolder=./cypress/ccs_integration", | |||
"cypress:open-as-ci": "node ../../../scripts/functional_tests --config ../../test/security_solution_cypress/visual_config.ts", | |||
"cypress:open:upgrade": "yarn cypress:open --config integrationFolder=./cypress/upgrade_integration", |
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.
We should document this new script in our README.
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.
Agree. The overall README of the upgrade tests is still in progress.
The nature of these upgrade
tests is completely different from the ones we are use to write. Everything is originated on the elastic stack repo, it creates a cloud deployment, generates the test data needed, and then upgrades to a different version. All of these, are done using gradle tasks.
Once all those steps are finished, it executes our upgrade cypress tests.
The best practices here are going to be slightly different from the ones we tend to use. I.E. We are not going to be able to clean the data between tests, since the time cost of spin-up an instance and upgrade it is huge.
At this point, I don't know what is the best way of writing these types of tests (as well as the data creation) for us and what should be the best practices. This is why I'm adding new tests, in order to explore and find it.
}); | ||
}); | ||
|
||
it('Displays the alert details', () => { |
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.
Since there are no explicit assertions in this test (just .contains
and .then
), what is the behavior here when an element is not present?
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.
I'm using here the contains instead of the have.text
assertion, because the elements are returning something like elementText Row1 Column1
. I tried different ways to get the text I wanted but was not able to do it.
Contains yields to the element that has the text we are expecting, then, we scroll left using the keyword. We have to scroll, because not all the elements are displayed on the screen making them not accessible for Cypress.
In case that the element is not present, the test fails (see below screenshot).
I would be more than happy to run a pair-programming session to find a better solution :)
Lots of thanks for the review @rylnd!! I replied to all your comments. Merging the PR but more than happy to improve the scenario and the overall upgrade automation in further PRs. |
…ide-users-to-saving-ux * 'master' of github.com:elastic/kibana: (133 commits) [DOCS] Indicate reports are a subscription feature (elastic#114653) Update namespace for indices (elastic#114612) [DOCS] Adds Logstash pipeline settings (elastic#114648) Bump EPR snapshot version used for tests (elastic#114529) [Security Solution] [Endpoint] Fleet summary card adjustments (elastic#114291) skip flaky suite (elastic#68400) [Visualizations] fix usage of optional dependencies (elastic#114286) [Security Solution] [Detections] Improves custom query rule upgrade test (elastic#114454) [fleet] Add Integration Preference selector (elastic#114432) [Reporting] Add new `data-render-error` attribute (elastic#114472) Replace EuiCodeEditor with CodeEditor in app-services code (elastic#114316) [data views] add getDefaultDataView method (elastic#113891) [Security Solution] [Endpoint] Event filters uses the new card design (elastic#114126) [fleet] Tweak Header UI (elastic#114704) [APM] Filter on tx metrics for instance stats (elastic#114758) [APM] Fix typo in linting docs (elastic#114764) [Discover] Removing SavedObject usage for savedSearch (elastic#112983) [Fleet] Add Integration Policy Page Improvements (elastic#114556) [Lens] Keep the custom label when transitioning to/from Formula (elastic#114270) [Security Solution][Endpoint] Host Isolation API changes (elastic#113621) ...
Summary
In this PR we are improving the custom query rule upgrade test.
Note: This PR should be merged after https://github.com/elastic/elastic-stack-testing/pull/1055