1---2name: restassured-documentation-bdd3description: Legacy Rest Assured-specific alias for BDD case formatting. Prefer the standalone `test-artifact-export-skill` skill for Gherkin, BDD, and export-ready case rendering, and use this only when Rest Assured-local conventions must be preserved explicitly.4---56# Document Test Cases In BDD78## 1. Store And Organize Files9101. Store feature files under `docs/features/` or `docs/tests/features/`.112. Create one `.feature` file per API capability, feature, or resource group.123. Group scenarios by requirement or business rule, not by raw HTTP method alone.134. Keep aggregate index files under `docs/testing/` optional; treat the `.feature` files themselves as the canonical narrative artifacts.145. For non-trivial requirements, document at least three scenarios:15 1. `MSS` for the main success path.16 2. `EXT` for meaningful valid variations.17 3. `ERR` for validation, auth, not-found, conflict, or drift behavior.186. For trivial low-risk reads, one `MSS` scenario is sufficient.1920## 2. Use Standard Gherkin Structure21221. Start with a `Feature:` statement that names the API capability.232. Use `Background:` only for shared setup such as base environment, auth state, seeded data, or contract version.243. Use `Scenario:` for single cases and `Scenario Outline:` only when the same behavior really varies by data.254. Use `Examples:` tables for compact data variations.265. Add tags above scenarios for requirement ids, operation ids, and scope such as `@smoke`, `@regression`, `@contract`, `@negative`, or `@US-123`.2728## 3. Write API-Focused Steps29301. Put environment, auth state, or seeded data in `Given`.312. Put request actions in `When`.323. Put status, content type, critical headers, body semantics, and side effects in `Then`.334. Use `And` and `But` only to extend the current clause clearly.345. Keep wording business-readable and API-specific.356. Do not turn the scenario into a low-value transcript of raw HTTP syntax.3637## 4. Start From The Template38391. Start from [feature-template.feature](assets/feature-template.feature) for new capability files.402. Keep scenario titles stable because traceability reports link to them.413. Keep one feature file per capability or resource group; do not collapse the whole service into one giant file.4243## 5. Depth Rules44451. Always include a standard `MSS` scenario for the primary valid request.462. Add `EXT` coverage for optional fields, alternate filters, paging, sorting, or valid role-specific variants.473. Add `ERR` coverage for invalid input, unauthorized access, missing resources, duplicate requests, or contract drift.484. Add a dedicated drift scenario when the runtime behavior does not match the documented contract.4950## 6. Example5152```gherkin53@SPC-OWN-003 @addOwner @workflow54Feature: Owner management5556 Scenario: Create an owner with required fields57 Given the Spring Petclinic API is available58 And no owner exists for the generated last name59 When a client submits a valid owner payload to POST /api/owners60 Then the response status is 20161 And the response body contains the created owner id62 And the created owner can be retrieved by id63```6465## 7. Examples66671. Input: `Write BDD for GET /orders/{id} unauthorized access.`68 Output: A tagged `ERR` scenario with `Given`, `When`, and `Then` steps for `401` behavior.692. Input: `Document the create-order requirement in BDD.`70 Output: Separate `MSS`, `EXT`, and `ERR` scenarios unless the requirement is trivial.7172## 8. Troubleshooting73741. Problem: The scenario reads like a curl command transcript.75 Fix: Keep steps behavioral and move raw payload detail into data tables or examples only when needed.762. Problem: One feature file mixes unrelated capabilities.77 Fix: Split by resource or business capability.783. Problem: A complex requirement has only one scenario.79 Fix: Add the missing `EXT` and `ERR` scenarios before calling the documentation complete.