scout-api-testing

Create and maintain API tests within Kibana's Scout framework.

21.2k|8.6k|Updated Jan 26, 2013
One-click install
npx skills add https://github.com/elastic/kibana --skill scout-api-testing
Or copy as Structured Prompt for Agent
Please help me install this Agent Skill.
Skill: scout-api-testing
Source: https://github.com/elastic/kibana/tree/main/.agents/skills/scout-api-testing
Command: npx skills add https://github.com/elastic/kibana --skill scout-api-testing

SYSTEM DOCUMENTATION & REQUIREMENTS

💡 This Skill includes references (resource) components.

What problem does it solve?

This Skill simplifies the creation, debugging, and review of API tests for Kibana's Scout framework, ensuring robust and efficient testing of API endpoints.

Core Features & Use Cases

  • API Test Creation: Write and structure API tests using the apiTest fixture.
  • Authentication Handling: Choose between API keys (requestAuth) for api/* endpoints and cookies (samlAuth) for internal/* endpoints.
  • Assertion Library: Utilize custom matchers for status codes, headers, and response bodies.
  • Service Integration: Leverage apiServices for server-side helpers and kbnClient for direct Elasticsearch interaction.
  • Use Case: When developing a new API endpoint in Kibana, use this Skill to write comprehensive tests that cover authentication, request/response validation, and side effects.

Quick Start

Use the scout-api-testing skill to write a new API test for the /api/my_plugin/users endpoint, authenticating with an API key.

Frequently Asked Questions about scout-api-testing

High-intent search queries and answers about installing and using this skill.

FAQPage Schema
How do I write API tests for Kibana endpoints using the Scout framework?

To write API tests for Kibana in the Scout framework, use the `apiTest` fixture to structure requests, apply custom matchers for assertions, and execute tests deterministically via scripts.

How does authentication work for Kibana API testing with Playwright?

Kibana API testing uses `requestAuth` with API keys for `api/*` endpoints and `samlAuth` cookies for `internal/*` endpoints, ensuring correct authentication strategies for different route access levels.

Can I use Elasticsearch directly in my Kibana API tests?

Yes, you can interact directly with Elasticsearch during Kibana API tests by leveraging the `kbnClient` fixture for server-side data operations and validation.

What is the best way to assert API response status codes and headers in Kibana tests?

The best way to assert API responses in Kibana tests is by utilizing the Scout framework's custom matchers to validate status codes, headers, and response bodies efficiently.

Does the Scout framework support server-side helpers for API test integration?

Yes, the Scout framework supports server-side service integration through the `apiServices` helper, allowing you to manage dependencies and execute server-side logic during API test development.