API Contract Test Script
6 fill-in slots · from The AI Prompt Handbook for QA Engineers
Your details
0/6 filledAPI Contract Test Script
Write contract tests to verify the API responses match what the mobile app expects. API ENDPOINT: [Method] [URL] MOBILE APP EXPECTS: [Paste the data model / struct / data class the app uses to parse the response] PLATFORM: [iOS (Codable) / Android (Kotlinx Serialization / Gson / Moshi)] Generate contract tests that verify: 1. All required fields are present in the response 2. Field types match what the app expects 3. Enum values are all handled by the app 4. Null/missing optional fields don't crash the parser 5. Extra fields in the response are safely ignored 6. Date format matches the app's parser 7. Nested objects maintain their structure Write the tests in: - [Swift (for iOS unit tests) / Kotlin (for Android unit tests)] - Using [XCTest / JUnit + MockWebServer] Include mock response JSON for each scenario.
Highlighted [slots] are still empty. Downloads are plain .txt — paste into any AI assistant.