[Security Solution] Removing cy.session
from Cypress tests
#170969
Merged
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.
Context
We are working to execute our Cypress tests in the second Quality Gate (QA environment, deployed projects on MKI). To do so we are mimicking the orchestration we currently have thanks to the
parallel.ts
script on our ESS and serverless FTR environment, where each spec file is executed in its own project and each spec file can set the PLI that needs to be executed.As part of this effort, we are trying to make our Cypress tests more robust and reliable what means having several consecutive green executions on an MKI environment through the buildkite pipeline we are testing.
During our testing we started to find a sign-off/unauthorized issue in some of our tests.
We originally thought that the issue might be caused due to the project not being fully initialized, so we added a big delay after the project creation without success, as well as other safety guards around the project as waiting to be able to login in our application before starting with the tests.
After digging more into the code, we saw that we are using cy.session in our login. With that implemented, after the first login, we store the session and we reuse it when login is called again inside the spec file.
All the above failures we faced, happened in spec files with login on a beforeEach hook, so it seemed that reusing the session was not a good idea in these MKI environments. We deleted the method and the execution worked as expected
In this PR
In this PR we are removing the
cy.session
functionality from our login.