TC_API_CRUD_002 – POST To All Products List (POST /api/productsList)
Objective:
Verify that sending a POST request to /productsList returns the correct “Method Not Allowed” response (expected positive behavior).
Test Type / Level: Functional / API
Priority / Severity: Medium / Minor
1. Environment & Dependencies
- Base URL:
https://automationexercise.com/api
- Postman environment variable: ` = https://automationexercise.com/api`
- Collection: Automation Exercise – Product API
- Authorization: None required
2. Preconditions
- API is online.
- Request method is set to POST.
3. Test Data
Request
- Method:
POST
- Endpoint:
/productsList
- Headers:
Content-Type: application/json
- Body:
{
"name": "Invalid Product",
"price": 10
}
4. Test Steps
- In Postman, open POST To Products List request.
- Verify that the method is set to POST.
- Click Send and observe response.
5. Expected Results
- HTTP 405 Method Not Allowed returned.
- Response body includes:
{
"responseCode": 405,
"message": "This request method is not supported."
}
- This is the correct expected positive result.
6. Actual Results
(To be filled after execution; attach Postman response screenshot)
7. Status
Pass / Fail
8. Postconditions
9. Notes
- This test validates proper API method enforcement.