Skip to content

Commit

Permalink
[Security Solution] Update cypress doc with experimental flags (#175889)
Browse files Browse the repository at this point in the history
## Summary

Update the cypress README doc with experimental flags info.
  • Loading branch information
machadoum authored Jan 31, 2024
1 parent ca23dd5 commit b4d93fc
Showing 1 changed file with 25 additions and 0 deletions.
25 changes: 25 additions & 0 deletions x-pack/test/security_solution_cypress/cypress/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,8 @@ If you are still having doubts, questions or queries, please feel free to ping o

[**Running the tests**](#running-the-tests)

[**Enabling Experimental Flags**](#enabling-experimental-flags)

[**Debugging your test**](#debugging-your-test)

[**Folder structure**](#folder-structure)
Expand Down Expand Up @@ -94,6 +96,29 @@ Run the tests with the following yarn scripts from `x-pack/test/security_solutio

Please note that all the headless mode commands do not open the Cypress UI and are typically used in CI/CD environments. The scripts that open the Cypress UI are useful for development and debugging.

### Enabling experimental flags

When writing a test that requires an experimental flag enabled, you need to pass an extra configuration to the header of the test:

```typescript
describe(
'My Experimental Flag test',
{
env: {
ftrConfig: {
kbnServerArgs: [
`--xpack.securitySolution.enableExperimental=${JSON.stringify([
'MY_EXPERIMENTAL_FLAG',
])}`,
],
},
},
},
...
```
Note that this configuration doesn't work for local development. In this case, you need to update the configuration files: `../config` and `../serverless_config`, but you shouldn't commit these changes.
## Debugging your test
In order to be able to debug any Cypress test you need to open Cypress on visual mode. [Here](https://docs.cypress.io/guides/guides/debugging)
Expand Down

0 comments on commit b4d93fc

Please sign in to comment.