API Testing with Postman

Summer 2024 · View on GitHub

Project Overview

Postman and Node.js tests against the Urban Grocers API covered:

  • ✓ Adding products to a kit
  • ✓ Calculations for fast delivery

Total Tests Conducted: 57

  • • 28 tests for kit product management
  • • 29 tests for delivery calculations

Requirement 1: Kit Product Management

Key Findings

  • • Total Tests: 28
  • • Coverage: 30-item limit, invalid product IDs, invalid kit IDs

Major Bugs

I also ran the same cases in Node.js scripts that mirror the Postman collection, including the 30-item kit cap. Scripts live in the repo: node-tests

1. Item Limit Validation Issue

Repeating the same product ID pushed a kit past 30 items but returned HTTP 200 instead of 400.

Mixing different product IDs (one each) past 30 items did return HTTP 400.

Bug Report in JIRA

2. Requesting Non-existent Product IDs

Product ID 407 (not in the catalog) returned HTTP 200 instead of 400.

The client shows a successful add even when the product does not exist.

Bug Report in JIRA

Requirement 2: Fast Delivery Calculations

Testing Overview

  • • Total Tests: 29
  • • Focus: Delivery pricing logic
  • • Scope: Weight and quantity limits

Test Scenarios

Mid-range valid input

Weight and count inside limits; baseline pricing response.

Minimal Product Weight and Count

Minimal weight and count inside limits; client delivery cost stayed $0.

Product Weight Exceeding Maximum Limit

Count inside limits, weight 6.01 kg (over the 6 kg cap).

Bug: excess client delivery cost was not applied.

Product Count Exceeding Maximum Limit

Weight inside limits, product count one over the max.

Bug: excess client delivery cost was not applied.

Maximum Weight Within Limits

Weight at the 6.00 kg cap with count inside limits; pricing matched spec.

Inconclusive Tests

Two tests had no clear expected price because the requirements leave a gap in host delivery tiers.

Example case:

Ordering Fast Delivery with Product Weight Slightly Below the Upper Limit (2.59 kg).

Testing Results

Major Design Flaw

Requirements list $3 for 0–2.5 kg and $6 for 2.6–6 kg. Weights between those bands (e.g. 2.51 kg and 2.59 kg) have no stated host price, so expected results for fast delivery at 2.59 kg were unclear.

Conclusion

Open items from the run:

  • Kit item limit checks differ for duplicate vs mixed product IDs
  • Invalid product IDs return 200
  • Delivery pricing spec has a gap between weight tiers; two cases stayed inconclusive