-
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] Reusing Cypress tests POC1 #162023
Conversation
3462630
to
07cac70
Compare
6323912
to
ee2d46b
Compare
e6b07a9
to
72d584c
Compare
💔 Build FailedFailed CI Steps
Test FailuresMetrics [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.
@MadameSheema I'm in favor of the 2nd POC that uses tagging.
This POC proposes to split tests into this kind of three folders:
x-pack/plugins/security_solution/cypress/e2e
for ESS testsx-pack/test_serverless/functional/test_suites/security/cypress/e2e
for Serverless testsx-pack/test/security_solution_cypress/e2e
for tests that can run both against ESS and Serverless
I think this would:
- make it hard to reason about what tests are kept where, just because 2/3 of path names are not explicit about that
- force us to jump between folders all the time; jumping between distant folders is poor DX and takes more time usually
- as you mentioned in the description, this would bring the problem of implementing and reusing helper code for tests ("screens", "tasks", "commands", fixtures, page objects, and whatnot)
If we add other potential "dimensions" for tests in the future, such as licensing, we would probably need to add even more folder hierarchies. This doesn't seem scalable.
Closing in favor of: #162698 |
Summary
With the aim of speed-up the test automation on serverless and reusing the work we have done so far with Cypress, we are doing different POC to check which one fits better our needs(#161537).
NOTE: This PR is just a POC, the code is not going to be merged, the idea behind is to open a discussion to see which solution should be implemented and then create a proper PR for it.
Idea
To have different folders. One for serverless specific, one for ESS specific, and one for tests that can be executed in both environments.
Implementation for the POC
x-pack/plugins/security_solution/cypress/e2e
is used for ESS testsx-pack/test_serverless/functional/test_suites/security/cypress/e2e
is used for specific serverless testsx-pack/test/security_solution_cypress/e2e
is used for tests that can be executed on both environmentsThe idea is that when we execute the ESS or serverless tests, to include as well the ones on the
x-pack/test/security_solution_cypress/e2e
security folder. In order to do so, we have modified the specPattern on each one of the executions. To demonstrate that the idea works, we have used theuser_details.cy.ts
.As part of this POC we have also:
waitForPageToBeLoaded
method for investigation purposes. The serverless environment does not have that locator and cypress by default waits for an element to be present on the UI before performing an action, so just checking if is really necessary for the current tests.parallel.ts
script used currently for the ESS tests to spin-up the environment to take into consideration thespecPattern
when using Cypress on visual mode.audibteat
archive when starting the FTR serverless environment and added some missing environment variables to make theuser_details.cy.ts
test work when is executed from serverless.user_details.cy.ts
test work when is executed from serverless.PROS
CONS
screens
andtasks
Takeaways
If we want to have a clear picture of the belonging of each test, that might be our solution. If we finally go for this we should also decide: