[Security Solution] Reusing Cypress tests POC1#162023
Closed
MadameSheema wants to merge 11 commits intoelastic:mainfrom
Closed
[Security Solution] Reusing Cypress tests POC1#162023MadameSheema wants to merge 11 commits intoelastic:mainfrom
MadameSheema wants to merge 11 commits intoelastic:mainfrom
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: |
banderror
reviewed
Jul 27, 2023
Contributor
There was a problem hiding this comment.
@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/e2efor ESS testsx-pack/test_serverless/functional/test_suites/security/cypress/e2efor Serverless testsx-pack/test/security_solution_cypress/e2efor 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.
This was referenced Jul 31, 2023
7 tasks
Contributor
Author
|
Closing in favor of: #162698 |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
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/e2eis used for ESS testsx-pack/test_serverless/functional/test_suites/security/cypress/e2eis used for specific serverless testsx-pack/test/security_solution_cypress/e2eis 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/e2esecurity 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:
waitForPageToBeLoadedmethod 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.tsscript used currently for the ESS tests to spin-up the environment to take into consideration thespecPatternwhen using Cypress on visual mode.audibteatarchive when starting the FTR serverless environment and added some missing environment variables to make theuser_details.cy.tstest work when is executed from serverless.user_details.cy.tstest work when is executed from serverless.PROS
CONS
screensandtasksTakeaways
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: