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.
/projects/{projectId}/components/items/{itemId}/testcasesAuthorizationOAuth2 access token · headerrequiredapi:writeAuthorizationBearer token (JWT) · headerrequiredprojectIdstringrequireditemIdstringrequiredfieldsToReturnstringresponseShapestringcompactfullLT-Response-Shapestringfullapplication/jsondescriptionstringrequiredexpectedResultstringrequiredstepsstringrequiredtitlestringrequiredidstring<uuid>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"
}'const response = await fetch("https://leadtime.app/api/public/projects/550e8400-e29b-41d4-a716-446655440010/components/items/3047983b-d798-4aff-8dd4-628cf1900703/testcases", {
method: "POST",
headers: {
"Authorization": "Bearer YOUR_ACCESS_TOKEN",
"Content-Type": "application/json"
},
body: JSON.stringify({
"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"
})
});import requests
response = requests.post(
"https://leadtime.app/api/public/projects/550e8400-e29b-41d4-a716-446655440010/components/items/3047983b-d798-4aff-8dd4-628cf1900703/testcases",
headers={
"Authorization": "Bearer YOUR_ACCESS_TOKEN",
"Content-Type": "application/json"
},
json={
"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"
},
){
"id": "550e8400-e29b-41d4-a716-446655440010"
}