diff --git a/.buildkite/pipelines/pull_request/defend_workflows.yml b/.buildkite/pipelines/pull_request/defend_workflows.yml index 760db34a004be..c60030497b623 100644 --- a/.buildkite/pipelines/pull_request/defend_workflows.yml +++ b/.buildkite/pipelines/pull_request/defend_workflows.yml @@ -1,18 +1,6 @@ steps: - command: .buildkite/scripts/steps/functional/defend_workflows.sh label: 'Defend Workflows Cypress Tests' - agents: - queue: n2-4-spot - depends_on: build - timeout_in_minutes: 60 - parallelism: 2 - retry: - automatic: - - exit_status: '*' - limit: 1 - - - command: .buildkite/scripts/steps/functional/defend_workflows_vagrant.sh - label: 'Defend Workflows Endpoint Cypress Tests' agents: queue: n2-4-virt depends_on: build @@ -35,15 +23,4 @@ steps: - exit_status: '*' limit: 1 - - command: .buildkite/scripts/steps/functional/defend_workflows_vagrant_serverless.sh - label: 'Defend Workflows Endpoint Cypress Tests on Serverless' - agents: - queue: n2-4-virt - depends_on: build - timeout_in_minutes: 120 - parallelism: 5 - retry: - automatic: - - exit_status: '*' - limit: 1 diff --git a/.buildkite/scripts/steps/functional/defend_workflows_vagrant.sh b/.buildkite/scripts/steps/functional/defend_workflows_vagrant.sh deleted file mode 100755 index 390078d3076f7..0000000000000 --- a/.buildkite/scripts/steps/functional/defend_workflows_vagrant.sh +++ /dev/null @@ -1,16 +0,0 @@ -#!/usr/bin/env bash - -set -euo pipefail - -source .buildkite/scripts/steps/functional/common.sh -source .buildkite/scripts/steps/functional/common_cypress.sh - -export JOB=kibana-defend-workflows-endpoint-cypress -export KIBANA_INSTALL_DIR=${KIBANA_BUILD_LOCATION} - -echo "--- Defend Workflows Endpoint Cypress tests" - -cd x-pack/plugins/security_solution - -set +e -yarn cypress:dw:endpoint:run; status=$?; yarn junit:merge || :; exit $status diff --git a/.buildkite/scripts/steps/functional/defend_workflows_vagrant_serverless.sh b/.buildkite/scripts/steps/functional/defend_workflows_vagrant_serverless.sh deleted file mode 100755 index 7451cb84b6133..0000000000000 --- a/.buildkite/scripts/steps/functional/defend_workflows_vagrant_serverless.sh +++ /dev/null @@ -1,15 +0,0 @@ -#!/usr/bin/env bash - -set -euo pipefail - -source .buildkite/scripts/steps/functional/common.sh -source .buildkite/scripts/steps/functional/common_cypress.sh - -export JOB=kibana-defend-workflows-endpoint-serverless-cypress -export KIBANA_INSTALL_DIR=${KIBANA_BUILD_LOCATION} - -echo "--- Defend Workflows Endpoint Cypress tests on Serverless" - -cd x-pack/plugins/security_solution - -yarn cypress:dw:endpoint:serverless:run; status=$?; yarn junit:merge || :; exit $status diff --git a/x-pack/plugins/security_solution/package.json b/x-pack/plugins/security_solution/package.json index 6675ae6cd3b52..04ee03ecfed2e 100644 --- a/x-pack/plugins/security_solution/package.json +++ b/x-pack/plugins/security_solution/package.json @@ -13,15 +13,12 @@ "cypress:dw": "NODE_OPTIONS=--openssl-legacy-provider node ./scripts/start_cypress_parallel --config-file ./public/management/cypress/cypress.config.ts --ftr-config-file ../../test/defend_workflows_cypress/cli_config", "cypress:dw:open": "yarn cypress:dw open", "cypress:dw:run": "yarn cypress:dw run", - "cypress:dw:endpoint": "NODE_OPTIONS=--openssl-legacy-provider node ./scripts/start_cypress_parallel --config-file ./public/management/cypress/cypress_endpoint.config.ts --ftr-config-file ../../test/defend_workflows_cypress/endpoint_config", - "cypress:dw:endpoint:run": "yarn cypress:dw:endpoint run", - "cypress:dw:endpoint:open": "yarn cypress:dw:endpoint open", "cypress:dw:serverless": "NODE_OPTIONS=--openssl-legacy-provider node ./scripts/start_cypress_parallel --config-file ./public/management/cypress/cypress_serverless.config.ts --ftr-config-file ../../../x-pack/test_serverless/functional/test_suites/security/cypress/security_config", "cypress:dw:serverless:open": "yarn cypress:dw:serverless open", "cypress:dw:serverless:run": "yarn cypress:dw:serverless run", - "cypress:dw:endpoint:serverless": "NODE_OPTIONS=--openssl-legacy-provider node ./scripts/start_cypress_parallel --config-file ./public/management/cypress/cypress_endpoint_serverless.config.ts --ftr-config-file ../../test/defend_workflows_cypress/endpoint_serverless_config", - "cypress:dw:endpoint:serverless:open": "yarn cypress:dw:endpoint:serverless open", - "cypress:dw:endpoint:serverless:run": "yarn cypress:dw:endpoint:serverless run", + "cypress:dw:endpoint": "echo '\n** WARNING **: Run script `cypress:dw:endpoint` no longer valid! Use `cypress:dw` instead\n'", + "cypress:dw:endpoint:run": "echo '\n** WARNING **: Run script `cypress:dw:endpoint:run` no longer valid! Use `cypress:dw:run` instead\n'", + "cypress:dw:endpoint:open": "echo '\n** WARNING **: Run script `cypress:dw:endpoint:open` no longer valid! Use `cypress:dw:open` instead\n'", "junit:merge": "../../../node_modules/.bin/mochawesome-merge ../../../target/kibana-security-solution/cypress/results/mochawesome*.json > ../../../target/kibana-security-solution/cypress/results/output.json && ../../../node_modules/.bin/marge ../../../target/kibana-security-solution/cypress/results/output.json --reportDir ../../../target/kibana-security-solution/cypress/results && yarn junit:transform && mkdir -p ../../../target/junit && cp ../../../target/kibana-security-solution/cypress/results/*.xml ../../../target/junit/", "test:generate": "node scripts/endpoint/resolver_generator", "mappings:generate": "node scripts/mappings/mappings_generator", diff --git a/x-pack/plugins/security_solution/public/management/cypress/README.md b/x-pack/plugins/security_solution/public/management/cypress/README.md index d78338c5898d4..65af201662c48 100644 --- a/x-pack/plugins/security_solution/public/management/cypress/README.md +++ b/x-pack/plugins/security_solution/public/management/cypress/README.md @@ -134,67 +134,12 @@ yarn --cwd x-pack/plugins/security_solution cypress:dw:open yarn --cwd x-pack/plugins/security_solution cypress:dw:serverless:open ``` -For developing/debugging tests against real endpoint please use: - -Endpoint tests require [Multipass](https://multipass.run/) to be installed on your machine. - -```shell -# bootstrap kibana from the project root and build the plugins/assets that cypress will execute against -yarn kbn bootstrap && node scripts/build_kibana_platform_plugins - -# launch the cypress test runner against ESS -yarn --cwd x-pack/plugins/security_solution cypress:dw:endpoint:open - -# or against Serverless -yarn --cwd x-pack/plugins/security_solution cypress:dw:endpoint:serverless:open -``` - -#### Cypress (interactive) with real Endpoints using Vagrant - -```shell -# bootstrap kibana from the project root and build the plugins/assets that cypress will execute against -yarn kbn bootstrap && node scripts/build_kibana_platform_plugins - -# launch the cypress test runner with real endpoint -cd x-pack/plugins/security_solution -export CI=true -yarn cypress:dw:endpoint:open -```` - -Note that you can select the browser you want to use on the top right side of the interactive runner. - -#### Cypress against REAL Endpoint + Headless (Chrome) - -This requires some additional setup as mentioned in the [pre-requisites](#pre-requisites) section. - -Endpoint tests require [Multipass](https://multipass.run/) to be installed on your machine. - -```shell -# bootstrap kibana from the project root and build the plugins/assets that cypress will execute against -yarn kbn bootstrap && node scripts/build_kibana_platform_plugins - -# launch the cypress test runner with real endpoint against ESS -yarn --cwd x-pack/plugins/security_solution cypress:dw:endpoint:run - -# or against Serverless -yarn --cwd x-pack/plugins/security_solution cypress:dw:endpoint:serverless:run -``` - ## Folder Structure ### e2e/ Contains all the tests. Within it are two sub-folders: -#### cypress/endpoint - -Contains all the tests that are executed against real endpoints. - -#### cypress/mocked_data - -Contains all the tests that are executed against mocked endpoint and run on CI. If you want to add tests that run on CI -then this is where you should add those. - ### integration/ Cypress convention. Contains the specs that are going to be executed. @@ -212,7 +157,6 @@ Directory also holds Cypress Plugins that are then initialized via `setupNodeEve ### screens/ Contains the elements we want to interact with within our tests. - Each file inside the screens folder represents a screen in our application. ### tasks/ diff --git a/x-pack/plugins/security_solution/public/management/cypress/cypress.config.ts b/x-pack/plugins/security_solution/public/management/cypress/cypress.config.ts index ad18b6ca8ef1d..f3725638111b6 100644 --- a/x-pack/plugins/security_solution/public/management/cypress/cypress.config.ts +++ b/x-pack/plugins/security_solution/public/management/cypress/cypress.config.ts @@ -8,26 +8,10 @@ import { defineCypressConfig } from '@kbn/cypress-config'; import { getCypressBaseConfig } from './cypress_base.config'; -import { dataLoaders } from './support/data_loaders'; - -export default defineCypressConfig({ - ...getCypressBaseConfig(), - - env: { - ...getCypressBaseConfig().env, - - grepTags: '@ess', - }, - - e2e: { - ...getCypressBaseConfig().e2e, - - specPattern: 'public/management/cypress/e2e/mocked_data/', - setupNodeEvents: (on, config) => { - // eslint-disable-next-line @typescript-eslint/no-var-requires - require('@cypress/grep/src/plugin')(config); - - return dataLoaders(on, config); +export default defineCypressConfig( + getCypressBaseConfig({ + env: { + grepTags: '@ess', }, - }, -}); + }) +); diff --git a/x-pack/plugins/security_solution/public/management/cypress/cypress_base.config.ts b/x-pack/plugins/security_solution/public/management/cypress/cypress_base.config.ts index b45e33388d039..e7624ed670f50 100644 --- a/x-pack/plugins/security_solution/public/management/cypress/cypress_base.config.ts +++ b/x-pack/plugins/security_solution/public/management/cypress/cypress_base.config.ts @@ -5,50 +5,82 @@ * 2.0. */ -export const getCypressBaseConfig = () => ({ - reporter: '../../../../node_modules/cypress-multi-reporters', - reporterOptions: { - configFile: './public/management/reporter_config.json', - }, - - defaultCommandTimeout: 60000, - execTimeout: 120000, - pageLoadTimeout: 12000, - - retries: { - runMode: 1, - openMode: 0, - }, - - screenshotsFolder: - '../../../target/kibana-security-solution/public/management/cypress/screenshots', - trashAssetsBeforeRuns: false, - video: false, - viewportHeight: 900, - viewportWidth: 1440, - experimentalStudio: true, - - env: { - KIBANA_URL: 'http://localhost:5601', - ELASTICSEARCH_URL: 'http://localhost:9200', - FLEET_SERVER_URL: 'https://localhost:8220', - - // Username/password used for both elastic and kibana - KIBANA_USERNAME: 'system_indices_superuser', - KIBANA_PASSWORD: 'changeme', - ELASTICSEARCH_USERNAME: 'system_indices_superuser', - ELASTICSEARCH_PASSWORD: 'changeme', - - // grep related configs - grepFilterSpecs: true, - grepOmitFiltered: true, - }, - - e2e: { - // baseUrl: To override, set Env. variable `CYPRESS_BASE_URL` - baseUrl: 'http://localhost:5601', - - supportFile: 'public/management/cypress/support/e2e.ts', - experimentalRunAllSpecs: true, - }, -}); +import { merge } from 'lodash'; +import { dataLoaders, dataLoadersForRealEndpoints } from './support/data_loaders'; +import { responseActionTasks } from './support/response_actions'; + +export const getCypressBaseConfig = ( + overrides: Cypress.ConfigOptions = {} +): Cypress.ConfigOptions => { + return merge( + { + reporter: '../../../../node_modules/cypress-multi-reporters', + reporterOptions: { + configFile: './public/management/reporter_config.json', + }, + + defaultCommandTimeout: 60000, + execTimeout: 120000, + pageLoadTimeout: 12000, + + retries: { + runMode: 1, + openMode: 0, + }, + + screenshotsFolder: + '../../../target/kibana-security-solution/public/management/cypress/screenshots', + trashAssetsBeforeRuns: false, + video: false, + viewportHeight: 900, + viewportWidth: 1440, + experimentalStudio: true, + + env: { + 'cypress-react-selector': { + root: '#security-solution-app', + }, + KIBANA_URL: 'http://localhost:5601', + ELASTICSEARCH_URL: 'http://localhost:9200', + FLEET_SERVER_URL: 'https://localhost:8220', + KIBANA_USERNAME: 'system_indices_superuser', + KIBANA_PASSWORD: 'changeme', + ELASTICSEARCH_USERNAME: 'system_indices_superuser', + ELASTICSEARCH_PASSWORD: 'changeme', + + // grep related configs + grepFilterSpecs: true, + grepOmitFiltered: true, + }, + + e2e: { + // baseUrl: To override, set Env. variable `CYPRESS_BASE_URL` + baseUrl: 'http://localhost:5601', + supportFile: 'public/management/cypress/support/e2e.ts', + specPattern: 'public/management/cypress/e2e/**/*.cy.{js,jsx,ts,tsx}', + experimentalRunAllSpecs: true, + setupNodeEvents: (on: Cypress.PluginEvents, config: Cypress.PluginConfigOptions) => { + dataLoaders(on, config); + + // skip dataLoadersForRealEndpoints() if running in serverless + // https://github.com/elastic/security-team/issues/7467 + // Once we are able to run Fleet server in serverless mode (see: https://github.com/elastic/kibana/pull/166183) + // this `if()` statement needs to be removed and `dataLoadersForRealEndpoints()` should + // just be called without having any checks around it. + if (!config.env.IS_SERVERLESS) { + // Data loaders specific to "real" Endpoint testing + dataLoadersForRealEndpoints(on, config); + } + + responseActionTasks(on, config); + + // eslint-disable-next-line @typescript-eslint/no-var-requires + require('@cypress/grep/src/plugin')(config); + + return config; + }, + }, + }, + overrides + ); +}; diff --git a/x-pack/plugins/security_solution/public/management/cypress/cypress_endpoint.config.ts b/x-pack/plugins/security_solution/public/management/cypress/cypress_endpoint.config.ts deleted file mode 100644 index 409e3dc258ee2..0000000000000 --- a/x-pack/plugins/security_solution/public/management/cypress/cypress_endpoint.config.ts +++ /dev/null @@ -1,47 +0,0 @@ -/* - * Copyright Elasticsearch B.V. and/or licensed to Elasticsearch B.V. under one - * or more contributor license agreements. Licensed under the Elastic License - * 2.0; you may not use this file except in compliance with the Elastic License - * 2.0. - */ - -import { defineCypressConfig } from '@kbn/cypress-config'; -import { getCypressBaseConfig } from './cypress_base.config'; - -import { dataLoaders, dataLoadersForRealEndpoints } from './support/data_loaders'; - -import { responseActionTasks } from './support/response_actions'; - -// eslint-disable-next-line import/no-default-export -export default defineCypressConfig({ - ...getCypressBaseConfig(), - - env: { - ...getCypressBaseConfig().env, - - 'cypress-react-selector': { - root: '#security-solution-app', - }, - - grepTags: '@ess', - }, - - e2e: { - ...getCypressBaseConfig().e2e, - - experimentalMemoryManagement: true, - experimentalInteractiveRunEvents: true, - specPattern: 'public/management/cypress/e2e/endpoint/*.cy.{js,jsx,ts,tsx}', - setupNodeEvents: (on: Cypress.PluginEvents, config: Cypress.PluginConfigOptions) => { - dataLoaders(on, config); - // Data loaders specific to "real" Endpoint testing - dataLoadersForRealEndpoints(on, config); - responseActionTasks(on, config); - - // eslint-disable-next-line @typescript-eslint/no-var-requires - require('@cypress/grep/src/plugin')(config); - - return config; - }, - }, -}); diff --git a/x-pack/plugins/security_solution/public/management/cypress/cypress_endpoint_serverless.config.ts b/x-pack/plugins/security_solution/public/management/cypress/cypress_endpoint_serverless.config.ts deleted file mode 100644 index d0fe78831f892..0000000000000 --- a/x-pack/plugins/security_solution/public/management/cypress/cypress_endpoint_serverless.config.ts +++ /dev/null @@ -1,50 +0,0 @@ -/* - * Copyright Elasticsearch B.V. and/or licensed to Elasticsearch B.V. under one - * or more contributor license agreements. Licensed under the Elastic License - * 2.0; you may not use this file except in compliance with the Elastic License - * 2.0. - */ - -import { defineCypressConfig } from '@kbn/cypress-config'; -import { getCypressBaseConfig } from './cypress_base.config'; -import { dataLoaders } from './support/data_loaders'; -import { responseActionTasks } from './support/response_actions'; - -// eslint-disable-next-line import/no-default-export -export default defineCypressConfig({ - ...getCypressBaseConfig(), - - env: { - ...getCypressBaseConfig().env, - - IS_SERVERLESS: true, - grepTags: '@serverless --@brokenInServerless', - - 'cypress-react-selector': { - root: '#security-solution-app', - }, - }, - - e2e: { - ...getCypressBaseConfig().e2e, - - experimentalMemoryManagement: true, - experimentalInteractiveRunEvents: true, - - specPattern: 'public/management/cypress/e2e/endpoint/*.cy.{js,jsx,ts,tsx}', - - setupNodeEvents: (on, config) => { - // eslint-disable-next-line @typescript-eslint/no-var-requires - require('@cypress/grep/src/plugin')(config); - - dataLoaders(on, config); - - // skip dataLoadersForRealEndpoints() - // https://github.com/elastic/security-team/issues/7467 - // Data loaders specific to "real" Endpoint testing - // dataLoadersForRealEndpoints(on, config); - - responseActionTasks(on, config); - }, - }, -}); diff --git a/x-pack/plugins/security_solution/public/management/cypress/cypress_serverless.config.ts b/x-pack/plugins/security_solution/public/management/cypress/cypress_serverless.config.ts index 60517176bc482..35dda2bd68501 100644 --- a/x-pack/plugins/security_solution/public/management/cypress/cypress_serverless.config.ts +++ b/x-pack/plugins/security_solution/public/management/cypress/cypress_serverless.config.ts @@ -7,30 +7,14 @@ import { defineCypressConfig } from '@kbn/cypress-config'; import { getCypressBaseConfig } from './cypress_base.config'; -import { dataLoaders } from './support/data_loaders'; // eslint-disable-next-line import/no-default-export -export default defineCypressConfig({ - ...getCypressBaseConfig(), +export default defineCypressConfig( + getCypressBaseConfig({ + env: { + IS_SERVERLESS: true, - env: { - ...getCypressBaseConfig().env, - - IS_SERVERLESS: true, - - grepTags: '@serverless --@brokenInServerless', - }, - - e2e: { - ...getCypressBaseConfig().e2e, - - specPattern: 'public/management/cypress/e2e/mocked_data/', - - setupNodeEvents: (on, config) => { - // eslint-disable-next-line @typescript-eslint/no-var-requires - require('@cypress/grep/src/plugin')(config); - - return dataLoaders(on, config); + grepTags: '@serverless --@brokenInServerless', }, - }, -}); + }) +); diff --git a/x-pack/plugins/security_solution/public/management/cypress/e2e/mocked_data/artifact_tabs_in_policy_details.cy.ts b/x-pack/plugins/security_solution/public/management/cypress/e2e/artifacts/artifact_tabs_in_policy_details.cy.ts similarity index 100% rename from x-pack/plugins/security_solution/public/management/cypress/e2e/mocked_data/artifact_tabs_in_policy_details.cy.ts rename to x-pack/plugins/security_solution/public/management/cypress/e2e/artifacts/artifact_tabs_in_policy_details.cy.ts diff --git a/x-pack/plugins/security_solution/public/management/cypress/e2e/endpoint/artifacts.cy.ts b/x-pack/plugins/security_solution/public/management/cypress/e2e/artifacts/artifacts.cy.ts similarity index 100% rename from x-pack/plugins/security_solution/public/management/cypress/e2e/endpoint/artifacts.cy.ts rename to x-pack/plugins/security_solution/public/management/cypress/e2e/artifacts/artifacts.cy.ts diff --git a/x-pack/plugins/security_solution/public/management/cypress/e2e/mocked_data/artifacts.cy.ts b/x-pack/plugins/security_solution/public/management/cypress/e2e/artifacts/artifacts_mocked_data.cy.ts similarity index 100% rename from x-pack/plugins/security_solution/public/management/cypress/e2e/mocked_data/artifacts.cy.ts rename to x-pack/plugins/security_solution/public/management/cypress/e2e/artifacts/artifacts_mocked_data.cy.ts diff --git a/x-pack/plugins/security_solution/public/management/cypress/e2e/endpoint/automated_response_actions.cy.ts b/x-pack/plugins/security_solution/public/management/cypress/e2e/automated_response_actions/automated_response_actions.cy.ts similarity index 100% rename from x-pack/plugins/security_solution/public/management/cypress/e2e/endpoint/automated_response_actions.cy.ts rename to x-pack/plugins/security_solution/public/management/cypress/e2e/automated_response_actions/automated_response_actions.cy.ts diff --git a/x-pack/plugins/security_solution/public/management/cypress/e2e/mocked_data/automated_response_actions/form.cy.ts b/x-pack/plugins/security_solution/public/management/cypress/e2e/automated_response_actions/form.cy.ts similarity index 97% rename from x-pack/plugins/security_solution/public/management/cypress/e2e/mocked_data/automated_response_actions/form.cy.ts rename to x-pack/plugins/security_solution/public/management/cypress/e2e/automated_response_actions/form.cy.ts index c5a6e636acdb3..84f6903c35a9b 100644 --- a/x-pack/plugins/security_solution/public/management/cypress/e2e/mocked_data/automated_response_actions/form.cy.ts +++ b/x-pack/plugins/security_solution/public/management/cypress/e2e/automated_response_actions/form.cy.ts @@ -13,10 +13,10 @@ import { tryAddingDisabledResponseAction, validateAvailableCommands, visitRuleActions, -} from '../../../tasks/response_actions'; -import { cleanupRule, generateRandomStringName, loadRule } from '../../../tasks/api_fixtures'; -import { RESPONSE_ACTION_TYPES } from '../../../../../../common/api/detection_engine'; -import { loginWithRole, ROLE } from '../../../tasks/login'; +} from '../../tasks/response_actions'; +import { cleanupRule, generateRandomStringName, loadRule } from '../../tasks/api_fixtures'; +import { RESPONSE_ACTION_TYPES } from '../../../../../common/api/detection_engine'; +import { loginWithRole, ROLE } from '../../tasks/login'; describe('Form', { tags: '@ess' }, () => { describe('User with no access can not create an endpoint response action', () => { diff --git a/x-pack/plugins/security_solution/public/management/cypress/e2e/mocked_data/automated_response_actions/history_log.cy.ts b/x-pack/plugins/security_solution/public/management/cypress/e2e/automated_response_actions/history_log.cy.ts similarity index 90% rename from x-pack/plugins/security_solution/public/management/cypress/e2e/mocked_data/automated_response_actions/history_log.cy.ts rename to x-pack/plugins/security_solution/public/management/cypress/e2e/automated_response_actions/history_log.cy.ts index ebab02870d307..8e33a98fa5d79 100644 --- a/x-pack/plugins/security_solution/public/management/cypress/e2e/mocked_data/automated_response_actions/history_log.cy.ts +++ b/x-pack/plugins/security_solution/public/management/cypress/e2e/automated_response_actions/history_log.cy.ts @@ -5,12 +5,12 @@ * 2.0. */ -import { generateRandomStringName } from '../../../tasks/utils'; -import { indexEndpointHosts } from '../../../tasks/index_endpoint_hosts'; -import type { ReturnTypeFromChainable } from '../../../types'; -import { indexEndpointRuleAlerts } from '../../../tasks/index_endpoint_rule_alerts'; +import { generateRandomStringName } from '../../tasks/utils'; +import { indexEndpointHosts } from '../../tasks/index_endpoint_hosts'; +import type { ReturnTypeFromChainable } from '../../types'; +import { indexEndpointRuleAlerts } from '../../tasks/index_endpoint_rule_alerts'; -import { login, ROLE } from '../../../tasks/login'; +import { login, ROLE } from '../../tasks/login'; describe('Response actions history page', { tags: '@ess' }, () => { let endpointData: ReturnTypeFromChainable | undefined; diff --git a/x-pack/plugins/security_solution/public/management/cypress/e2e/mocked_data/automated_response_actions/no_license.cy.ts b/x-pack/plugins/security_solution/public/management/cypress/e2e/automated_response_actions/no_license.cy.ts similarity index 79% rename from x-pack/plugins/security_solution/public/management/cypress/e2e/mocked_data/automated_response_actions/no_license.cy.ts rename to x-pack/plugins/security_solution/public/management/cypress/e2e/automated_response_actions/no_license.cy.ts index b9591f94a2f25..edbaa90d3200c 100644 --- a/x-pack/plugins/security_solution/public/management/cypress/e2e/mocked_data/automated_response_actions/no_license.cy.ts +++ b/x-pack/plugins/security_solution/public/management/cypress/e2e/automated_response_actions/no_license.cy.ts @@ -5,15 +5,15 @@ * 2.0. */ -import { disableExpandableFlyoutAdvancedSettings } from '../../../tasks/common'; -import { APP_ALERTS_PATH } from '../../../../../../common/constants'; -import { closeAllToasts } from '../../../tasks/toasts'; -import { fillUpNewRule } from '../../../tasks/response_actions'; -import { login, loginWithRole, ROLE } from '../../../tasks/login'; -import { generateRandomStringName } from '../../../tasks/utils'; -import type { ReturnTypeFromChainable } from '../../../types'; -import { indexEndpointHosts } from '../../../tasks/index_endpoint_hosts'; -import { indexEndpointRuleAlerts } from '../../../tasks/index_endpoint_rule_alerts'; +import { disableExpandableFlyoutAdvancedSettings } from '../../tasks/common'; +import { APP_ALERTS_PATH } from '../../../../../common/constants'; +import { closeAllToasts } from '../../tasks/toasts'; +import { fillUpNewRule } from '../../tasks/response_actions'; +import { login, loginWithRole, ROLE } from '../../tasks/login'; +import { generateRandomStringName } from '../../tasks/utils'; +import type { ReturnTypeFromChainable } from '../../types'; +import { indexEndpointHosts } from '../../tasks/index_endpoint_hosts'; +import { indexEndpointRuleAlerts } from '../../tasks/index_endpoint_rule_alerts'; describe('No License', { tags: '@ess', env: { ftrConfig: { license: 'basic' } } }, () => { describe('User cannot use endpoint action in form', () => { diff --git a/x-pack/plugins/security_solution/public/management/cypress/e2e/mocked_data/automated_response_actions/results.cy.ts b/x-pack/plugins/security_solution/public/management/cypress/e2e/automated_response_actions/results.cy.ts similarity index 82% rename from x-pack/plugins/security_solution/public/management/cypress/e2e/mocked_data/automated_response_actions/results.cy.ts rename to x-pack/plugins/security_solution/public/management/cypress/e2e/automated_response_actions/results.cy.ts index cbbd997004312..2fe539e8ffe77 100644 --- a/x-pack/plugins/security_solution/public/management/cypress/e2e/mocked_data/automated_response_actions/results.cy.ts +++ b/x-pack/plugins/security_solution/public/management/cypress/e2e/automated_response_actions/results.cy.ts @@ -5,15 +5,15 @@ * 2.0. */ -import { disableExpandableFlyoutAdvancedSettings } from '../../../tasks/common'; -import { generateRandomStringName } from '../../../tasks/utils'; -import { APP_ALERTS_PATH } from '../../../../../../common/constants'; -import { closeAllToasts } from '../../../tasks/toasts'; -import { indexEndpointHosts } from '../../../tasks/index_endpoint_hosts'; -import type { ReturnTypeFromChainable } from '../../../types'; -import { indexEndpointRuleAlerts } from '../../../tasks/index_endpoint_rule_alerts'; +import { disableExpandableFlyoutAdvancedSettings } from '../../tasks/common'; +import { generateRandomStringName } from '../../tasks/utils'; +import { APP_ALERTS_PATH } from '../../../../../common/constants'; +import { closeAllToasts } from '../../tasks/toasts'; +import { indexEndpointHosts } from '../../tasks/index_endpoint_hosts'; +import type { ReturnTypeFromChainable } from '../../types'; +import { indexEndpointRuleAlerts } from '../../tasks/index_endpoint_rule_alerts'; -import { login, ROLE } from '../../../tasks/login'; +import { login, ROLE } from '../../tasks/login'; describe('Results', { tags: '@ess' }, () => { let endpointData: ReturnTypeFromChainable | undefined; diff --git a/x-pack/plugins/security_solution/public/management/cypress/e2e/endpoint/endpoint_alerts.cy.ts b/x-pack/plugins/security_solution/public/management/cypress/e2e/endpoint_alerts.cy.ts similarity index 78% rename from x-pack/plugins/security_solution/public/management/cypress/e2e/endpoint/endpoint_alerts.cy.ts rename to x-pack/plugins/security_solution/public/management/cypress/e2e/endpoint_alerts.cy.ts index f77b5fe53b8ff..3daf711eca9cd 100644 --- a/x-pack/plugins/security_solution/public/management/cypress/e2e/endpoint/endpoint_alerts.cy.ts +++ b/x-pack/plugins/security_solution/public/management/cypress/e2e/endpoint_alerts.cy.ts @@ -5,19 +5,19 @@ * 2.0. */ -import { deleteAllLoadedEndpointData } from '../../tasks/delete_all_endpoint_data'; -import { getAlertsTableRows, navigateToAlertsList } from '../../screens/alerts'; -import { waitForEndpointAlerts } from '../../tasks/alerts'; -import { request } from '../../tasks/common'; -import { createAgentPolicyTask, getEndpointIntegrationVersion } from '../../tasks/fleet'; -import { createEndpointHost } from '../../tasks/create_endpoint_host'; -import type { IndexedFleetEndpointPolicyResponse } from '../../../../../common/endpoint/data_loaders/index_fleet_endpoint_policy'; -import { enableAllPolicyProtections } from '../../tasks/endpoint_policy'; -import type { PolicyData, ResponseActionApiResponse } from '../../../../../common/endpoint/types'; -import type { CreateAndEnrollEndpointHostResponse } from '../../../../../scripts/endpoint/common/endpoint_host_services'; -import { login } from '../../tasks/login'; -import { EXECUTE_ROUTE } from '../../../../../common/endpoint/constants'; -import { waitForActionToComplete } from '../../tasks/response_actions'; +import { deleteAllLoadedEndpointData } from '../tasks/delete_all_endpoint_data'; +import { getAlertsTableRows, navigateToAlertsList } from '../screens/alerts'; +import { waitForEndpointAlerts } from '../tasks/alerts'; +import { request } from '../tasks/common'; +import { createAgentPolicyTask, getEndpointIntegrationVersion } from '../tasks/fleet'; +import { createEndpointHost } from '../tasks/create_endpoint_host'; +import type { IndexedFleetEndpointPolicyResponse } from '../../../../common/endpoint/data_loaders/index_fleet_endpoint_policy'; +import { enableAllPolicyProtections } from '../tasks/endpoint_policy'; +import type { PolicyData, ResponseActionApiResponse } from '../../../../common/endpoint/types'; +import type { CreateAndEnrollEndpointHostResponse } from '../../../../scripts/endpoint/common/endpoint_host_services'; +import { login } from '../tasks/login'; +import { EXECUTE_ROUTE } from '../../../../common/endpoint/constants'; +import { waitForActionToComplete } from '../tasks/response_actions'; describe( 'Endpoint generated alerts', diff --git a/x-pack/plugins/security_solution/public/management/cypress/e2e/endpoint/endpoints.cy.ts b/x-pack/plugins/security_solution/public/management/cypress/e2e/endpoint_list/endpoints.cy.ts similarity index 100% rename from x-pack/plugins/security_solution/public/management/cypress/e2e/endpoint/endpoints.cy.ts rename to x-pack/plugins/security_solution/public/management/cypress/e2e/endpoint_list/endpoints.cy.ts diff --git a/x-pack/plugins/security_solution/public/management/cypress/e2e/mocked_data/endpoints.cy.ts b/x-pack/plugins/security_solution/public/management/cypress/e2e/endpoint_list/endpoints_mocked_data.cy.ts similarity index 100% rename from x-pack/plugins/security_solution/public/management/cypress/e2e/mocked_data/endpoints.cy.ts rename to x-pack/plugins/security_solution/public/management/cypress/e2e/endpoint_list/endpoints_mocked_data.cy.ts diff --git a/x-pack/plugins/security_solution/public/management/cypress/e2e/mocked_data/policy_response.cy.ts b/x-pack/plugins/security_solution/public/management/cypress/e2e/endpoint_list/policy_response.cy.ts similarity index 100% rename from x-pack/plugins/security_solution/public/management/cypress/e2e/mocked_data/policy_response.cy.ts rename to x-pack/plugins/security_solution/public/management/cypress/e2e/endpoint_list/policy_response.cy.ts diff --git a/x-pack/plugins/security_solution/public/management/cypress/e2e/mocked_data/endpoint_role_rbac.cy.ts b/x-pack/plugins/security_solution/public/management/cypress/e2e/endpoint_role_rbac.cy.ts similarity index 95% rename from x-pack/plugins/security_solution/public/management/cypress/e2e/mocked_data/endpoint_role_rbac.cy.ts rename to x-pack/plugins/security_solution/public/management/cypress/e2e/endpoint_role_rbac.cy.ts index 07840c05b85de..a09f9e8b8273d 100644 --- a/x-pack/plugins/security_solution/public/management/cypress/e2e/mocked_data/endpoint_role_rbac.cy.ts +++ b/x-pack/plugins/security_solution/public/management/cypress/e2e/endpoint_role_rbac.cy.ts @@ -5,9 +5,9 @@ * 2.0. */ -import { closeAllToasts } from '../../tasks/toasts'; -import { login } from '../../tasks/login'; -import { loadPage } from '../../tasks/common'; +import { closeAllToasts } from '../tasks/toasts'; +import { login } from '../tasks/login'; +import { loadPage } from '../tasks/common'; describe('When defining a kibana role for Endpoint security access', { tags: '@ess' }, () => { const getAllSubFeatureRows = (): Cypress.Chainable> => { diff --git a/x-pack/plugins/security_solution/public/management/cypress/e2e/endpoint/policy_details.cy.ts b/x-pack/plugins/security_solution/public/management/cypress/e2e/policy/policy_details.cy.ts similarity index 100% rename from x-pack/plugins/security_solution/public/management/cypress/e2e/endpoint/policy_details.cy.ts rename to x-pack/plugins/security_solution/public/management/cypress/e2e/policy/policy_details.cy.ts diff --git a/x-pack/plugins/security_solution/public/management/cypress/e2e/mocked_data/policy_details.cy.ts b/x-pack/plugins/security_solution/public/management/cypress/e2e/policy/policy_details_mocked_data.cy.ts similarity index 100% rename from x-pack/plugins/security_solution/public/management/cypress/e2e/mocked_data/policy_details.cy.ts rename to x-pack/plugins/security_solution/public/management/cypress/e2e/policy/policy_details_mocked_data.cy.ts diff --git a/x-pack/plugins/security_solution/public/management/cypress/e2e/endpoint/policy_experimental_features_disabled.cy.ts b/x-pack/plugins/security_solution/public/management/cypress/e2e/policy/policy_experimental_features_disabled.cy.ts similarity index 100% rename from x-pack/plugins/security_solution/public/management/cypress/e2e/endpoint/policy_experimental_features_disabled.cy.ts rename to x-pack/plugins/security_solution/public/management/cypress/e2e/policy/policy_experimental_features_disabled.cy.ts diff --git a/x-pack/plugins/security_solution/public/management/cypress/e2e/endpoint/policy_list.cy.ts b/x-pack/plugins/security_solution/public/management/cypress/e2e/policy/policy_list.cy.ts similarity index 100% rename from x-pack/plugins/security_solution/public/management/cypress/e2e/endpoint/policy_list.cy.ts rename to x-pack/plugins/security_solution/public/management/cypress/e2e/policy/policy_list.cy.ts diff --git a/x-pack/plugins/security_solution/public/management/cypress/e2e/endpoint/isolate.cy.ts b/x-pack/plugins/security_solution/public/management/cypress/e2e/response_actions/isolate.cy.ts similarity index 100% rename from x-pack/plugins/security_solution/public/management/cypress/e2e/endpoint/isolate.cy.ts rename to x-pack/plugins/security_solution/public/management/cypress/e2e/response_actions/isolate.cy.ts diff --git a/x-pack/plugins/security_solution/public/management/cypress/e2e/mocked_data/isolate.cy.ts b/x-pack/plugins/security_solution/public/management/cypress/e2e/response_actions/isolate_mocked_data.cy.ts similarity index 100% rename from x-pack/plugins/security_solution/public/management/cypress/e2e/mocked_data/isolate.cy.ts rename to x-pack/plugins/security_solution/public/management/cypress/e2e/response_actions/isolate_mocked_data.cy.ts diff --git a/x-pack/plugins/security_solution/public/management/cypress/e2e/mocked_data/reponse_actions_history.cy.ts b/x-pack/plugins/security_solution/public/management/cypress/e2e/response_actions/reponse_actions_history.cy.ts similarity index 100% rename from x-pack/plugins/security_solution/public/management/cypress/e2e/mocked_data/reponse_actions_history.cy.ts rename to x-pack/plugins/security_solution/public/management/cypress/e2e/response_actions/reponse_actions_history.cy.ts diff --git a/x-pack/plugins/security_solution/public/management/cypress/e2e/mocked_data/responder.cy.ts b/x-pack/plugins/security_solution/public/management/cypress/e2e/response_actions/responder.cy.ts similarity index 100% rename from x-pack/plugins/security_solution/public/management/cypress/e2e/mocked_data/responder.cy.ts rename to x-pack/plugins/security_solution/public/management/cypress/e2e/response_actions/responder.cy.ts diff --git a/x-pack/plugins/security_solution/public/management/cypress/e2e/endpoint/response_console.cy.ts b/x-pack/plugins/security_solution/public/management/cypress/e2e/response_actions/response_console.cy.ts similarity index 100% rename from x-pack/plugins/security_solution/public/management/cypress/e2e/endpoint/response_console.cy.ts rename to x-pack/plugins/security_solution/public/management/cypress/e2e/response_actions/response_console.cy.ts diff --git a/x-pack/plugins/security_solution/public/management/cypress/e2e/mocked_data/response_console.cy.ts b/x-pack/plugins/security_solution/public/management/cypress/e2e/response_actions/response_console_mocked_data.cy.ts similarity index 100% rename from x-pack/plugins/security_solution/public/management/cypress/e2e/mocked_data/response_console.cy.ts rename to x-pack/plugins/security_solution/public/management/cypress/e2e/response_actions/response_console_mocked_data.cy.ts diff --git a/x-pack/plugins/security_solution/public/management/cypress/e2e/serverless/endpoint_list_with_security_essentials.cy.ts b/x-pack/plugins/security_solution/public/management/cypress/e2e/serverless/endpoint_list_with_security_essentials.cy.ts index 16ed98c46c549..58c41539361c5 100644 --- a/x-pack/plugins/security_solution/public/management/cypress/e2e/serverless/endpoint_list_with_security_essentials.cy.ts +++ b/x-pack/plugins/security_solution/public/management/cypress/e2e/serverless/endpoint_list_with_security_essentials.cy.ts @@ -18,6 +18,7 @@ import { describe( 'When on the Endpoint List in Security Essentials PLI', { + tags: ['@serverless', '@brokenInServerless'], env: { ftrConfig: { productTypes: [{ product_line: 'security', product_tier: 'essentials' }], diff --git a/x-pack/plugins/security_solution/public/management/cypress/e2e/serverless/feature_access/complete.cy.ts b/x-pack/plugins/security_solution/public/management/cypress/e2e/serverless/feature_access/complete.cy.ts index 4eb4197cff70f..7c4323b2aa689 100644 --- a/x-pack/plugins/security_solution/public/management/cypress/e2e/serverless/feature_access/complete.cy.ts +++ b/x-pack/plugins/security_solution/public/management/cypress/e2e/serverless/feature_access/complete.cy.ts @@ -14,6 +14,7 @@ import { getEndpointManagementPageList } from '../../../screens'; describe( 'App Features for Security Complete PLI', { + tags: ['@serverless', '@brokenInServerless'], env: { ftrConfig: { productTypes: [{ product_line: 'security', product_tier: 'complete' }] }, }, diff --git a/x-pack/plugins/security_solution/public/management/cypress/e2e/serverless/feature_access/complete_with_endpoint.cy.ts b/x-pack/plugins/security_solution/public/management/cypress/e2e/serverless/feature_access/complete_with_endpoint.cy.ts index 656821bea4bba..f3ae8b85a9f24 100644 --- a/x-pack/plugins/security_solution/public/management/cypress/e2e/serverless/feature_access/complete_with_endpoint.cy.ts +++ b/x-pack/plugins/security_solution/public/management/cypress/e2e/serverless/feature_access/complete_with_endpoint.cy.ts @@ -17,6 +17,7 @@ import { describe( 'App Features for Security Complete PLI with Endpoint Complete Addon', { + tags: ['@serverless', '@brokenInServerless'], env: { ftrConfig: { productTypes: [ diff --git a/x-pack/plugins/security_solution/public/management/cypress/e2e/serverless/feature_access/essentials.cy.ts b/x-pack/plugins/security_solution/public/management/cypress/e2e/serverless/feature_access/essentials.cy.ts index 29934be792c6d..900a5d81a9f46 100644 --- a/x-pack/plugins/security_solution/public/management/cypress/e2e/serverless/feature_access/essentials.cy.ts +++ b/x-pack/plugins/security_solution/public/management/cypress/e2e/serverless/feature_access/essentials.cy.ts @@ -14,6 +14,7 @@ import { getEndpointManagementPageList } from '../../../screens'; describe( 'App Features for Security Essential PLI', { + tags: ['@serverless', '@brokenInServerless'], env: { ftrConfig: { productTypes: [{ product_line: 'security', product_tier: 'essentials' }], diff --git a/x-pack/plugins/security_solution/public/management/cypress/e2e/serverless/feature_access/essentials_with_endpoint.cy.ts b/x-pack/plugins/security_solution/public/management/cypress/e2e/serverless/feature_access/essentials_with_endpoint.cy.ts index 020710ab4bf1a..7196b73f6813a 100644 --- a/x-pack/plugins/security_solution/public/management/cypress/e2e/serverless/feature_access/essentials_with_endpoint.cy.ts +++ b/x-pack/plugins/security_solution/public/management/cypress/e2e/serverless/feature_access/essentials_with_endpoint.cy.ts @@ -17,6 +17,7 @@ import { describe( 'App Features for Security Essentials PLI with Endpoint Essentials Addon', { + tags: ['@serverless', '@brokenInServerless'], env: { ftrConfig: { productTypes: [ diff --git a/x-pack/plugins/security_solution/public/management/cypress/e2e/serverless/policy_details_with_security_essentials.cy.ts b/x-pack/plugins/security_solution/public/management/cypress/e2e/serverless/policy_details_with_security_essentials.cy.ts index e9dea7475699c..faf9aba6237b3 100644 --- a/x-pack/plugins/security_solution/public/management/cypress/e2e/serverless/policy_details_with_security_essentials.cy.ts +++ b/x-pack/plugins/security_solution/public/management/cypress/e2e/serverless/policy_details_with_security_essentials.cy.ts @@ -12,6 +12,7 @@ import type { IndexedFleetEndpointPolicyResponse } from '../../../../../common/e describe( 'When displaying the Policy Details in Security Essentials PLI', { + tags: ['@serverless', '@brokenInServerless'], env: { ftrConfig: { productTypes: [{ product_line: 'security', product_tier: 'essentials' }], diff --git a/x-pack/plugins/security_solution/public/management/cypress/e2e/serverless/roles/complete_with_endpoint_roles.cy.ts b/x-pack/plugins/security_solution/public/management/cypress/e2e/serverless/roles/complete_with_endpoint_roles.cy.ts index 41ecdfe6ca140..879948a65c47d 100644 --- a/x-pack/plugins/security_solution/public/management/cypress/e2e/serverless/roles/complete_with_endpoint_roles.cy.ts +++ b/x-pack/plugins/security_solution/public/management/cypress/e2e/serverless/roles/complete_with_endpoint_roles.cy.ts @@ -33,6 +33,7 @@ import { describe( 'User Roles for Security Complete PLI with Endpoint Complete addon', { + tags: ['@serverless', '@brokenInServerless'], env: { ftrConfig: { productTypes: [ diff --git a/x-pack/plugins/security_solution/public/management/cypress/e2e/serverless/roles/essentials_with_endpoint.roles.cy.ts b/x-pack/plugins/security_solution/public/management/cypress/e2e/serverless/roles/essentials_with_endpoint.roles.cy.ts index c1e41921dcc22..fec6a0f803afb 100644 --- a/x-pack/plugins/security_solution/public/management/cypress/e2e/serverless/roles/essentials_with_endpoint.roles.cy.ts +++ b/x-pack/plugins/security_solution/public/management/cypress/e2e/serverless/roles/essentials_with_endpoint.roles.cy.ts @@ -26,6 +26,7 @@ import { describe( 'Roles for Security Essential PLI with Endpoint Essentials addon', { + tags: ['@serverless', '@brokenInServerless'], env: { ftrConfig: { productTypes: [ diff --git a/x-pack/plugins/security_solution/scripts/run_cypress/parallel.ts b/x-pack/plugins/security_solution/scripts/run_cypress/parallel.ts index 4cb94c1dc814f..d411cdf8e8abd 100644 --- a/x-pack/plugins/security_solution/scripts/run_cypress/parallel.ts +++ b/x-pack/plugins/security_solution/scripts/run_cypress/parallel.ts @@ -93,7 +93,7 @@ ${JSON.stringify(argv, null, 2)} ---------------------------------------------- `); - const isOpen = argv._[0] === 'open'; + const isOpen = argv._.includes('open'); const cypressConfigFilePath = require.resolve(`../../${argv.configFile}`) as string; const cypressConfigFile = await import(cypressConfigFilePath); diff --git a/x-pack/plugins/security_solution/tsconfig.json b/x-pack/plugins/security_solution/tsconfig.json index d6d5bb4e0676e..e73140fec20b7 100644 --- a/x-pack/plugins/security_solution/tsconfig.json +++ b/x-pack/plugins/security_solution/tsconfig.json @@ -17,7 +17,6 @@ "exclude": [ "target/**/*", "**/cypress/**", - "public/management/cypress_endpoint.config.ts", "public/management/cypress.config.ts" ], "kbn_references": [