scout-api-testing
Installation
SKILL.md
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).