From 7c2f4684dfc479ab506ab83c4e37a796927382e8 Mon Sep 17 00:00:00 2001 From: animehart Date: Mon, 23 Sep 2024 10:55:48 -0700 Subject: [PATCH] update notes about cypress --- .../plugins/cloud_security_posture/README.md | 27 ++++++++++++++++++- 1 file changed, 26 insertions(+), 1 deletion(-) diff --git a/x-pack/plugins/cloud_security_posture/README.md b/x-pack/plugins/cloud_security_posture/README.md index bd0b7de6ac661a..4fbaf8c46ad4d3 100755 --- a/x-pack/plugins/cloud_security_posture/README.md +++ b/x-pack/plugins/cloud_security_posture/README.md @@ -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 @@ -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. @@ -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 -``` \ No newline at end of file +``` + +#### 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 \ No newline at end of file