-
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
Changes from all commits
b36822c
cfc70c2
7109ef3
c1eedcd
934b325
627b95a
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -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 commentThe 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 commentThe 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 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. |
||
"cypress:run": "yarn cypress:run:reporter --browser chrome --spec './cypress/integration/**/*.spec.ts'; status=$?; yarn junit:merge && exit $status", | ||
"cypress:run:firefox": "yarn cypress:run:reporter --browser firefox --spec './cypress/integration/**/*.spec.ts'; status=$?; yarn junit:merge && exit $status", | ||
"cypress:run:reporter": "yarn cypress run --config-file ./cypress/cypress.json --reporter ../../../node_modules/cypress-multi-reporters --reporter-options configFile=./cypress/reporter_config.json", | ||
|
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 likeelementText 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 :)