Objective
Write two positive and two negative test cases for each operation below. Your cases should make the setup, action, expected status, and expected response clear enough for another tester to execute.
This exercise uses JSONPlaceholder, a public test API. Create, update, and delete requests return simulated responses and do not permanently modify its database. No credentials or tokens are required.
API under test
- Base URL:
https://jsonplaceholder.typicode.com - Resource:
/posts - Example:
GET https://jsonplaceholder.typicode.com/posts
Available operations
GET /posts
Fetch all posts.
- Expected status:
200 - Expected body: a JSON list of posts.
GET /posts/:id
Fetch a single post by ID.
- Expected status:
200 - Expected body: one post object in JSON format.
POST /posts
Create a new post using a request body such as:
{
"title": "title field expects a string",
"body": "body field expects a string",
"userId": 1
}- Expected status:
201 - Expected body: the created post object in JSON format.
PUT /posts/:id
Update a post using a request body such as:
{
"id": 1,
"title": "Updated post title",
"body": "Updated content of the post.",
"userId": 1
}- Expected status:
200 - Expected body: the updated post object in JSON format.
DELETE /posts/:id
Delete a post by ID.
- Expected status:
200
Deliverable
Use any text editor or test-management format you prefer. Publish the completed cases with a short explanation in a public GitHub repository or public hosted file.
Prepare your submission
- Publish your solution in a public GitHub repository.
- Include a README with setup and run instructions.
- Explain your approach and the decisions you made.
- Check that the shared link opens without requesting access.