This README documents end-to-end API testing of a simple Boards/Lists service using Postman against a local server.
Designed as a mini lifecycle: Create β Use β Delete (Cleanup), covering happy paths (201, 200) and cleanup verification. Used environment variables (User_id, board_id, list-1, list_2, accessToken) for repeatability across runs.
- Environment-driven setup (
{{BaseUrl}}) - Postman Tests validate status codes and payloads
- Incremental verification after each creation
- Cleanup-first policy for idempotent reruns (lists β board β user)
- Create User β capture
User_id,accessToken - Create Board β store
board_id - Add Two Lists β store IDs
- Delete One List
- Delete Board
- Delete User (with token)
- Create: User, Board, Lists (
POST) - Read: Validate responses & optional
GETfor board details - Update: Not used in this demo (env vars simulate state updates)
- Delete: Lists, Board, User (
DELETE)
- Reproducible Postman collection with automated assertions
- Clear screenshots + examples for knowledge sharing
- Runner results confirm all tests passed β
Before setting up the Postman environment, I verified the backend APIs directly in the browser Developer Tools (Network tab).
The backend was running on:
http://localhost:3000/api
-
Signup API (
/signup)-
Sent a
POSTrequest with email, password, and welcomeEmail flag. -
Payload captured:
{ "email": "[email protected]", "password": "sakif123", "welcomeEmail": false }
-
-
Response Preview
-
On success, API returned a JWT accessToken and the newly created user.
-
Example response:
{ "accessToken": "eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9...", "user": { "email": "[email protected]", "welcomeEmail": false, "id": 11 } } -
π· Screenshot: View Token Preview
-
-
Boards API (
/boards)-
Once authenticated, I could create and fetch boards.
-
Example response (board created):
{ "name": "Board-1", "user": 11, "starred": false, "created": "2025-08-14", "id": 11 }
-
What this does: Defines variables for URLs and dynamic IDs used throughout the collection so requests are portable and easy to rerun.
| Variable | Example Value | Notes |
|---|---|---|
BaseUrl |
http://localhost:3000/api |
Base API URL |
board_id |
11 |
Set after board creation |
list_2 |
26 |
Set after creating list-2 |
list-1 |
25 |
Set after creating list-1 |
User_id |
31 |
Set after user creation |
accessToken |
<jwt-token> |
Set from signup response |
πΈ Screenshot β Postman Environment Setup
What this does:
Creates a new user. Stores User_id and accessToken in the environment for authenticated calls later.
Request
POST {{BaseUrl}}/signupBody (JSON)
{
"email": "sakif{{randomInt}}@gmail.com",
"password": "sakif123",
"welcomeEmail": false
}Tests
pm.test("Successful POST request", function () {
pm.expect(pm.response.code).to.be.oneOf([201, 202]);
});
let response = pm.response.json();
let responseEmail = response.user.email;
pm.test("Email contains 'sakif' and ends with @gmail.com", function () {
pm.expect(responseEmail).to.match(/sakif\d+@gmail\.com$/);
});
var jsonData = pm.response.json();
pm.environment.set("User_id", jsonData.user.id);
pm.environment.set("accessToken", jsonData.accessToken);Expected Response (201 Created)
{
"accessToken": "<jwt-token>",
"user": {
"email": "[email protected]",
"welcomeEmail": false,
"id": 31
}
}πΈ Screenshots
What this does:
Creates a board and saves its id to board_id for subsequent list operations and cleanup.
Request
POST {{BaseUrl}}/boardsBody (JSON)
{
"name": "Automation Bord"
}Tests
pm.test("Status code is 201", function () {
pm.response.to.have.status(201);
});
pm.test("Name: Automation Bord", function () {
pm.expect(pm.response.json().name).to.eql("Automation Bord");
});
let response = pm.response.json();
pm.environment.set("board_id", response.id);Expected Response (201 Created)
{
"name": "Automation Bord",
"user": 0,
"starred": false,
"created": "2025-08-18",
"id": 11
}πΈ Screenshots
What this does:
Creates list-1 under the created board and stores its ID in list-1.
POST {{BaseUrl}}/listsBody
{
"boardId": {{board_id}},
"name": "list-1",
"order": 0
}Tests
pm.test("Status code is 201", function () {
pm.response.to.have.status(201);
});
pm.test("Name: list-1", function () {
var jsonData = pm.response.json();
pm.expect(jsonData.name).to.eql("list-1");
});
let response = pm.response.json();
pm.environment.set("list-1", response.id);Expected Response
{
"boardId": 11,
"name": "list-1",
"order": 0,
"created": "2025-08-18",
"id": 25
}πΈ Screenshots
What this does:
Creates list-2 under the same board and stores its ID in list_2. This is the one weβll delete later.
POST {{BaseUrl}}/listsBody
{
"boardId": {{board_id}},
"name": "list-2",
"order": 0
}Tests
pm.test("Status code is 201", function () {
pm.response.to.have.status(201);
});
var jsonData = pm.response.json();
pm.test("Board ID matches", function () {
pm.expect(jsonData.boardId).to.eql(11);
});
pm.test("List name is: list-2", function () {
pm.expect(jsonData.name).to.eql("list-2");
});
let response = pm.response.json();
pm.environment.set("list_2", response.id);Expected Response
{
"boardId": 11,
"name": "list-2",
"order": 0,
"created": "2025-08-18",
"id": 26
}πΈ Screenshots
What this does:
Deletes list-2 (stored in list_2) to validate deletion behavior and prep for board deletion.
Request
DELETE {{BaseUrl}}/lists/{{list_2}}Expected Response (200 OK)
{}What this does:
Deletes the board using board_id (after list cleanup) to keep the environment idempotent.
Request
DELETE {{BaseUrl}}/boards/{{board_id}}Tests
pm.test("Board ID is Deleted", function () {
pm.response.to.have.status(200);
});Expected Response
{}What this does:
Deletes the user created in Step 3 using User_id. Requires accessToken as a Bearer token.
Request
DELETE {{BaseUrl}}/users/{{User_id}}Authorization
- Type: Bearer Token
- Token:
{{accessToken}}
Tests
pm.test(`User_id:${pm.environment.get("User_id")}, User successfully deleted`, function () {
pm.response.to.have.status(200);
});Expected Response (200 OK)
{}πΈ Screenshots
What this shows: End-to-end execution with all assertions green β confirming the flow and cleanup are correct.
After running via Postman Runner:
- β All 8 tests passed
- Avg response time: ~49ms
πΈ Screenshots
- The flow covers Create β Read (validate) β Delete across User, Board, and Lists.
- All dynamic IDs and tokens are saved to the environment for repeatable runs.