Skip to content
Leadtime
English
Esc
navigateopen⌘Jpreview

Create a new test case (acceptance test step) for a component item

Creates a new test case for a component item within a project. Test cases document formal review and approval criteria for project results.

What are Test Cases? Test cases are individual test steps within a Test Suite. They document formal review and approval criteria for project results, ensuring that all delivered work meets the agreed requirements. Test cases are part of the acceptance testing process.

Test Case Structure: Each test case consists of four main parts:

  • Title: Short, clear title that describes what is being tested (e.g., “Check confirmation email destination”, “Validate form input fields”)
  • Description: Explains what is being tested and why it matters. Provides context for the test.
  • Steps: Step-by-step instructions for running the test. Should be clear and reproducible (e.g., “1. Navigate to login page 2. Enter credentials 3. Click login button”)
  • Expected Result: Describes the expected or correct system behavior when the test is run successfully (e.g., “User is successfully logged in and redirected to dashboard”)

Test Case Evaluation: After a test case is created, it can be evaluated later using the evaluate endpoint. Test cases can be marked as:

  • Passed: Test completed successfully and met all expected results
  • Failed: Test did not meet the expected result or revealed issues
  • PassedWithReservations: Test passed but with notes or concerns that should be documented

Project Completion: The project is considered finished when all test cases within all Test Suites have been passed successfully. This ensures quality and formal acceptance before project completion.

Content Format: All editor content fields (description, steps, expectedResult) accept HTML or Markdown input and are automatically converted to IDoc format for storage. When retrieved, they are converted back to HTML for easy consumption.

Use Case: Create test cases to define formal acceptance criteria for project deliverables. This ensures consistent quality standards and provides clear documentation of what was tested and approved.

POST/projects/{projectId}/components/items/{itemId}/testcases
Authorization
AuthorizationOAuth2 access token · headerrequired
Scopes:api:write
or
AuthorizationBearer token (JWT) · headerrequired
Path parameters
projectIdstringrequired
Project UUID
itemIdstringrequired
Component item UUID. Items are the building blocks within components (Epics, Work Packages, Todo Lists, Test Suites).
Query parameters
fieldsToReturnstring
Comma-separated list of top-level response fields to return. Overrides the endpoint compact default unless responseShape=full is used.
responseShapestring
Advanced override. Omit for the endpoint compact default. Use full only when you need the complete endpoint response, including nested fields that are not selectable with fieldsToReturn.
Allowed:compactfull
Header parameters
LT-Response-Shapestring
Advanced override. Set to full only when you need the complete endpoint response, including nested fields that are not selectable with fieldsToReturn.
Allowed:full
Request body
requiredapplication/json
descriptionstringrequired
Test case description in HTML or Markdown format
expectedResultstringrequired
Expected result in HTML or Markdown format. Describes the expected or correct system behavior when the test is run successfully.
stepsstringrequired
Test steps in HTML or Markdown format. Provide step-by-step instructions for running the test (e.g., "1. Navigate to login page 2. Enter credentials 3. Click login").
titlestringrequired
Test case title. Test cases are individual test steps within a Test Suite. They document formal review and approval criteria for project results.
Responses
201Test case created successfully. Returns the ID of the created test case.
idstring<uuid>
400Invalid request: validation errors or item does not belong to project
401Unauthorized - Invalid or missing authentication token
403Insufficient permissions to manage components or access to project denied
404Project or item not found
Request
curl -X POST "https://leadtime.app/api/public/projects/550e8400-e29b-41d4-a716-446655440010/components/items/3047983b-d798-4aff-8dd4-628cf1900703/testcases" \
  -H "Authorization: Bearer YOUR_ACCESS_TOKEN" \
  -H "Content-Type: application/json" \
  -d '{
  "description": "<p>Verify that users can log in with valid credentials.</p>",
  "expectedResult": "<p>User is successfully logged in and redirected to dashboard.</p>",
  "steps": "<ol><li>Navigate to login page</li><li>Enter credentials</li><li>Click login button</li></ol>",
  "title": "Test login with valid credentials"
}'
Response
{
  "id": "550e8400-e29b-41d4-a716-446655440010"
}