scout-api-testing
Scout API Testing
Core rules (API)
- API specs live in
<module-root>/test/scout*/api/{tests,parallel_tests}/**/*.spec.ts(examples:test/scout/api/...,test/scout_uiam_local/api/...). - Use the Scout package that matches the module root:
src/platform/**orx-pack/platform/**->@kbn/scoutx-pack/solutions/observability/**->@kbn/scout-obltx-pack/solutions/search/**->@kbn/scout-searchx-pack/solutions/security/**->@kbn/scout-security- Prefer a single top-level
apiTest.describe(...)per file and avoid nesteddescribeblocks; multiple top-leveldescribes are supported, but files get hard to read quickly. - Tags: add
{ tag: ... }on the suite (or individual tests) so CI/discovery can select the right test target. For solution modules, prefer explicit targets (e.g.[...tags.stateful.classic, ...tags.serverless.observability.complete]in Observability); reservetags.deploymentAgnosticmainly for platform specs that truly need every deployment-agnostic target (seescout-migrate-from-ftr). Unlike UI tests, API tests don’t currently validate tags at runtime. - No
@in test titles: Playwright treats@wordin test/describe titles as tags. Do not use@followed by word characters in titles (e.g.,@timestamp,@elastic). Rephrase the title instead (e.g., usetimestamp fieldinstead of@timestamp). - If the module provides Scout fixtures, import
apiTestfrom<module-root>/test/scout*/api/fixturesto get module-specific extensions. Importing directly from the module’s Scout package is also fine when you don’t need extensions. - Browser fixtures are disabled for
apiTest(nopage,browserAuth,pageObjects).
Imports
More from elastic/kibana
codeql
Work with CodeQL in Kibana — write, test, and debug custom queries locally, fetch scan results from GitHub, and validate inline suppression comments. Use when writing or debugging CodeQL queries, running CodeQL unit tests, analyzing SARIF results, fetching scan results, or checking codeql suppression justifications.
2cypress-to-scout-migration
>
2kibana-api
Shared utilities for interacting with a local Kibana instance. Provides auto-detection of Kibana URL and auth, and a kibana_curl wrapper.
2api-authz
Kibana API route authorization patterns. Use when configuring route security, working with requiredPrivileges, using authzResult for privilege-based branching, opting out of authorization, or naming custom privileges.
2ftr-testing
Deep reference for the Kibana Functional Test Runner (FTR). Use when reading, analyzing, debugging, or reviewing FTR tests, including config anatomy, services, page objects, loadTestFile patterns, data loading, tags, CI wiring, and common FTR idioms.
2validate-oas
Use when you need a quick VALID or NOT VALID result for a scoped Kibana OAS area, and first ensure the generated `oas_docs` inputs are up to date so validation runs against the current environment rather than stale snapshots.
2