Skip to content

Commit

Permalink
update notes about cypress
Browse files Browse the repository at this point in the history
  • Loading branch information
animehart committed Sep 23, 2024
1 parent 1888ccd commit 7c2f468
Showing 1 changed file with 26 additions and 1 deletion.
27 changes: 26 additions & 1 deletion x-pack/plugins/cloud_security_posture/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,7 @@ For general guidelines, read [Kibana Testing Guide](https://www.elastic.co/guide
1. [End-to-End Tests](../../test/cloud_security_posture_functional/config.ts)
1. [Serverless API Integration tests](../../test_serverless/api_integration/test_suites/security/config.ts)
1. [Serverless End-to-End Tests](../../test_serverless/functional/test_suites/security/config.ts)
1. [Cypress End-to-End Tests (Temporary location)](../../test/security_solution_cypress/cypress/e2e/explore/hosts)


### Tools
Expand Down Expand Up @@ -73,6 +74,15 @@ yarn test:ftr --config x-pack/test_serverless/api_integration/test_suites/securi
yarn test:ftr --config x-pack/test_serverless/functional/test_suites/security/config.cloud_security_posture.ts
```

Run [**End-to-End Cypress Tests**](https://github.com/elastic/kibana/tree/main/x-pack/test/security_solution_cypress/cypress):
> **Note**
>
> Run this from security_solution_cypress folder
```bash
yarn cypress:open:serverless
yarn cypress:open:ess
```

#### Run **FTR tests (integration or e2e) for development**

Functional test runner (FTR) can be used separately with `ftr:runner` and `ftr:server`. This is convenient while developing tests.
Expand Down Expand Up @@ -107,4 +117,19 @@ run serverless e2e tests:
```bash
yarn test:ftr:server --config x-pack/test_serverless/functional/test_suites/security/config.cloud_security_posture.ts
yarn test:ftr:runner ---config x-pack/test_serverless/functional/test_suites/security/config.cloud_security_posture.ts
```
```

#### Run **Cypress tests (e2e) for development**
When developing feature outside our plugin folder, instead of using FTRs for e2e test, we may use Cypress. Before running cypress, make sure you have installed it first. Like FTRs, we can run cypress in different environment, for example:

run ess e2e tests:
```bash
yarn cypress:open:ess
```

run serverless e2e tests:
```bash
yarn cypress:open:serverless
```

Unlike FTR where we have to set server and runner separately, Cypress handles everything in 1 go, so just running the above the script is enough to get it running

0 comments on commit 7c2f468

Please sign in to comment.