-
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] Preparing Cypress to be able to execute on a real serverless environment #166905
[Security Solution] Preparing Cypress to be able to execute on a real serverless environment #166905
Conversation
…or-real-environment # Conflicts: # x-pack/test/security_solution_cypress/cypress/tasks/login.ts # x-pack/test/security_solution_cypress/package.json
56c0e53
to
5a612d9
Compare
|
Pinging @elastic/security-solution (Team: SecuritySolution) |
x-pack/test/security_solution_cypress/cypress/cypress_serverless.config.ts
Show resolved
Hide resolved
x-pack/test/security_solution_cypress/cypress/cypress_serverless.config.ts
Show resolved
Hide resolved
x-pack/test/security_solution_cypress/cypress/support/es_archiver.ts
Outdated
Show resolved
Hide resolved
x-pack/test/security_solution_cypress/cypress/support/es_archiver.ts
Outdated
Show resolved
Hide resolved
…ver.ts Co-authored-by: Sergi Massaneda <[email protected]>
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.
LGTM!
💛 Build succeeded, but was flaky
Failed CI StepsTest Failures
Metrics [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.
LGTM
@@ -27,6 +27,7 @@ export default defineCypressConfig({ | |||
e2e: { | |||
experimentalRunAllSpecs: true, | |||
experimentalMemoryManagement: true, | |||
experimentalCspAllowList: ['default-src', 'script-src', 'script-src-elem'], |
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.
I'm a bit of out context here and just curious why we permit CSP directives now? It looks like an orthogonal change in this PR.
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.
Hey @maximpn!! In order to be able to execute Cypress we were setting the csp
parameters when creating the instances for testing in x-pack/test/security_solution_cypress/config.ts
. In a real (deployed) serverless environment, we don't have a way of doing it, so the above line helps us to execute the tests without facing any issues.
… serverless environment (elastic#166905) Co-authored-by: YulNaumenko <[email protected]> Co-authored-by: Sergi Massaneda <[email protected]>
Work done to be prepared for these changes
Summary
This PR provides the changes needed to be able to execute cypress tests in a real serverless environment.
How to test it
Create a deployed project (you can use QAF for the creation and management of it. It is a pretty convenient tool since it easily provides you the password and the username)
Execute cypress in your machine from
x-pack/test/security_solution_cypress
:Known limitations
complete
can be executedTo follow up
essentials
andcomplete
Blockers
We need to have cypress at least in 12.15.0 version to be able to execute them on a real serverless since from that version test pages with targetedContent-Security-Policy
andContent-Security-Policy-Report-Only
header directives can be tested by specifying the allow list via the experimentalCspAllowList configuration option.#165869Blocker solved :)