| name | restassured-documentation-tdd |
| description | Legacy Rest Assured-specific alias for TDD-style case documentation. Prefer the standalone `test-artifact-export-skill` skill for formatting approved test cases or building export-ready artifacts, and use this only when Rest Assured-local conventions must be preserved explicitly. |
| metadata | {"author":"jovd83","version":"1.0","dispatcher-category":"testing","dispatcher-capabilities":"test-artifact-formatting, restassured-legacy-test-case-formatting","dispatcher-accepted-intents":"render_test_artifact, export_test_cases","dispatcher-input-artifacts":"approved_test_cases, normalized_test_case_model, scenario_list","dispatcher-output-artifacts":"formatted_test_artifact, export_ready_case_set","dispatcher-stack-tags":"restassured, documentation, legacy-alias","dispatcher-risk":"low","dispatcher-writes-files":true} |
Document Test Cases In TDD
1. Store And Organize Files
- Store TDD documents under
docs/tests/.
- Mirror the automation or business-domain structure with feature folders such as
docs/tests/orders/ or docs/tests/auth/.
- Create one
.md file per executable scenario, not one file per epic.
- Name files with a stable scenario purpose and classification such as
create-order-mss.md, create-order-optional-fields-ext.md, or create-order-missing-customer-err.md.
- For non-trivial or high-risk requirements, document multiple scenarios:
MSS for the main success path.
EXT for valid variants such as optional fields or alternate filters.
ERR for validation, auth, not-found, conflict, or drift behavior.
- For trivial low-risk reads, one
MSS scenario is sufficient.
- Do not force redundant scenarios when the requirement has no meaningful variation.
2. Use This Exact Case Structure
- Write fields in this order:
title
description
test_suite
Covered requirement
preconditions
steps
execution_type
design_status
test_engineer
test_level
jira
Test script
- Keep
title informative and unique. Include requirement or contract reference, scenario classification, and a concise behavior name.
- Keep
preconditions as a lettered list: A), B), C).
- Keep
steps as a markdown table with columns Step, Action, and Expected result.
- Keep
execution_type as Automated unless the user explicitly wants manual cases.
- Use
design_status as Draft, Ready, or Obsolete.
- Keep
Test script granular. Link to the exact Java test file and the specific test method or display name, not only the file.
3. Make The Content API-Specific
- Describe API behavior, not UI behavior.
- Put auth state, seeded data, feature flags, or contract version details in
preconditions.
- In
steps, describe the request action at a high level and put status, content type, headers, body semantics, and side effects in Expected result.
- Include contract paths, operation ids, requirement ids, or acceptance-criteria ids in
Covered requirement.
- When runtime behavior differs from the documented contract, document the live executable expectation and reference the mismatch artifact separately.
4. Start From The Template
- Start from tdd-case-template.md for new case files.
- Keep the field order unchanged so later sync and traceability work stays deterministic.
- Use aggregate index files under
docs/testing/tdd/ only as navigation aids when the repo wants them.
5. Template
title: [ORD-POST-001] MSS: Create order with required fields
description: Validates successful order creation for the standard required-field payload.
test_suite: Orders
Covered requirement: US-123, POST /api/orders, operationId=createOrder
preconditions:
A) The API is running.
B) Authentication is configured for a valid user.
C) No conflicting order id is pre-seeded.
steps:
| Step | Action | Expected result |
|---|---|---|
| 1 | Send `POST /api/orders` with a valid required-field payload | Status `201` is returned with JSON content. |
| 2 | Inspect the response body | The response includes the created order id and submitted business fields. |
| 3 | Retrieve the new order through `GET /api/orders/{id}` | The order is persisted and matches the creation response. |
execution_type: Automated
design_status: Ready
test_engineer: Codex
test_level: 1
jira: N/A
Test script: [OrderApiTest.java](C:/repo/tests/src/test/java/com/example/orders/OrderApiTest.java)#createOrderWithRequiredFields
6. Scenario Depth Decision
- Use
MSS, EXT, and ERR for CRUD, authentication, validation-heavy, workflow, or integration-sensitive requirements.
- Use one
MSS only for low-risk stable reads when optional data and error paths add little value.
- Add a dedicated drift or compatibility scenario when the live runtime contradicts the contract or requirement.
7. Examples
- Input:
Document POST /orders missing-customer-id as TDD.
Output: A dedicated ERR markdown case with lettered preconditions, a step table, and a direct link to the negative Rest Assured test method.
- Input:
Document the owner create flow as TDD.
Output: One MSS case for successful creation and separate EXT or ERR cases only when the requirement meaningfully varies.
8. Troubleshooting
- Problem: The automation file contains multiple test methods.
Fix: Point
Test script to the exact method anchor, not only the file.
- Problem: The case reads like a raw HTTP transcript.
Fix: Keep the action concise and move the protocol details into the expected result only where they matter.
- Problem: A single document mixes success, variation, and error behavior.
Fix: Split it into separate scenario files and classify them as
MSS, EXT, or ERR.