Skip to content

diviam021-bit/Postman-API-Testing-Collection

Folders and files

NameName
Last commit message
Last commit date

Latest commit

Β 

History

7 Commits
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 

Repository files navigation

πŸš€ AI β†’ MCP β†’ API Workflow Testing Collection (with Gemini 2.5 Flash)

This project demonstrates an end-to-end Postman API testing workflow for an internal AI agent that generates code snippets and DevOps configuration suggestions via an MCP server.
It uses Google Gemini (free API) for dynamic AI responses and provides endpoints to simulate session handling, AI prompts, MCP operations, and validation.


πŸ“˜ Features

  • Live AI responses from Gemini

  • Session management (start, end)

  • AI prompt handling (/api/query)

  • MCP workflow simulation (/api/generate, /api/validate)

  • Reusable Postman collection for future automation & regression testing

  • Includes schema-based Postman tests and error-handling cases


βš™οΈ Technologies

  • Node.js + Express β†’ REST API mock server
  • Axios β†’ external Gemini API calls
  • uuid β†’ unique session handling (for creating session id)
  • dotenv β†’ environment variable management
  • Postman β†’ API testing & automation

πŸ”‘ Prerequisites

  1. Install Node.js
  2. Sign up for Google AI Studio
  3. Create a Gemini API key β†’
    https://aistudio.google.com/app/apikey

🧩 Installation

# Clone repository
git clone https://github.com/diviam021-bit/Postman-API-Testing-Collection.git
cd Postman-API-Testing-Collection

# Install dependencies
npm install


Create a .env file in the root directory:

GEMINI_API_KEY=your_gemini_api_key_here
PORT=4000

Start the server:

node server.js


🧩 How to Import in Postman
1️⃣ Import Collection

--  Open Postman

--  Click Import

--  Select
  postman/Agent-Api-Workflow-Collection-With-Testcases.postman_collection.json

2️⃣ Import Environment

--  Open Postman

--  Click Environments β†’ Import

--  Select
  postman/Local Environment.postman_environment.json

3️⃣ Select Environment

--  Click Top-Right Environment dropdown

--  Choose: Local Environment

πŸ“š API Documentation in Postman

-- Each request inside the collection already includes:

βœ… Request descriptions

--  Explain:

--  Purpose of the request

--  Inputs required (e.g., session_id, prompt, task)

--  Expected behavior

You can view this via:

Click a request β†’ Right side panel β†’ Documentation

βœ… Example request bodies

- - To help you quickly run and test.

βœ… Response examples

- - Shows what the API should return.

βœ… Test scripts

- - Every request has automated Postman tests including:

- - HTTP status validation

- - JSON schema validation

- - Field checks (session_id, output, message)

- - Error handling tests (invalid/missing session ID)

About

No description, website, or topics provided.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published