Skip to content

About

No description, website, or topics provided.

Resources

Stars

0 stars

Watchers

0 watching

Forks

Latest commit

Β 

History

16 Commits

Folders and files

NameName
Last commit message
Last commit date
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 

Repository files navigation

πŸ›’ E-commerce API Testing Project

Postman k6 Jira API

A hands-on API Testing / QA Automation portfolio project that demonstrates end-to-end testing of e-commerce REST APIs (products, cart, and authentication) using Postman, with negative testing, E2E flow validation, load testing (k6), and structured bug reporting.

Built to showcase practical QA skills β€” test design, functional/negative/auth testing, E2E scripting, performance testing, and defect documentation β€” for QA Automation Engineer roles.


πŸ“Œ Project Overview

This project simulates a real QA engagement against a live e-commerce-style API surface (using public sandbox APIs β€” DummyJSON and FakeStoreAPI). It covers the full testing lifecycle a QA engineer would own:

  • Designing and executing functional, validation, negative, and authentication test cases in Postman
  • Chaining requests into an end-to-end (E2E) flow (browse β†’ add to cart β†’ validate)
  • Load/performance testing the products endpoint with k6
  • Logging and tracking defects with severity/priority in a Jira-style bug report

🧰 Tools & Tech Stack

Category Tool / Tech Purpose
API Testing Postman Manual + scripted request/response testing
Test Scripting Postman Test Scripts (JavaScript / Chai) Assertions (pm.test, pm.expect)
E2E Testing Postman Collection Runner Chained multi-request flows
Load/Performance k6 Simulating concurrent user load
Bug Tracking Jira Logging defects with ID/severity/priority
Version Control Git / GitHub Source control for test artifacts
APIs Under Test DummyJSON, FakeStoreAPI Public sandbox e-commerce APIs
IDE VS Code Project & script management

πŸ“‚ Project Structure

E-commerce-API-Testing/
β”‚
β”œβ”€β”€ collection/                                    # Core Postman collections
β”‚   β”œβ”€β”€ Ecommerce API Testing.postman_collection.json
β”‚   └── Ecommerce API Testing.postman_collection - Copy.json
β”‚
β”œβ”€β”€ e2e-tests/
β”‚   └── E2E_FLOW.json                              # Chained end-to-end flow (products β†’ cart)
β”‚
β”œβ”€β”€ environment/
β”‚   └── dev_environment.json                       # Postman environment (base URL, tokens, IDs)
β”‚
β”œβ”€β”€ load-tests/
β”‚   └── load-test.js                               # k6 load/performance test script
β”‚
β”œβ”€β”€ test-data/
β”‚   └── sample_data.json                           # Reusable test data/fixtures
β”‚
β”œβ”€β”€ bug-report/
β”‚   β”œβ”€β”€ bugs.md                                    # Documented defects (Jira-style)
β”‚   └── image.png                                  # Evidence/screenshot for a logged bug
β”‚
└── README.md

🧭 Test Architecture

How the pieces fit together during a test run:

flowchart LR
    ENV[("Postman Environment\ndev_environment.json")] --> COL
    COL["Postman Collection\n(Functional / Negative / Auth)"] --> API1["DummyJSON API\n/products, /carts/add"]
    COL --> API2["FakeStoreAPI\n/products (auth variants)"]
    E2E["E2E Flow\nE2E_FLOW.json"] --> API1
    LOAD["k6 Load Test\nload-test.js"] --> API1
    API1 --> RES{{Response}}
    API2 --> RES
    RES -->|Assertions fail| BUG["Bug Report\nbugs.md (Jira-style)"]
    RES -->|Assertions pass| PASS[["βœ… Test Passed"]]
Loading

πŸ§ͺ APIs Tested

πŸ”Ή Products API (DummyJSON)

Test Case Method Endpoint Type
Get all products GET /products Functional
Pagination β€” negative limit GET /products?limit=-1&skip=-1 Negative
Add product to cart POST /carts/add Functional (E2E)
Add invalid product/quantity to cart POST /carts/add (id: 99999, quantity: -1) Negative

πŸ”Ή Authentication API (FakeStoreAPI)

Test Case Method Endpoint Type
Get products with valid auth GET /products Auth β€” Positive
Get products with no token GET /products Auth β€” Negative
Get products with wrong token GET /products Auth β€” Negative

βœ… Testing Coverage

mindmap
  root((API Testing))
    Functional
      Status code validation
      Response structure checks
    Validation
      Data type / schema checks
      Data availability
    Authentication
      Valid credentials
      Missing token
      Invalid token
    Negative
      Missing fields
      Invalid inputs
      Negative numeric values
    E2E Flow
      Get products
      Add to cart
      Chained assertions
    Performance
      k6 load simulation
      Response time thresholds
Loading
Type What's Verified
Functional Correct status codes (200, 400, etc.), expected response returned
Validation Response schema/structure, data availability
Authentication Token issuance, valid vs. missing vs. invalid token handling
Negative Missing fields, invalid inputs, negative/edge-case values (e.g. limit=-1, quantity=-1)
E2E Multi-step flow β€” fetch product β†’ capture ID β†’ add to cart β†’ assert cart response
Load/Performance Throughput and latency under ramping virtual-user load (k6)

πŸ” Authentication Flow

sequenceDiagram
    participant Tester as QA Tester (Postman)
    participant API as Auth API (FakeStoreAPI)
    participant Env as Postman Environment

    Tester->>API: POST /auth/login (credentials)
    API-->>Tester: 200 OK + auth token
    Tester->>Env: Store token as environment variable
    Tester->>API: GET /products (Authorization: Bearer {{token}})
    API-->>Tester: 200 OK (authorized response)

    Note over Tester,API: Negative paths also tested
    Tester->>API: GET /products (no token)
    API-->>Tester: 401 Unauthorized
    Tester->>API: GET /products (invalid token)
    API-->>Tester: 401/403 Unauthorized
Loading

πŸ”— End-to-End Flow (e2e-tests/E2E_FLOW.json)

flowchart TD
    A["1. GET /products"] -->|"Assert: status 200"| B["Capture product_id\n(pm.environment.set)"]
    B --> C["2. POST /carts/add\n{ userId, productId, quantity }"]
    C -->|"Assert: status in [200, 201]"| D["3. Negative case:\ninvalid id + negative quantity"]
    D -->|"Assert failure behavior"| E["Log defect if API misbehaves"]
Loading

This flow validates that data captured from one request (a real product_id) can be correctly reused in a downstream request β€” a core pattern for testing stateful, multi-step user journeys like checkout.


πŸ“Š Sample Postman Test Script

pm.test("Status is 200", function () {
    pm.response.to.have.status(200);
});

pm.test("Products exist", function () {
    let jsonData = pm.response.json();
    pm.expect(jsonData.length).to.be.above(0);
});

From the E2E flow β€” capturing a value for reuse downstream:

let jsonData = pm.response.json();
let productId = jsonData.products[0].id;
pm.environment.set("product_id", productId);

⚑ Load Testing (load-tests/load-test.js)

Built with k6 to validate the /products endpoint under increasing concurrent load.

graph LR
    A["10 users\n0–10s ramp-up"] --> B["50 users\n10–30s"] --> C["100 users\n30–50s peak"] --> D["0 users\n50–60s ramp-down"]
Loading

Pass/Fail thresholds:

Threshold Requirement
http_req_duration 95% of requests must complete in < 500ms
http_req_failed Failure rate must stay < 1%

Run it locally:

k6 run load-tests/load-test.js

🐞 Bug Reporting

Bugs are logged in Jira-style format in bug-report/bugs.md, including ID, severity, priority, steps to reproduce, and expected vs. actual result β€” with a supporting screenshot (bug-report/image.png).

Example logged defect:

Field Detail
Jira ID KAN-1
Title Negative limit parameter not validated
API GET /products?limit=-1
Severity / Priority Medium / Medium
Expected 400 Bad Request
Actual 200 OK (successful response)
Status Open
flowchart LR
    T["Test Execution"] -->|Failure found| R["Reproduce & Isolate"]
    R --> D["Document: ID, Severity,\nSteps, Expected vs Actual"]
    D --> J["Log in Jira"]
    D --> M["Mirror in bugs.md"]
    J --> F["Track to Resolution"]
Loading

▢️ How to Run

  1. Import into Postman

    • Import collection/Ecommerce API Testing.postman_collection.json
    • Import environment/dev_environment.json and select it as the active environment
    • Import e2e-tests/E2E_FLOW.json for the chained end-to-end run
  2. Run via Collection Runner (UI) or Newman (CLI):

    npm install -g newman
    newman run "collection/Ecommerce API Testing.postman_collection.json" -e environment/dev_environment.json
  3. Run the load test:

    k6 run load-tests/load-test.js

🧠 Key Learnings / Skills Demonstrated

  • Designing functional, negative, validation, and authentication test cases for REST APIs
  • Writing Postman test scripts with pm.test / pm.expect assertions
  • Chaining requests and passing data between steps for E2E scenarios
  • Introducing basic performance testing with k6 (ramping load, latency/error thresholds)
  • Structuring a QA project repo (collections, environments, test data, load tests, bug reports)
  • Documenting defects in a clear, Jira-style, reproducible format

πŸ“ˆ Future Improvements

  • Expand API coverage to Users and Orders endpoints
  • Automate the full suite via Newman + GitHub Actions (CI/CD)
  • Add JSON Schema validation for response contracts
  • Parameterize test data via test-data/sample_data.json (currently a placeholder)
  • Populate environment/dev_environment.json with sample (non-secret) variables for reviewers
  • Add HTML test reports (Newman HTML reporter)

πŸ‘€ Author

Aayush Gadag β€” API Testing | Postman | k6 | Bug Tracking

About

No description, website, or topics provided.

Resources

Stars

0 stars

Watchers

0 watching

Forks

Releases

Packages

Contributors

Languages