Skip to content
Back to skills

Api Testing Expert

ASecurity

API testing - Postman, REST clients, contract testing, mock servers

  • 57 stars
  • 0 votes
  • 0 copies
  • 2 views
  • Added May 31, 2026
developmentjavascripttypescriptjavabashnodetestinggitapifrontend

Works with

  • cli
  • api

Security analysis

A100/100

Scanned May 31, 2026

npx -y skills add diegosouzapw/awesome-omni-skill --skill api-testing-expert --agent claude-code

Installs into .claude/skills of the current project.

Are you the author of Api Testing Expert?

Add the live security badge to your README. It updates with every re-scan.

Security grade badge for Api Testing Expert
[![Security: A — Skills Directory](https://www.skillsdirectory.com/api/skills/diegosouzapw-api-testing-expert/badge)](https://www.skillsdirectory.com/skills/diegosouzapw-api-testing-expert)

More formats (shields.io, HTML) on the badges page. Keep it an A: scan every change in CI with Pro.

Download with Pro
SKILL.md
---
name: API Testing Expert
description: API testing - Postman, REST clients, contract testing, mock servers
allowed-tools: Read, Edit, Bash, WebFetch
model: sonnet
---

# API Testing Expert

Comprehensive API testing patterns for REST, GraphQL, and more.

## Tools Comparison

| Tool | Best For | Free Tier | Pricing |
|------|----------|-----------|---------|
| Postman | Teams | 3 users | $14/user/mo |
| Bruno | Local-first | Unlimited | Free |
| Hoppscotch | Open source | Unlimited | Free |
| REST Client (VS Code) | In-editor | Unlimited | Free |

## Bruno (Recommended for Vibe Coders)

Git-friendly, no account needed.

### Install
```bash
brew install bruno
```

### Collection Structure
```
api-tests/
├── bruno.json
├── environments/
│   ├── local.bru
│   └── production.bru
└── requests/
    ├── auth/
    │   └── login.bru
    └── users/
        └── get-user.bru
```

### Request File
```bru
meta {
  name: Get User
  type: http
  seq: 1
}

get {
  url: {{baseUrl}}/users/{{userId}}
  body: none
  auth: bearer {{token}}
}

tests {
  test("status is 200", function() {
    expect(res.status).to.equal(200);
  });

  test("has user data", function() {
    expect(res.body.id).to.exist;
  });
}
```

## REST Client (VS Code)

### HTTP File
```http
### Login
POST {{baseUrl}}/auth/login
Content-Type: application/json

{
  "email": "test@example.com",
  "password": "secret"
}

### Get User (use token from login)
GET {{baseUrl}}/users/me
Authorization: Bearer {{$dotenv TOKEN}}
```

## Postman CLI (Newman)

### Run in CI
```bash
npx newman run collection.json \
  -e environment.json \
  --reporters cli,json \
  --reporter-json-export results.json
```

### GitHub Actions
```yaml
- name: Run API Tests
  run: |
    npx newman run ./postman/collection.json \
      -e ./postman/ci-environment.json \
      --bail
```

## Contract Testing (Pact)

### Consumer Test
```javascript
const { Pact } = require('@pact-foundation/pact');

const provider = new Pact({
  consumer: 'Frontend',
  provider: 'UserService',
});

describe('User API', () => {
  it('returns user by id', async () => {
    await provider.addInteraction({
      state: 'user 1 exists',
      uponReceiving: 'a request for user 1',
      withRequest: {
        method: 'GET',
        path: '/users/1',
      },
      willRespondWith: {
        status: 200,
        body: {
          id: 1,
          name: like('John'),
        },
      },
    });
  });
});
```

## Mock Servers

### MSW (Mock Service Worker)
```typescript
import { http, HttpResponse } from 'msw';
import { setupServer } from 'msw/node';

const handlers = [
  http.get('/api/users/:id', ({ params }) => {
    return HttpResponse.json({
      id: params.id,
      name: 'Test User',
    });
  }),
];

export const server = setupServer(...handlers);
```

### Prism (OpenAPI Mock)
```bash
# Mock from OpenAPI spec
npx @stoplight/prism-cli mock openapi.yaml
```

## Quick API Test Pattern

```bash
# Simple curl test script
curl -sf "$API_URL/health" || exit 1
curl -sf -H "Authorization: Bearer $TOKEN" "$API_URL/users/me" | jq .
```

Use when: API testing, contract testing, mock servers, CI integration

Attribution

Is this your skill, or is something wrong with this listing? Request removal or report an issue. Author removals are honored within 72 hours.

Comments

Loading comments…

Newsletter

Get the weekly list of safe new skills, and the ones we pulled.