-
Notifications
You must be signed in to change notification settings - Fork 8.2k
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
[SIEM] Improves event viewer Cypress tests time execution #54117
[SIEM] Improves event viewer Cypress tests time execution #54117
Conversation
Pinging @elastic/siem (Team:SIEM) |
|
||
filterSearchBar(filterInput); | ||
beforeEach(() => { |
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.
great add! 😄
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.
Per our out-of-band team discussion, the team agrees to adopt the new patterns introduced in this PR:
- To reduce the overall time it takes to execute the test suite, full page refreshes will no longer be performed (to reset state) before each test (
it
block) executes - Instead, tests within a
context
, will login and navigate to the page under test just once. - Within a
context
, reset state (e.g. "close the modal") in anafterEach
. When designing your tests, carefully consider whether or not the cleanup code in theafterEach
is sufficient to fully reset state if/when a previous test fails at an arbitrary step. - All tests in a
.spec
must (as usual), remain order-independent. (Sometimes, it may be necessary to create a newcontext
and perform a full page refresh to ensure this.)
To test this PR, I ran the Events Viewer
test suite locally:
LGTM ⌛️ 🚀
@elasticmachine merge upstream |
💚 Build SucceededHistory
To update your PR or re-run it, just comment with: |
…54444) * groups tests in context * makes tests fully order-independent * updates Readme file Co-authored-by: Elastic Machine <elasticmachine@users.noreply.github.com> Co-authored-by: Elastic Machine <elasticmachine@users.noreply.github.com>
Summary
Improves the Events Viewer tests time execution from 172s to 94s grouping the tests by context.
In most cases we don't need to login to the application all the time since most of the tests it can be seen as different checks of a same test.