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

[SIEM] Improves event viewer Cypress tests time execution #54117

Merged
merged 4 commits into from
Jan 10, 2020

Conversation

MadameSheema
Copy link
Member

@MadameSheema MadameSheema commented Jan 7, 2020

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.

@elasticmachine
Copy link
Contributor

Pinging @elastic/siem (Team:SIEM)


filterSearchBar(filterInput);
beforeEach(() => {
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

great add! 😄

Copy link
Contributor

@andrew-goldstein andrew-goldstein left a 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 an afterEach. When designing your tests, carefully consider whether or not the cleanup code in the afterEach 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 new context and perform a full page refresh to ensure this.)

To test this PR, I ran the Events Viewer test suite locally:
grouped-tests

LGTM ⌛️ 🚀

@MadameSheema
Copy link
Member Author

@elasticmachine merge upstream

@kibanamachine
Copy link
Contributor

💚 Build Succeeded

History

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

@MadameSheema MadameSheema merged commit 07d56f7 into elastic:master Jan 10, 2020
@MadameSheema MadameSheema deleted the events-viewer-refactor branch January 10, 2020 12:46
MadameSheema added a commit to MadameSheema/kibana that referenced this pull request Jan 10, 2020
)

* groups tests in context

* makes tests fully order-independent

* updates Readme file

Co-authored-by: Elastic Machine <elasticmachine@users.noreply.github.com>
MadameSheema added a commit that referenced this pull request Jan 10, 2020
…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>
thomasneirynck pushed a commit to thomasneirynck/kibana that referenced this pull request Jan 12, 2020
)

* groups tests in context

* makes tests fully order-independent

* updates Readme file

Co-authored-by: Elastic Machine <elasticmachine@users.noreply.github.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
release_note:skip Skip the PR/issue when compiling release notes Team:SIEM v7.6.0 v8.0.0
Projects
None yet
Development

Successfully merging this pull request may close these issues.

5 participants