API Testing with Postman

Summer 2024 • View on GitHub

Project Overview

This project focuses on testing the Urban Grocers API, specifically:

  • ✓ 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
  • • Parameters: Tested scenarios around the 30-item limit, invalid product IDs, and kit IDs.

Major Bugs

In addition to using Postman, I wrote JavaScript scripts and ran them through Node.js to manually test the same API scenarios. These scripts replicate the Postman tests, ensuring the Urban Grocers API correctly adheres to the 30-item limit for kits. You can view the scripts in my GitHub repository: Click here!

1. Item Limit Validation Issue

The API incorrectly allowed multiple quantities of the same product to be added to a kit, causing it to exceed the 30-item limit (expected HTTP 400, received HTTP 200).

Interestingly, when adding multiple different products, each with a single quantity, to a kit that had under 30 items (causing it to exceed 30), the API behaved correctly & returned HTTP 400.

Bug Report in JIRA

2. Requesting Non-existent Product IDs

The system accepted non-existent product IDs (e.g., product ID 407 which does not exist) and responded with HTTP 200 OK instead of the expected HTTP 400 Bad Request.

This could lead to users believing they have successfully added a valid product to their kit when, in fact, the product does not exist in the system.

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

Valid Middle-Ground Input

Tested the system with valid, middle-range parameters to ensure basic functionality.

Minimal Product Weight and Count

Verified that the client delivery cost remained $0 for orders with minimal weight and product count within limits.

Product Weight Exceeding Maximum Limit

Tested fast delivery with product count within limits but weight slightly over the limit (6.01 kg).

Bug: The system failed to apply the excess client delivery cost correctly.

Product Count Exceeding Maximum Limit

Tested fast delivery with weight within limits but product count slightly over the limit.

Bug: The system failed to apply the excess client delivery cost correctly.

Maximum Weight Within Limits

Tested fast delivery with maximum allowed weight (6.00 kg) and product count within limits.

Inconclusive Tests

Two tests were deemed inconclusive, pointing to a significant flaw in the design of the API's cost calculation system.

These tests highlighted a gap in the defined ranges for host delivery cost:

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

Testing Results

Major Design Flaw

The current requirements have a gap between the $3 price range (0-2.5 kg) and the $6 price range (2.6-6 kg). This ambiguity creates uncertainty in expected outcomes for product weights that fall within this gap (e.g., 2.51 kg and 2.59 kg).

Conclusion

The testing revealed several critical issues that need attention:

  • Inconsistent item limit validation
  • Improper handling of invalid product IDs
  • Gap in delivery pricing logic

These issues impact both system reliability and user experience, requiring immediate attention for resolution.