diff --git a/.buildkite/ftr_platform_stateful_configs.yml b/.buildkite/ftr_platform_stateful_configs.yml index fec8a54de34e4..3b23a39f36034 100644 --- a/.buildkite/ftr_platform_stateful_configs.yml +++ b/.buildkite/ftr_platform_stateful_configs.yml @@ -132,9 +132,9 @@ enabled: - src/platform/test/server_integration/http/ssl_with_p12/config.js - src/platform/test/server_integration/http/ssl/config.js - src/platform/test/ui_capabilities/newsfeed_err/config.ts - - x-pack/test/accessibility/apps/group1/config.ts - - x-pack/test/accessibility/apps/group2/config.ts - - x-pack/test/accessibility/apps/group3/config.ts + - x-pack/platform/test/accessibility/apps/group1/config.ts + - x-pack/platform/test/accessibility/apps/group2/config.ts + - x-pack/platform/test/accessibility/apps/group3/config.ts - x-pack/platform/test/localization/config.ja_jp.ts - x-pack/platform/test/localization/config.fr_fr.ts - x-pack/platform/test/localization/config.zh_cn.ts diff --git a/.buildkite/ftr_search_stateful_configs.yml b/.buildkite/ftr_search_stateful_configs.yml index b7badad7a2f7c..0782c628b8912 100644 --- a/.buildkite/ftr_search_stateful_configs.yml +++ b/.buildkite/ftr_search_stateful_configs.yml @@ -14,3 +14,4 @@ enabled: - x-pack/solutions/search/test/functional/apps/search_playground/config.ts - x-pack/solutions/search/test/api_integration/apis/guided_onboarding/config.ts - x-pack/solutions/search/test/functional_solution_sidenav/config.ts + - x-pack/solutions/search/test/accessibility/config.ts diff --git a/.buildkite/ftr_security_stateful_configs.yml b/.buildkite/ftr_security_stateful_configs.yml index 0faba44bc1e7a..050a1e4c07eed 100644 --- a/.buildkite/ftr_security_stateful_configs.yml +++ b/.buildkite/ftr_security_stateful_configs.yml @@ -10,6 +10,7 @@ disabled: - x-pack/test/security_solution_endpoint/config.base.ts - x-pack/test/security_solution_endpoint_api_int/config.base.ts - x-pack/solutions/security/test/api_integration/config.ts + - x-pack/solutions/security/test/functional/config.base.ts # QA suites that are run out-of-band - x-pack/solutions/security/test/cloud_security_posture_functional/config.cloud.ts @@ -130,3 +131,4 @@ enabled: - x-pack/solutions/security/test/functional_solution_sidenav/config.ts - x-pack/solutions/security/test/session_view/basic/config.ts - x-pack/solutions/security/test/plugin_functional/config.ts + - x-pack/solutions/security/test/accessibility/config.ts diff --git a/.github/CODEOWNERS b/.github/CODEOWNERS index 6d56f88b373c1..c5717c5b514e9 100644 --- a/.github/CODEOWNERS +++ b/.github/CODEOWNERS @@ -1379,7 +1379,7 @@ x-pack/solutions/observability/plugins/observability/server/lib/esql_extensions /x-pack/test/functional/services/observability @elastic/obs-ux-management-team /x-pack/solutions/observability/test/functional/services/observability @elastic/obs-ux-management-team /x-pack/test/api_integration/apis/slos @elastic/obs-ux-management-team -/x-pack/test/accessibility/apps/group1/uptime.ts @elastic/obs-ux-management-team +/x-pack/platform/test/accessibility/apps/group1/uptime.ts @elastic/obs-ux-management-team /x-pack/solutions/observability/test/accessibility/apps/observability.ts @elastic/obs-ux-management-team /x-pack/solutions/observability/test/functional/services/slo/ @elastic/obs-ux-management-team /x-pack/packages/observability/alert_details @elastic/obs-ux-management-team @@ -1412,8 +1412,8 @@ x-pack/solutions/observability/plugins/observability/server/lib/esql_extensions /x-pack/platform/test/functional/apps/monitoring @elastic/stack-monitoring /x-pack/platform/test/api_integration/apis/monitoring @elastic/stack-monitoring /x-pack/platform/test/api_integration/apis/monitoring_collection @elastic/stack-monitoring -/x-pack/test/accessibility/apps/group1/kibana_overview.ts @elastic/stack-monitoring -/x-pack/test/accessibility/apps/group3/stack_monitoring.ts @elastic/stack-monitoring +/x-pack/platform/test/accessibility/apps/group1/kibana_overview.ts @elastic/stack-monitoring +/x-pack/platform/test/accessibility/apps/group3/stack_monitoring.ts @elastic/stack-monitoring # Fleet /x-pack/test/common/services/ingest_manager.ts @elastic/fleet # Assigned per https://github.com/elastic/kibana/pull/201648#discussion_r1859018893 @@ -1538,7 +1538,7 @@ x-pack/solutions/observability/plugins/observability/server/lib/esql_extensions ^/src/platform/test/functional/services/inspector.ts @elastic/kibana-presentation /x-pack/platform/test/functional/services/canvas_element.ts @elastic/kibana-presentation /x-pack/platform/test/functional/page_objects/canvas_page.ts @elastic/kibana-presentation -/x-pack/test/accessibility/apps/group3/canvas.ts @elastic/kibana-presentation +/x-pack/platform/test/accessibility/apps/group3/canvas.ts @elastic/kibana-presentation /x-pack/platform/test/upgrade/apps/canvas @elastic/kibana-presentation /x-pack/platform/test/upgrade/apps/dashboard @elastic/kibana-presentation ^/src/platform/test/functional/screenshots/baseline/tsvb_dashboard.png @elastic/kibana-presentation @@ -1581,9 +1581,9 @@ x-pack/solutions/observability/plugins/observability/server/lib/esql_extensions /x-pack/platform/test/stack_functional_integration/apps/ml @elastic/ml-ui /x-pack/test/functional/fixtures/kbn_archiver/ml @elastic/ml-ui /x-pack/platform/test/api_integration/apis/file_upload @elastic/ml-ui -/x-pack/test/accessibility/apps/group2/ml.ts @elastic/ml-ui -/x-pack/test/accessibility/apps/group2/ml_* @elastic/ml-ui -/x-pack/test/accessibility/apps/group3/ml_embeddables_in_dashboard.ts @elastic/ml-ui +/x-pack/platform/test/accessibility/apps/group2/ml.ts @elastic/ml-ui +/x-pack/platform/test/accessibility/apps/group2/ml_* @elastic/ml-ui +/x-pack/platform/test/accessibility/apps/group3/ml_embeddables_in_dashboard.ts @elastic/ml-ui /x-pack/platform/test/api_integration/apis/ml/ @elastic/ml-ui /x-pack/platform/test/functional/apps/ml/ @elastic/ml-ui /x-pack/test/functional/es_archives/ml/ @elastic/ml-ui @@ -1854,6 +1854,9 @@ x-pack/platform/plugins/shared/ml/server/models/data_recognizer/modules/security /x-pack/solutions/observability/test/functional_with_es_ssl/apps/index.ts @elastic/appex-qa /x-pack/platform/test/functional/services/pipeline_list.ts @elastic/appex-qa /x-pack/platform/test/functional/services/pipeline_editor.ts @elastic/appex-qa +/x-pack/platform/test/accessibility/ftr_provider_context.d.ts @elastic/appex-qa +/x-pack/platform/test/accessibility/page_objects.ts @elastic/appex-qa +/x-pack/platform/test/accessibility/services.ts @elastic/appex-qa # Core ^/src/platform/test/api_integration/fixtures/kbn_archiver/management/saved_objects/relationships.json @elastic/kibana-core @elastic/kibana-data-discovery @@ -2102,7 +2105,7 @@ x-pack/platform/plugins/private/cloud_integrations/cloud_full_story/server/confi /x-pack/solutions/observability/test/screenshot_creation/ @elastic/response-ops /x-pack/solutions/security/test/screenshot_creation/ @elastic/response-ops /x-pack/platform/test/rule_registry @elastic/response-ops @elastic/obs-ux-management-team -/x-pack/test/accessibility/apps/group3/rules_connectors.ts @elastic/response-ops +/x-pack/platform/test/accessibility/apps/group3/rules_connectors.ts @elastic/response-ops /x-pack/test_serverless/functional/page_objects/svl_triggers_actions_ui_page.ts @elastic/response-ops /x-pack/test_serverless/functional/page_objects/svl_rule_details_ui_page.ts @elastic/response-ops /x-pack/test_serverless/functional/page_objects/svl_oblt_overview_page.ts @elastic/response-ops @@ -2273,12 +2276,13 @@ x-pack/platform/plugins/private/cloud_integrations/cloud_full_story/server/confi /x-pack/test/security_solution_ftr @elastic/security-solution /x-pack/test/functional/es_archives/security_solution @elastic/security-solution /x-pack/test/functional/es_archives/rule_exceptions @elastic/security-solution # Assigned per https://github.com/elastic/kibana/pull/199795/files/ae80bb252bc71f787c122849fcb9b01e386fc5e9#r1840233040 +/x-pack/solutions/security/test/functional/ @elastic/security-solution /x-pack/solutions/security/test/functional_solution_sidenav/ @elastic/security-solution /x-pack/test/common/utils/security_solution/index.ts @elastic/security-solution /x-pack/solutions/security/test/plugin_functional/ @elastic/security-solution /x-pack/test/common/services/security_solution @elastic/security-solution /x-pack/test/api_integration/services/security_solution_*.gen.ts @elastic/security-solution -/x-pack/test/accessibility/apps/group3/security_solution.ts @elastic/security-solution +/x-pack/solutions/security/test/accessibility/ @elastic/security-solution /x-pack/test/functional/es_archives/endpoint/ @elastic/security-solution /x-pack/platform/test/plugin_functional/test_suites/resolver/ @elastic/security-solution /x-pack/test/security_solution_api_integration @elastic/security-solution @@ -2739,7 +2743,7 @@ x-pack/solutions/security/plugins/security_solution/server/lib/security_integrat # Ent. Search design /x-pack/solutions/search/plugins/enterprise_search/**/*.scss @elastic/search-design -/x-pack/test/accessibility/apps/group3/enterprise_search.ts @elastic/search-kibana +/x-pack/solutions/search/test/accessibility/ @elastic/search-kibana # Security design /x-pack/plugins/endpoint/**/*.scss @elastic/security-design @@ -2817,8 +2821,8 @@ x-pack/solutions/observability/plugins/observability_shared/public/components/pr /x-pack/platform/test/banners_functional @elastic/appex-sharedux /x-pack/platform/test/custom_branding @elastic/appex-sharedux /x-pack/platform/test/api_integration/apis/content_management @elastic/appex-sharedux -/x-pack/test/accessibility/apps/group3/tags.ts @elastic/appex-sharedux -/x-pack/test/accessibility/apps/group3/snapshot_and_restore.ts @elastic/appex-sharedux +/x-pack/platform/test/accessibility/apps/group3/tags.ts @elastic/appex-sharedux +/x-pack/platform/test/accessibility/apps/group3/snapshot_and_restore.ts @elastic/appex-sharedux /x-pack/test_serverless/functional/test_suites/common/spaces/spaces_selection.ts @elastic/appex-sharedux /x-pack/test_serverless/functional/test_suites/common/spaces/index.ts @elastic/appex-sharedux packages/react @elastic/appex-sharedux diff --git a/x-pack/platform/plugins/private/transform/readme.md b/x-pack/platform/plugins/private/transform/readme.md index 681f9cefc0dcf..47549501a2aaa 100644 --- a/x-pack/platform/plugins/private/transform/readme.md +++ b/x-pack/platform/plugins/private/transform/readme.md @@ -8,7 +8,6 @@ To use the transforms feature, you must have at least a Basic license. For more info, refer to [Set up transforms](https://www.elastic.co/guide/en/elasticsearch/reference/current/transform-setup.html). - ## Setup local environment ### Kibana @@ -56,9 +55,9 @@ different configurations on sample data. 1. Click the Elastic logo in the upper left hand corner of your browser to navigate to the Kibana home page. -1. Click *Load a data set and a Kibana dashboard*. +1. Click _Load a data set and a Kibana dashboard_. -1. Pick a data set or feel free to click *Add* on all of the available sample +1. Pick a data set or feel free to click _Add_ on all of the available sample data sets. These data sets are now ready to be used for creating transforms in Kibana. @@ -113,33 +112,33 @@ commands are With PATH_TO_CONFIG and other options as follows. -1. Functional UI tests with `Trial` license: +1. Functional UI tests with `Trial` license: - Group | PATH_TO_CONFIG - ----- | -------------- - creation - index pattern | `src/platform/test/functional/apps/transform/creation/index_pattern/config.ts` - creation - runtime mappings, saved searches | `src/platform/test/functional/apps/transform/creation/runtime_mappings_saved_search/config.ts` - edit, clone | `src/platform/test/functional/apps/transform/edit_clone/config.ts` - feature controls | `src/platform/test/functional/apps/transform/feature_controls/config.ts` - permissions | `src/platform/test/functional/apps/transform/permissions/config.ts` - actions | `src/platform/test/functional/apps/transform/actions/config.ts` + | Group | PATH_TO_CONFIG | + | ------------------------------------------- | ---------------------------------------------------------------------------------------------- | + | creation - index pattern | `src/platform/test/functional/apps/transform/creation/index_pattern/config.ts` | + | creation - runtime mappings, saved searches | `src/platform/test/functional/apps/transform/creation/runtime_mappings_saved_search/config.ts` | + | edit, clone | `src/platform/test/functional/apps/transform/edit_clone/config.ts` | + | feature controls | `src/platform/test/functional/apps/transform/feature_controls/config.ts` | + | permissions | `src/platform/test/functional/apps/transform/permissions/config.ts` | + | actions | `src/platform/test/functional/apps/transform/actions/config.ts` | 1. Functional UI tests with `Basic` license: - Group | PATH_TO_CONFIG - ----- | -------------- - creation - index pattern | `test/functional_basic/apps/transform/creation/index_pattern/config.ts` - creation - runtime mappings, saved searches | `test/functional_basic/apps/transform/creation/runtime_mappings_saved_search/config.ts` - edit, clone | `test/functional_basic/apps/transform/edit_clone/config.ts` - feature controls | `test/functional_basic/apps/transform/feature_controls/config.ts` - permissions | `test/functional_basic/apps/transform/permissions/config.ts` - actions | `test/functional_basic/apps/transform/actions/config.ts` + | Group | PATH_TO_CONFIG | + | ------------------------------------------- | --------------------------------------------------------------------------------------- | + | creation - index pattern | `test/functional_basic/apps/transform/creation/index_pattern/config.ts` | + | creation - runtime mappings, saved searches | `test/functional_basic/apps/transform/creation/runtime_mappings_saved_search/config.ts` | + | edit, clone | `test/functional_basic/apps/transform/edit_clone/config.ts` | + | feature controls | `test/functional_basic/apps/transform/feature_controls/config.ts` | + | permissions | `test/functional_basic/apps/transform/permissions/config.ts` | + | actions | `test/functional_basic/apps/transform/actions/config.ts` | -1. API integration tests with `Trial` license: +1. API integration tests with `Trial` license: - PATH_TO_CONFIG: `src/platform/test/api_integration/apis/transform/config.ts` -1. API integration tests with `Basic` license: +1. API integration tests with `Basic` license: - PATH_TO_CONFIG: `test/api_integration_basic/config.ts` - Add `--include-tag transform` to the test runner command @@ -151,4 +150,4 @@ With PATH_TO_CONFIG and other options as follows. node scripts/functional_tests_server --config src/platform/test/accessibility/config.ts node scripts/functional_test_runner.js --config src/platform/test/accessibility/config.ts --grep=transform - Transform accessibility tests are located in `x-pack/test/accessibility/apps/group2`. \ No newline at end of file + Transform accessibility tests are located in `x-pack/platform/test/accessibility/apps/group2`. diff --git a/x-pack/platform/plugins/shared/ml/readme.md b/x-pack/platform/plugins/shared/ml/readme.md index c44a086bd5a64..2cf501eedade3 100644 --- a/x-pack/platform/plugins/shared/ml/readme.md +++ b/x-pack/platform/plugins/shared/ml/readme.md @@ -149,7 +149,7 @@ With PATH_TO_CONFIG and other options as follows. - PATH_TO_CONFIG: `src/platform/test/accessibility/config.ts` - Add `--grep=ml` to the test runner command - - Tests are located in `x-pack/test/accessibility/apps/group2` + - Tests are located in `x-pack/platform/test/accessibility/apps/group2` ## Generating docs screenshots diff --git a/x-pack/test/accessibility/apps/group1/advanced_settings.ts b/x-pack/platform/test/accessibility/apps/group1/advanced_settings.ts similarity index 100% rename from x-pack/test/accessibility/apps/group1/advanced_settings.ts rename to x-pack/platform/test/accessibility/apps/group1/advanced_settings.ts diff --git a/x-pack/test/accessibility/apps/group1/config.ts b/x-pack/platform/test/accessibility/apps/group1/config.ts similarity index 84% rename from x-pack/test/accessibility/apps/group1/config.ts rename to x-pack/platform/test/accessibility/apps/group1/config.ts index 8e5510141abf9..06193687e3749 100644 --- a/x-pack/test/accessibility/apps/group1/config.ts +++ b/x-pack/platform/test/accessibility/apps/group1/config.ts @@ -11,7 +11,7 @@ import { pageObjects } from '../../page_objects'; export default async function ({ readConfigFile }: FtrConfigProviderContext) { const functionalConfig = await readConfigFile( - require.resolve('../../../functional/config.base.js') + require.resolve('../../../functional/config.base.ts') ); return { @@ -23,7 +23,7 @@ export default async function ({ readConfigFile }: FtrConfigProviderContext) { services, junit: { - reportName: 'X-Pack Accessibility Tests - Group 1', + reportName: 'X-Pack Patform Accessibility Tests - Group 1', }, }; } diff --git a/x-pack/test/accessibility/apps/group1/dashboard_controls.ts b/x-pack/platform/test/accessibility/apps/group1/dashboard_controls.ts similarity index 100% rename from x-pack/test/accessibility/apps/group1/dashboard_controls.ts rename to x-pack/platform/test/accessibility/apps/group1/dashboard_controls.ts diff --git a/x-pack/test/accessibility/apps/group1/dashboard_links.ts b/x-pack/platform/test/accessibility/apps/group1/dashboard_links.ts similarity index 100% rename from x-pack/test/accessibility/apps/group1/dashboard_links.ts rename to x-pack/platform/test/accessibility/apps/group1/dashboard_links.ts diff --git a/x-pack/test/accessibility/apps/group1/dashboard_panel_options.ts b/x-pack/platform/test/accessibility/apps/group1/dashboard_panel_options.ts similarity index 100% rename from x-pack/test/accessibility/apps/group1/dashboard_panel_options.ts rename to x-pack/platform/test/accessibility/apps/group1/dashboard_panel_options.ts diff --git a/x-pack/test/accessibility/apps/group1/grok_debugger.ts b/x-pack/platform/test/accessibility/apps/group1/grok_debugger.ts similarity index 100% rename from x-pack/test/accessibility/apps/group1/grok_debugger.ts rename to x-pack/platform/test/accessibility/apps/group1/grok_debugger.ts diff --git a/x-pack/test/accessibility/apps/group1/helpers.ts b/x-pack/platform/test/accessibility/apps/group1/helpers.ts similarity index 100% rename from x-pack/test/accessibility/apps/group1/helpers.ts rename to x-pack/platform/test/accessibility/apps/group1/helpers.ts diff --git a/x-pack/test/accessibility/apps/group1/home.ts b/x-pack/platform/test/accessibility/apps/group1/home.ts similarity index 100% rename from x-pack/test/accessibility/apps/group1/home.ts rename to x-pack/platform/test/accessibility/apps/group1/home.ts diff --git a/x-pack/test/accessibility/apps/group1/index.ts b/x-pack/platform/test/accessibility/apps/group1/index.ts similarity index 100% rename from x-pack/test/accessibility/apps/group1/index.ts rename to x-pack/platform/test/accessibility/apps/group1/index.ts diff --git a/x-pack/test/accessibility/apps/group1/index_lifecycle_management.ts b/x-pack/platform/test/accessibility/apps/group1/index_lifecycle_management.ts similarity index 100% rename from x-pack/test/accessibility/apps/group1/index_lifecycle_management.ts rename to x-pack/platform/test/accessibility/apps/group1/index_lifecycle_management.ts diff --git a/x-pack/test/accessibility/apps/group1/ingest_node_pipelines.ts b/x-pack/platform/test/accessibility/apps/group1/ingest_node_pipelines.ts similarity index 100% rename from x-pack/test/accessibility/apps/group1/ingest_node_pipelines.ts rename to x-pack/platform/test/accessibility/apps/group1/ingest_node_pipelines.ts diff --git a/x-pack/test/accessibility/apps/group1/kibana_overview.ts b/x-pack/platform/test/accessibility/apps/group1/kibana_overview.ts similarity index 100% rename from x-pack/test/accessibility/apps/group1/kibana_overview.ts rename to x-pack/platform/test/accessibility/apps/group1/kibana_overview.ts diff --git a/x-pack/test/accessibility/apps/group1/login_page.ts b/x-pack/platform/test/accessibility/apps/group1/login_page.ts similarity index 100% rename from x-pack/test/accessibility/apps/group1/login_page.ts rename to x-pack/platform/test/accessibility/apps/group1/login_page.ts diff --git a/x-pack/test/accessibility/apps/group1/management.ts b/x-pack/platform/test/accessibility/apps/group1/management.ts similarity index 100% rename from x-pack/test/accessibility/apps/group1/management.ts rename to x-pack/platform/test/accessibility/apps/group1/management.ts diff --git a/x-pack/test/accessibility/apps/group1/painless_lab.ts b/x-pack/platform/test/accessibility/apps/group1/painless_lab.ts similarity index 100% rename from x-pack/test/accessibility/apps/group1/painless_lab.ts rename to x-pack/platform/test/accessibility/apps/group1/painless_lab.ts diff --git a/x-pack/test/accessibility/apps/group1/roles.ts b/x-pack/platform/test/accessibility/apps/group1/roles.ts similarity index 100% rename from x-pack/test/accessibility/apps/group1/roles.ts rename to x-pack/platform/test/accessibility/apps/group1/roles.ts diff --git a/x-pack/test/accessibility/apps/group1/search_profiler.ts b/x-pack/platform/test/accessibility/apps/group1/search_profiler.ts similarity index 100% rename from x-pack/test/accessibility/apps/group1/search_profiler.ts rename to x-pack/platform/test/accessibility/apps/group1/search_profiler.ts diff --git a/x-pack/test/accessibility/apps/group1/spaces.ts b/x-pack/platform/test/accessibility/apps/group1/spaces.ts similarity index 100% rename from x-pack/test/accessibility/apps/group1/spaces.ts rename to x-pack/platform/test/accessibility/apps/group1/spaces.ts diff --git a/x-pack/test/accessibility/apps/group1/users.ts b/x-pack/platform/test/accessibility/apps/group1/users.ts similarity index 100% rename from x-pack/test/accessibility/apps/group1/users.ts rename to x-pack/platform/test/accessibility/apps/group1/users.ts diff --git a/x-pack/test/accessibility/apps/group2/config.ts b/x-pack/platform/test/accessibility/apps/group2/config.ts similarity index 92% rename from x-pack/test/accessibility/apps/group2/config.ts rename to x-pack/platform/test/accessibility/apps/group2/config.ts index 27cf620bc05c8..e25674d790b6a 100644 --- a/x-pack/test/accessibility/apps/group2/config.ts +++ b/x-pack/platform/test/accessibility/apps/group2/config.ts @@ -11,7 +11,7 @@ import { pageObjects } from '../../page_objects'; export default async function ({ readConfigFile }: FtrConfigProviderContext) { const functionalConfig = await readConfigFile( - require.resolve('../../../functional/config.base.js') + require.resolve('../../../functional/config.base.ts') ); return { diff --git a/x-pack/test/accessibility/apps/group2/index.ts b/x-pack/platform/test/accessibility/apps/group2/index.ts similarity index 100% rename from x-pack/test/accessibility/apps/group2/index.ts rename to x-pack/platform/test/accessibility/apps/group2/index.ts diff --git a/x-pack/test/accessibility/apps/group2/lens.ts b/x-pack/platform/test/accessibility/apps/group2/lens.ts similarity index 100% rename from x-pack/test/accessibility/apps/group2/lens.ts rename to x-pack/platform/test/accessibility/apps/group2/lens.ts diff --git a/x-pack/test/accessibility/apps/group2/ml.ts b/x-pack/platform/test/accessibility/apps/group2/ml.ts similarity index 99% rename from x-pack/test/accessibility/apps/group2/ml.ts rename to x-pack/platform/test/accessibility/apps/group2/ml.ts index 028b7a7ceecb1..1494b9d8e5724 100644 --- a/x-pack/test/accessibility/apps/group2/ml.ts +++ b/x-pack/platform/test/accessibility/apps/group2/ml.ts @@ -68,7 +68,7 @@ export default function ({ getService }: FtrProviderContext) { const dfaClassificationJobTrainingPercent = 30; const uploadFilePath = require.resolve( - '@kbn/test-suites-xpack-platform/functional/apps/ml/data_visualizer/files_to_import/artificial_server_log' + '../../../functional/apps/ml/data_visualizer/files_to_import/artificial_server_log' ); before(async () => { diff --git a/x-pack/test/accessibility/apps/group2/ml_anomaly_detection.ts b/x-pack/platform/test/accessibility/apps/group2/ml_anomaly_detection.ts similarity index 100% rename from x-pack/test/accessibility/apps/group2/ml_anomaly_detection.ts rename to x-pack/platform/test/accessibility/apps/group2/ml_anomaly_detection.ts diff --git a/x-pack/test/accessibility/apps/group2/ml_memory_usage.ts b/x-pack/platform/test/accessibility/apps/group2/ml_memory_usage.ts similarity index 100% rename from x-pack/test/accessibility/apps/group2/ml_memory_usage.ts rename to x-pack/platform/test/accessibility/apps/group2/ml_memory_usage.ts diff --git a/x-pack/test/accessibility/apps/group2/ml_trained_models.ts b/x-pack/platform/test/accessibility/apps/group2/ml_trained_models.ts similarity index 100% rename from x-pack/test/accessibility/apps/group2/ml_trained_models.ts rename to x-pack/platform/test/accessibility/apps/group2/ml_trained_models.ts diff --git a/x-pack/test/accessibility/apps/group2/transform.ts b/x-pack/platform/test/accessibility/apps/group2/transform.ts similarity index 100% rename from x-pack/test/accessibility/apps/group2/transform.ts rename to x-pack/platform/test/accessibility/apps/group2/transform.ts diff --git a/x-pack/test/accessibility/apps/group3/canvas.ts b/x-pack/platform/test/accessibility/apps/group3/canvas.ts similarity index 100% rename from x-pack/test/accessibility/apps/group3/canvas.ts rename to x-pack/platform/test/accessibility/apps/group3/canvas.ts diff --git a/x-pack/test/accessibility/apps/group3/config.ts b/x-pack/platform/test/accessibility/apps/group3/config.ts similarity index 92% rename from x-pack/test/accessibility/apps/group3/config.ts rename to x-pack/platform/test/accessibility/apps/group3/config.ts index 94f6c862b5396..71626f72e1eaf 100644 --- a/x-pack/test/accessibility/apps/group3/config.ts +++ b/x-pack/platform/test/accessibility/apps/group3/config.ts @@ -11,7 +11,7 @@ import { pageObjects } from '../../page_objects'; export default async function ({ readConfigFile }: FtrConfigProviderContext) { const functionalConfig = await readConfigFile( - require.resolve('../../../functional/config.base.js') + require.resolve('../../../functional/config.base.ts') ); return { diff --git a/x-pack/test/accessibility/apps/group3/cross_cluster_replication.ts b/x-pack/platform/test/accessibility/apps/group3/cross_cluster_replication.ts similarity index 100% rename from x-pack/test/accessibility/apps/group3/cross_cluster_replication.ts rename to x-pack/platform/test/accessibility/apps/group3/cross_cluster_replication.ts diff --git a/x-pack/test/accessibility/apps/group3/graph.ts b/x-pack/platform/test/accessibility/apps/group3/graph.ts similarity index 100% rename from x-pack/test/accessibility/apps/group3/graph.ts rename to x-pack/platform/test/accessibility/apps/group3/graph.ts diff --git a/x-pack/test/accessibility/apps/group3/grok_debugger.ts b/x-pack/platform/test/accessibility/apps/group3/grok_debugger.ts similarity index 100% rename from x-pack/test/accessibility/apps/group3/grok_debugger.ts rename to x-pack/platform/test/accessibility/apps/group3/grok_debugger.ts diff --git a/x-pack/test/accessibility/apps/group3/index.ts b/x-pack/platform/test/accessibility/apps/group3/index.ts similarity index 93% rename from x-pack/test/accessibility/apps/group3/index.ts rename to x-pack/platform/test/accessibility/apps/group3/index.ts index d295c2a17a4f0..57c9ff090f9a9 100644 --- a/x-pack/test/accessibility/apps/group3/index.ts +++ b/x-pack/platform/test/accessibility/apps/group3/index.ts @@ -13,7 +13,6 @@ export default ({ loadTestFile }: FtrProviderContext): void => { loadTestFile(require.resolve('./canvas')); loadTestFile(require.resolve('./maps')); loadTestFile(require.resolve('./graph')); - loadTestFile(require.resolve('./security_solution')); loadTestFile(require.resolve('./ml_embeddables_in_dashboard')); loadTestFile(require.resolve('./rules_connectors')); // Please make sure that the remote clusters, snapshot and restore and @@ -22,7 +21,6 @@ export default ({ loadTestFile }: FtrProviderContext): void => { loadTestFile(require.resolve('./snapshot_and_restore')); loadTestFile(require.resolve('./cross_cluster_replication')); loadTestFile(require.resolve('./reporting')); - loadTestFile(require.resolve('./enterprise_search')); // loadTestFile(require.resolve('./license_management')); // loadTestFile(require.resolve('./tags')); diff --git a/x-pack/test/accessibility/apps/group3/license_management.ts b/x-pack/platform/test/accessibility/apps/group3/license_management.ts similarity index 100% rename from x-pack/test/accessibility/apps/group3/license_management.ts rename to x-pack/platform/test/accessibility/apps/group3/license_management.ts diff --git a/x-pack/test/accessibility/apps/group3/maps.ts b/x-pack/platform/test/accessibility/apps/group3/maps.ts similarity index 100% rename from x-pack/test/accessibility/apps/group3/maps.ts rename to x-pack/platform/test/accessibility/apps/group3/maps.ts diff --git a/x-pack/test/accessibility/apps/group3/ml_embeddables_in_dashboard.ts b/x-pack/platform/test/accessibility/apps/group3/ml_embeddables_in_dashboard.ts similarity index 100% rename from x-pack/test/accessibility/apps/group3/ml_embeddables_in_dashboard.ts rename to x-pack/platform/test/accessibility/apps/group3/ml_embeddables_in_dashboard.ts diff --git a/x-pack/test/accessibility/apps/group3/remote_clusters.ts b/x-pack/platform/test/accessibility/apps/group3/remote_clusters.ts similarity index 100% rename from x-pack/test/accessibility/apps/group3/remote_clusters.ts rename to x-pack/platform/test/accessibility/apps/group3/remote_clusters.ts diff --git a/x-pack/test/accessibility/apps/group3/reporting.ts b/x-pack/platform/test/accessibility/apps/group3/reporting.ts similarity index 100% rename from x-pack/test/accessibility/apps/group3/reporting.ts rename to x-pack/platform/test/accessibility/apps/group3/reporting.ts diff --git a/x-pack/test/accessibility/apps/group3/rollup_jobs.ts b/x-pack/platform/test/accessibility/apps/group3/rollup_jobs.ts similarity index 100% rename from x-pack/test/accessibility/apps/group3/rollup_jobs.ts rename to x-pack/platform/test/accessibility/apps/group3/rollup_jobs.ts diff --git a/x-pack/test/accessibility/apps/group3/rules_connectors.ts b/x-pack/platform/test/accessibility/apps/group3/rules_connectors.ts similarity index 100% rename from x-pack/test/accessibility/apps/group3/rules_connectors.ts rename to x-pack/platform/test/accessibility/apps/group3/rules_connectors.ts diff --git a/x-pack/test/accessibility/apps/group3/search_sessions.ts b/x-pack/platform/test/accessibility/apps/group3/search_sessions.ts similarity index 100% rename from x-pack/test/accessibility/apps/group3/search_sessions.ts rename to x-pack/platform/test/accessibility/apps/group3/search_sessions.ts diff --git a/x-pack/test/accessibility/apps/group3/snapshot_and_restore.ts b/x-pack/platform/test/accessibility/apps/group3/snapshot_and_restore.ts similarity index 100% rename from x-pack/test/accessibility/apps/group3/snapshot_and_restore.ts rename to x-pack/platform/test/accessibility/apps/group3/snapshot_and_restore.ts diff --git a/x-pack/test/accessibility/apps/group3/stack_monitoring.ts b/x-pack/platform/test/accessibility/apps/group3/stack_monitoring.ts similarity index 100% rename from x-pack/test/accessibility/apps/group3/stack_monitoring.ts rename to x-pack/platform/test/accessibility/apps/group3/stack_monitoring.ts diff --git a/x-pack/test/accessibility/apps/group3/tags.ts b/x-pack/platform/test/accessibility/apps/group3/tags.ts similarity index 100% rename from x-pack/test/accessibility/apps/group3/tags.ts rename to x-pack/platform/test/accessibility/apps/group3/tags.ts diff --git a/x-pack/test/accessibility/apps/group3/upgrade_assistant.ts b/x-pack/platform/test/accessibility/apps/group3/upgrade_assistant.ts similarity index 100% rename from x-pack/test/accessibility/apps/group3/upgrade_assistant.ts rename to x-pack/platform/test/accessibility/apps/group3/upgrade_assistant.ts diff --git a/x-pack/test/accessibility/apps/group3/watcher.ts b/x-pack/platform/test/accessibility/apps/group3/watcher.ts similarity index 100% rename from x-pack/test/accessibility/apps/group3/watcher.ts rename to x-pack/platform/test/accessibility/apps/group3/watcher.ts diff --git a/x-pack/test/accessibility/ftr_provider_context.d.ts b/x-pack/platform/test/accessibility/ftr_provider_context.d.ts similarity index 100% rename from x-pack/test/accessibility/ftr_provider_context.d.ts rename to x-pack/platform/test/accessibility/ftr_provider_context.d.ts diff --git a/x-pack/test/accessibility/page_objects.ts b/x-pack/platform/test/accessibility/page_objects.ts similarity index 100% rename from x-pack/test/accessibility/page_objects.ts rename to x-pack/platform/test/accessibility/page_objects.ts diff --git a/x-pack/test/accessibility/services.ts b/x-pack/platform/test/accessibility/services.ts similarity index 100% rename from x-pack/test/accessibility/services.ts rename to x-pack/platform/test/accessibility/services.ts diff --git a/x-pack/platform/test/tsconfig.json b/x-pack/platform/test/tsconfig.json index aa9ff8959ad52..e4eeb14c0c11e 100644 --- a/x-pack/platform/test/tsconfig.json +++ b/x-pack/platform/test/tsconfig.json @@ -149,6 +149,7 @@ "@kbn/visualizations-plugin", "@kbn/datemath", "@kbn/global-search-plugin", - "@kbn/global-search-test-plugin" + "@kbn/global-search-test-plugin", + "@kbn/remote-clusters-plugin" ] } diff --git a/x-pack/test/accessibility/apps/group3/enterprise_search.ts b/x-pack/solutions/search/test/accessibility/apps/enterprise_search.ts similarity index 96% rename from x-pack/test/accessibility/apps/group3/enterprise_search.ts rename to x-pack/solutions/search/test/accessibility/apps/enterprise_search.ts index 259593a408c3f..8732ef68c5e77 100644 --- a/x-pack/test/accessibility/apps/group3/enterprise_search.ts +++ b/x-pack/solutions/search/test/accessibility/apps/enterprise_search.ts @@ -5,7 +5,7 @@ * 2.0. */ -import { FtrProviderContext } from '../../ftr_provider_context'; +import { FtrProviderContext } from '../ftr_provider_context'; export default function ({ getService, getPageObjects }: FtrProviderContext) { const a11y = getService('a11y'); @@ -14,7 +14,8 @@ export default function ({ getService, getPageObjects }: FtrProviderContext) { const { common } = getPageObjects(['common']); const kibanaServer = getService('kibanaServer'); - describe('Enterprise Search Accessibility', () => { + // test constantly fails in 9.1/8.19 after SKA tests relocation + describe.skip('Enterprise Search Accessibility', () => { // NOTE: These accessibility tests currently only run against Enterprise Search in Kibana // without a sidecar Enterprise Search service/host configured, and as such only test // the basic setup guides and not the full application(s) diff --git a/x-pack/solutions/search/test/accessibility/apps/index.ts b/x-pack/solutions/search/test/accessibility/apps/index.ts new file mode 100644 index 0000000000000..c894643cbe3ec --- /dev/null +++ b/x-pack/solutions/search/test/accessibility/apps/index.ts @@ -0,0 +1,14 @@ +/* + * 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 { FtrProviderContext } from '../ftr_provider_context'; + +export default function ({ loadTestFile }: FtrProviderContext) { + describe('X-Pack Search Accessibility Tests', function () { + loadTestFile(require.resolve('./enterprise_search')); + }); +} diff --git a/x-pack/solutions/search/test/accessibility/config.ts b/x-pack/solutions/search/test/accessibility/config.ts new file mode 100644 index 0000000000000..778e16ab1c76f --- /dev/null +++ b/x-pack/solutions/search/test/accessibility/config.ts @@ -0,0 +1,27 @@ +/* + * 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 { FtrConfigProviderContext } from '@kbn/test'; +import { services } from './services'; +import { pageObjects } from './page_objects'; + +export default async function ({ readConfigFile }: FtrConfigProviderContext) { + const functionalConfig = await readConfigFile(require.resolve('../functional_search/config.ts')); + + return { + ...functionalConfig.getAll(), + + testFiles: [require.resolve('./apps')], + + pageObjects, + services, + + junit: { + reportName: 'X-Pack Search Accessibility Tests', + }, + }; +} diff --git a/x-pack/solutions/search/test/accessibility/ftr_provider_context.d.ts b/x-pack/solutions/search/test/accessibility/ftr_provider_context.d.ts new file mode 100644 index 0000000000000..24f5087ef7fe2 --- /dev/null +++ b/x-pack/solutions/search/test/accessibility/ftr_provider_context.d.ts @@ -0,0 +1,13 @@ +/* + * 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 { GenericFtrProviderContext } from '@kbn/test'; + +import { pageObjects } from './page_objects'; +import { services } from './services'; + +export type FtrProviderContext = GenericFtrProviderContext; diff --git a/x-pack/solutions/search/test/accessibility/page_objects.ts b/x-pack/solutions/search/test/accessibility/page_objects.ts new file mode 100644 index 0000000000000..5cf4058648f29 --- /dev/null +++ b/x-pack/solutions/search/test/accessibility/page_objects.ts @@ -0,0 +1,8 @@ +/* + * 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. + */ + +export { pageObjects } from '../functional_search/page_objects'; diff --git a/x-pack/solutions/search/test/accessibility/services.ts b/x-pack/solutions/search/test/accessibility/services.ts new file mode 100644 index 0000000000000..80ccfe742bccf --- /dev/null +++ b/x-pack/solutions/search/test/accessibility/services.ts @@ -0,0 +1,14 @@ +/* + * 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 { services as kibanaA11yServices } from '@kbn/test-suites-src/accessibility/services'; +import { services as functionalServices } from '../functional_search/services'; + +export const services = { + ...kibanaA11yServices, + ...functionalServices, +}; diff --git a/x-pack/solutions/search/test/tsconfig.json b/x-pack/solutions/search/test/tsconfig.json index 8c778b219e18c..30346fc63c4ea 100644 --- a/x-pack/solutions/search/test/tsconfig.json +++ b/x-pack/solutions/search/test/tsconfig.json @@ -31,5 +31,6 @@ "@kbn/ftr-common-functional-ui-services", "@kbn/observability-ai-assistant-plugin", "@kbn/inference-common", + "@kbn/test-suites-src", ] } diff --git a/x-pack/solutions/security/test/accessibility/apps/index.ts b/x-pack/solutions/security/test/accessibility/apps/index.ts new file mode 100644 index 0000000000000..865d473e42de2 --- /dev/null +++ b/x-pack/solutions/security/test/accessibility/apps/index.ts @@ -0,0 +1,14 @@ +/* + * 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 { FtrProviderContext } from '../ftr_provider_context'; + +export default function ({ loadTestFile }: FtrProviderContext) { + describe('X-Pack Security Accessibility Tests', function () { + loadTestFile(require.resolve('./security_solution')); + }); +} diff --git a/x-pack/test/accessibility/apps/group3/security_solution.ts b/x-pack/solutions/security/test/accessibility/apps/security_solution.ts similarity index 98% rename from x-pack/test/accessibility/apps/group3/security_solution.ts rename to x-pack/solutions/security/test/accessibility/apps/security_solution.ts index 61f7ef04177d5..a07b9465f2f66 100644 --- a/x-pack/test/accessibility/apps/group3/security_solution.ts +++ b/x-pack/solutions/security/test/accessibility/apps/security_solution.ts @@ -5,7 +5,7 @@ * 2.0. */ -import { FtrProviderContext } from '../../ftr_provider_context'; +import { FtrProviderContext } from '../ftr_provider_context'; export default function ({ getService, getPageObjects }: FtrProviderContext) { const a11y = getService('a11y'); diff --git a/x-pack/solutions/security/test/accessibility/config.ts b/x-pack/solutions/security/test/accessibility/config.ts new file mode 100644 index 0000000000000..2c6a86d96f426 --- /dev/null +++ b/x-pack/solutions/security/test/accessibility/config.ts @@ -0,0 +1,27 @@ +/* + * 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 { FtrConfigProviderContext } from '@kbn/test'; +import { services } from './services'; +import { pageObjects } from './page_objects'; + +export default async function ({ readConfigFile }: FtrConfigProviderContext) { + const functionalConfig = await readConfigFile(require.resolve('../functional/config.base.ts')); + + return { + ...functionalConfig.getAll(), + + testFiles: [require.resolve('./apps')], + + pageObjects, + services, + + junit: { + reportName: 'X-Pack Security Accessibility Tests', + }, + }; +} diff --git a/x-pack/solutions/security/test/accessibility/ftr_provider_context.d.ts b/x-pack/solutions/security/test/accessibility/ftr_provider_context.d.ts new file mode 100644 index 0000000000000..24f5087ef7fe2 --- /dev/null +++ b/x-pack/solutions/security/test/accessibility/ftr_provider_context.d.ts @@ -0,0 +1,13 @@ +/* + * 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 { GenericFtrProviderContext } from '@kbn/test'; + +import { pageObjects } from './page_objects'; +import { services } from './services'; + +export type FtrProviderContext = GenericFtrProviderContext; diff --git a/x-pack/solutions/security/test/accessibility/page_objects.ts b/x-pack/solutions/security/test/accessibility/page_objects.ts new file mode 100644 index 0000000000000..d97010fb1bac9 --- /dev/null +++ b/x-pack/solutions/security/test/accessibility/page_objects.ts @@ -0,0 +1,8 @@ +/* + * 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. + */ + +export { pageObjects } from '../functional/page_objects'; diff --git a/x-pack/solutions/security/test/accessibility/services.ts b/x-pack/solutions/security/test/accessibility/services.ts new file mode 100644 index 0000000000000..d7f56d3be6dd8 --- /dev/null +++ b/x-pack/solutions/security/test/accessibility/services.ts @@ -0,0 +1,14 @@ +/* + * 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 { services as kibanaA11yServices } from '@kbn/test-suites-src/accessibility/services'; +import { services as functionalServices } from '../functional/services'; + +export const services = { + ...kibanaA11yServices, + ...functionalServices, +}; diff --git a/x-pack/solutions/security/test/functional/config.base.ts b/x-pack/solutions/security/test/functional/config.base.ts new file mode 100644 index 0000000000000..e54daffd0cdd7 --- /dev/null +++ b/x-pack/solutions/security/test/functional/config.base.ts @@ -0,0 +1,39 @@ +/* + * 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 { ScoutTestRunConfigCategory } from '@kbn/scout-info'; +import { FtrConfigProviderContext } from '@kbn/test'; +import { services } from './services'; +import { pageObjects } from './page_objects'; + +export async function getFunctionalConfig({ readConfigFile }: FtrConfigProviderContext) { + const xPackPlatformFunctionalTestsConfig = await readConfigFile( + require.resolve('@kbn/test-suites-xpack-platform/functional/config.base') + ); + + return { + ...xPackPlatformFunctionalTestsConfig.getAll(), + services, + pageObjects, + testConfigCategory: ScoutTestRunConfigCategory.UI_TEST, + servers: xPackPlatformFunctionalTestsConfig.get('servers'), + security: xPackPlatformFunctionalTestsConfig.get('security'), + junit: { + reportName: 'X-Pack Security Functional UI Tests', + }, + kbnTestServer: { + ...xPackPlatformFunctionalTestsConfig.get('kbnTestServer'), + serverArgs: [...xPackPlatformFunctionalTestsConfig.get('kbnTestServer.serverArgs')], + }, + esTestCluster: { + ...xPackPlatformFunctionalTestsConfig.get('esTestCluster'), + serverArgs: [...xPackPlatformFunctionalTestsConfig.get('esTestCluster.serverArgs')], + }, + }; +} + +export default getFunctionalConfig; diff --git a/x-pack/solutions/security/test/functional/ftr_provider_context.d.ts b/x-pack/solutions/security/test/functional/ftr_provider_context.d.ts new file mode 100644 index 0000000000000..e757164fa1de9 --- /dev/null +++ b/x-pack/solutions/security/test/functional/ftr_provider_context.d.ts @@ -0,0 +1,14 @@ +/* + * 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 { GenericFtrProviderContext, GenericFtrService } from '@kbn/test'; + +import { pageObjects } from './page_objects'; +import { services } from './services'; + +export type FtrProviderContext = GenericFtrProviderContext; +export class FtrService extends GenericFtrService {} diff --git a/x-pack/solutions/security/test/functional/page_objects/detections.ts b/x-pack/solutions/security/test/functional/page_objects/detections.ts new file mode 100644 index 0000000000000..07ab9b18fb95c --- /dev/null +++ b/x-pack/solutions/security/test/functional/page_objects/detections.ts @@ -0,0 +1,244 @@ +/* + * 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 { WebElementWrapper } from '@kbn/ftr-common-functional-ui-services'; +import { FtrService } from '@kbn/test-suites-xpack-platform/functional/ftr_provider_context'; + +const ALERT_TABLE_ROW_CSS_SELECTOR = '[data-test-subj="alertsTableIsLoaded"] .euiDataGridRow'; + +export class DetectionsPageObject extends FtrService { + private readonly find = this.ctx.getService('find'); + private readonly common = this.ctx.getPageObject('common'); + private readonly testSubjects = this.ctx.getService('testSubjects'); + private readonly headerPageObjects = this.ctx.getPageObject('header'); + private readonly retry = this.ctx.getService('retry'); + private readonly defaultTimeoutMs = this.ctx.getService('config').get('timeouts.waitFor'); + + async navigateHome(): Promise { + await this.navigateToDetectionsPage(); + } + + /** + * Navigate to the Alerts list page. + * @param searchParams + * + * @example + * + * // filter list by alert only for a given host name + * navigateToAlerts(`query=(language:kuery,query:'host.hostname: "HOST-abc"')`) + */ + async navigateToAlerts(searchParams: string = ''): Promise { + await this.common.navigateToUrlWithBrowserHistory('securitySolution', '/alerts', searchParams, { + ensureCurrentUrl: !Boolean(searchParams), + }); + await this.headerPageObjects.waitUntilLoadingHasFinished(); + } + + async navigateToRules(): Promise { + await this.navigateToDetectionsPage('rules'); + } + + async navigateToCreateRule(): Promise { + await this.navigateToDetectionsPage('rules/create'); + } + + async replaceIndexPattern(): Promise { + const buttons = await this.find.allByCssSelector('[data-test-subj="comboBoxInput"] button'); + await Promise.all(buttons.map((button: WebElementWrapper) => button.click())); + await this.testSubjects.setValue('comboBoxSearchInput', '*'); + } + + async openImportQueryModal(): Promise { + const element = await this.testSubjects.find('importQueryFromSavedTimeline'); + await element.click(500); + await this.testSubjects.exists('open-timeline-modal-body-filter-default'); + } + + async viewTemplatesInImportQueryModal(): Promise { + await this.common.clickAndValidate( + 'open-timeline-modal-body-filter-template', + 'timelines-table' + ); + } + + async closeImportQueryModal(): Promise { + await this.find.clickByCssSelector('.euiButtonIcon.euiModal__closeIcon'); + } + + async selectMachineLearningJob(): Promise { + await this.find.clickByCssSelector('[data-test-subj="mlJobSelect"] button'); + await this.find.clickByCssSelector('#high_distinct_count_error_message'); + } + + async openAddFilterPopover(): Promise { + const addButtons = await this.testSubjects.findAll('addFilter'); + await addButtons[1].click(); + await this.testSubjects.exists('saveFilter'); + } + + async closeAddFilterPopover(): Promise { + await this.testSubjects.click('cancelSaveFilter'); + } + + async toggleFilterActions(): Promise { + const filterActions = await this.testSubjects.findAll('addFilter'); + await filterActions[1].click(); + } + + async toggleSavedQueries(): Promise { + const filterActions = await this.find.allByCssSelector( + '[data-test-subj="saved-query-management-popover-button"]' + ); + await filterActions[1].click(); + } + + async addNameAndDescription( + name: string = 'test rule name', + description: string = 'test rule description' + ): Promise { + await this.find.setValue(`[aria-describedby="detectionEngineStepAboutRuleName"]`, name, 500); + await this.find.setValue( + `[aria-describedby="detectionEngineStepAboutRuleDescription"]`, + description, + 500 + ); + } + + async goBackToAllRules(): Promise { + await this.common.clickAndValidate('ruleDetailsBackToAllRules', 'create-new-rule'); + } + + async revealAdvancedSettings(): Promise { + await this.common.clickAndValidate( + 'advancedSettings', + 'detectionEngineStepAboutRuleReferenceUrls' + ); + } + + async preview(): Promise { + await this.common.clickAndValidate( + 'previewSubmitButton', + 'queryPreviewCustomHistogram', + undefined, + 500 + ); + } + + async continue(prefix: string): Promise { + await this.testSubjects.click(`${prefix}-continue`); + } + + async addCustomQuery(query: string): Promise { + await this.testSubjects.setValue('queryInput', query, undefined, 500); + } + + async selectMLRule(): Promise { + await this.common.clickAndValidate('machineLearningRuleType', 'mlJobSelect'); + } + + async selectEQLRule(): Promise { + await this.common.clickAndValidate('eqlRuleType', 'eqlQueryBarTextInput'); + } + + async selectIndicatorMatchRule(): Promise { + await this.common.clickAndValidate('threatMatchRuleType', 'comboBoxInput'); + } + + async selectThresholdRule(): Promise { + await this.common.clickAndValidate('thresholdRuleType', 'input'); + } + + async ensureOnAlertsPage(): Promise { + await this.testSubjects.existOrFail('detectionsAlertsPage'); + } + + /** + * Opens the first alert on the Alerts List page for the given host name + * @param hostName + */ + async openFirstAlertDetailsForHostName(hostName: string): Promise { + await this.ensureOnAlertsPage(); + + let foundAndHandled = false; + + // Get all event rows + const allEvents = await this.testSubjects.findService.allByCssSelector( + ALERT_TABLE_ROW_CSS_SELECTOR + ); + + for (const eventRow of allEvents) { + const hostNameButton = await this.testSubjects.findDescendant( + 'host-details-button', + eventRow + ); + const eventRowHostName = (await hostNameButton.getVisibleText()).trim(); + + if (eventRowHostName === hostName) { + const expandAlertButton = await this.testSubjects.findDescendant('expand-event', eventRow); + await expandAlertButton.click(); + await this.testSubjects.existOrFail('eventDetails'); + foundAndHandled = true; + break; + } + } + + if (!foundAndHandled) { + throw new Error(`no alerts found for host: ${hostName}`); + } + } + + /** + * Opens the Response console from the alert Details. Alert details must be already opened/displayed + */ + async openResponseConsoleFromAlertDetails(): Promise { + await this.testSubjects.existOrFail('eventDetails'); + await this.testSubjects.click('securitySolutionFlyoutFooterDropdownButton'); + await this.testSubjects.clickWhenNotDisabled('endpointResponseActions-action-item'); + await this.testSubjects.existOrFail('consolePageOverlay'); + } + + /** + * Clicks the refresh button on the Alerts page and waits for it to complete + */ + async clickRefresh(): Promise { + await this.ensureOnAlertsPage(); + await this.testSubjects.click('querySubmitButton'); + + // wait for refresh to complete + await this.retry.waitFor( + 'Alerts pages refresh button to be enabled', + async (): Promise => { + const refreshButton = await this.testSubjects.find('querySubmitButton'); + + return (await refreshButton.isDisplayed()) && (await refreshButton.isEnabled()); + } + ); + } + + async waitForListToHaveAlerts(timeoutMs?: number): Promise { + await this.retry.waitForWithTimeout( + 'waiting for alerts to show up on alerts page', + timeoutMs ?? this.defaultTimeoutMs, + async (): Promise => { + await this.clickRefresh(); + + const allEventRows = await this.testSubjects.findService.allByCssSelector( + ALERT_TABLE_ROW_CSS_SELECTOR + ); + + return Boolean(allEventRows.length); + } + ); + } + + private async navigateToDetectionsPage(path: string = ''): Promise { + const subUrl = `detections${path ? `/${path}` : ''}`; + await this.common.navigateToUrl('securitySolution', subUrl, { + shouldUseHashForSubUrl: false, + }); + } +} diff --git a/x-pack/solutions/security/test/functional/page_objects/index.ts b/x-pack/solutions/security/test/functional/page_objects/index.ts new file mode 100644 index 0000000000000..0fa35dc884cef --- /dev/null +++ b/x-pack/solutions/security/test/functional/page_objects/index.ts @@ -0,0 +1,14 @@ +/* + * 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 { pageObjects as platformPageObjects } from '@kbn/test-suites-xpack-platform/functional/page_objects'; +import { DetectionsPageObject } from './detections'; + +export const pageObjects = { + ...platformPageObjects, + detections: DetectionsPageObject, +}; diff --git a/x-pack/solutions/security/test/functional/services/index.ts b/x-pack/solutions/security/test/functional/services/index.ts new file mode 100644 index 0000000000000..5b3515c3d3f46 --- /dev/null +++ b/x-pack/solutions/security/test/functional/services/index.ts @@ -0,0 +1,12 @@ +/* + * 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 { services as platformServices } from '@kbn/test-suites-xpack-platform/functional/services'; + +export const services = { + ...platformServices, +}; diff --git a/x-pack/test/tsconfig.json b/x-pack/test/tsconfig.json index b4ab2b6da4be3..dca5b8a265589 100644 --- a/x-pack/test/tsconfig.json +++ b/x-pack/test/tsconfig.json @@ -33,19 +33,16 @@ "@kbn/apm-plugin", "@kbn/fleet-plugin", "@kbn/infra-plugin", - "@kbn/ml-plugin", "@kbn/observability-plugin", "@kbn/security-plugin", "@kbn/security-solution-plugin", "@kbn/spaces-plugin", "@kbn/task-manager-plugin", - "@kbn/remote-clusters-plugin", "@kbn/test", "@kbn/tooling-log", "@kbn/dev-utils", "@kbn/ftr-common-functional-services", "@kbn/expect", - "@kbn/std", "@kbn/apm-synthtrace", "@kbn/rule-data-utils", "@kbn/test-subj-selector",