diff --git a/.eslintrc.js b/.eslintrc.js index fff0e3a9d62f8..c86967aeeca5c 100644 --- a/.eslintrc.js +++ b/.eslintrc.js @@ -2316,6 +2316,83 @@ module.exports = { ], }, }, + { + files: [ + 'src/platform/plugins/**/ui_tests/**/*.ts', + 'x-pack/platform/**/plugins/**/ui_tests/**/*.ts', + ], + rules: { + 'no-restricted-imports': [ + 'error', + { + paths: [ + { + name: '@playwright/test', + message: "Platform tests should import only from '@kbn/scout'.", + }, + { + name: 'playwright', + message: "Platform tests should import only from '@kbn/scout'.", + }, + ], + }, + ], + }, + }, + { + files: ['x-pack/solutions/observability/plugins/**/ui_tests/**/*.ts'], + rules: { + 'no-restricted-imports': [ + 'error', + { + paths: [ + { + name: '@kbn/scout', + message: + "Observability solution tests should import from '@kbn/scout-oblt' instead.", + }, + { + name: '@playwright/test', + message: + "Observability solution tests should import from '@kbn/scout-oblt' instead.", + }, + { + name: 'playwright', + message: + "Observability solution tests should import from '@kbn/scout-oblt' instead.", + }, + ], + }, + ], + }, + }, + { + files: ['x-pack/solutions/security/plugins/**/ui_tests/**/*.ts'], + rules: { + 'no-restricted-imports': [ + 'error', + { + paths: [ + { + name: '@kbn/scout', + message: + "Security solution tests should import from '@kbn/scout-security' instead.", + }, + { + name: '@playwright/test', + message: + "Security solution tests should import from '@kbn/scout-security' instead.", + }, + { + name: 'playwright', + message: + "Security solution tests should import from '@kbn/scout-security' instead.", + }, + ], + }, + ], + }, + }, ], }; diff --git a/x-pack/platform/plugins/shared/streams_app/tsconfig.json b/x-pack/platform/plugins/shared/streams_app/tsconfig.json index 27ad746c690c6..5cf63f87ad3ee 100644 --- a/x-pack/platform/plugins/shared/streams_app/tsconfig.json +++ b/x-pack/platform/plugins/shared/streams_app/tsconfig.json @@ -75,6 +75,6 @@ "@kbn/kibana-utils-plugin", "@kbn/field-types", "@kbn/field-formats-plugin", - "@kbn/test" + "@kbn/test", ] } diff --git a/x-pack/solutions/observability/packages/kbn-scout-oblt/index.ts b/x-pack/solutions/observability/packages/kbn-scout-oblt/index.ts index 057cf957ba13f..cd86b3dae87b7 100644 --- a/x-pack/solutions/observability/packages/kbn-scout-oblt/index.ts +++ b/x-pack/solutions/observability/packages/kbn-scout-oblt/index.ts @@ -35,4 +35,5 @@ export type { ScoutPlaywrightOptions, ScoutTestOptions, Locator, + SynthtraceFixture, } from '@kbn/scout'; diff --git a/x-pack/solutions/observability/plugins/observability/tsconfig.json b/x-pack/solutions/observability/plugins/observability/tsconfig.json index a958708e1fe8c..b29edcca89afa 100644 --- a/x-pack/solutions/observability/plugins/observability/tsconfig.json +++ b/x-pack/solutions/observability/plugins/observability/tsconfig.json @@ -127,7 +127,6 @@ "@kbn/logs-data-access-plugin", "@kbn/core-pricing-browser-mocks", "@kbn/esql", - "@kbn/scout", "@kbn/apm-synthtrace-client", "@kbn/scout-oblt", ], diff --git a/x-pack/solutions/observability/plugins/observability/ui_tests/fixtures/generators.ts b/x-pack/solutions/observability/plugins/observability/ui_tests/fixtures/generators.ts index 3226a56982ff6..d8b7bf130085a 100644 --- a/x-pack/solutions/observability/plugins/observability/ui_tests/fixtures/generators.ts +++ b/x-pack/solutions/observability/plugins/observability/ui_tests/fixtures/generators.ts @@ -4,7 +4,7 @@ * 2.0; you may not use this file except in compliance with the Elastic License * 2.0. */ -import { SynthtraceFixture } from '@kbn/scout'; +import { SynthtraceFixture } from '@kbn/scout-oblt'; import { apm, log, timerange } from '@kbn/apm-synthtrace-client'; const TEST_START_TIME = '2024-01-01T00:00:00.000Z';