api-testing

api-testing is a cursor rule for Cursor from tugkanboz/awesome-cursorrules. It costs 2,697 tokens per session, scanned A, original, MIT.

A set of Cypress patterns for testing web APIs, which are the interfaces applications use to exchange data. It covers intercepting requests, supplying mock responses, checking network calls, and simulating errors.

In plain words
What is it for?
Use it to mock API data, validate request and response contents, monitor calls made by a page, and test error handling or response-time behavior.
Why use it?
It avoids relying on real external services during tests and makes API-related behavior easier to check reliably. It also helps test how an application responds to failed requests and slow responses.

Cursor rule for Cursor

Written for Cursor: installed under .cursor/.

Good fit Use it to mock API data, validate request and response contents, monitor calls made by a page, and test error handling or response-time behavior.

Compare 6 cursor rules from other repositories ↓
Install with agentmods
npx agentmods add rules/tugkanboz/awesome-cursorrules/api-testing
Install

Getting it into your agent

One page per mod, every tool's command on it. A separate URL per tool would split the same page into five that compete with each other.

Clone the repo
git clone --depth 1 https://github.com/tugkanboz/awesome-cursorrules

Made for: Cursor.

Wrote this? Show the measurements

A badge with what this costs and how it scanned, read live from this page, so it follows the numbers instead of freezing them. Markdown for a README, HTML for a documentation site or a project page.

agentmods badge for api-testing

README.md
[![agentmods](https://agentmods.dev/badge/rules/tugkanboz/awesome-cursorrules/api-testing/github.svg)](https://agentmods.dev/rules/tugkanboz/awesome-cursorrules/api-testing)
Your own site
<a href="https://agentmods.dev/rules/tugkanboz/awesome-cursorrules/api-testing"><img src="https://agentmods.dev/badge/rules/tugkanboz/awesome-cursorrules/api-testing/github.svg" alt="Measured on agentmods" height="20"></a>

Or the 80×15 button, for a site that already has a row of RSS and ATOM ones. Only the verdict fits; the numbers stay here.

agentmods 80×15 button for api-testing

Your own site · 80×15
<a href="https://agentmods.dev/rules/tugkanboz/awesome-cursorrules/api-testing"><img src="https://agentmods.dev/badge/rules/tugkanboz/awesome-cursorrules/api-testing.svg" alt="Reviewed on agentmods" width="80" height="20"></a>
Per session 2,697 This file is loaded in full into every session.
When invoked 2,697 The same file — it is already loaded in full.
Security scan A 0 findings. A grade says what 26 rules found in the file — not that it is safe.
Origin original No closer match found in the catalogue.
Token cost

What it costs to keep this loaded

Counted locally with the o200k_base tokenizer, which is exact for GPT models; Claude uses its own tokenizer and its counts differ. Treat this as one consistent yardstick across the catalogue rather than a bill. Prices are per million input tokens.

ModelPer sessionOnce invoked
Fable 5.1 $0.02697 $0.02697
Opus 5.5 $0.01079 $0.01079
Sonnet 5.5 $0.00539 $0.00539
Haiku 4.5 $0.00270 $0.00270

Measured 1mo ago against content hash 1c1ca4e284e1, method: parsed. Prices are Anthropic first-party input rates as of 2026-10-07, from the pricing page.

Security

Grade A, and why

api-testing scanned grade A with 0 findings against 26 rules in 11 categories — prompt injection, anti-refusal, data exfiltration, privilege escalation, supply chain, agent snooping, system-prompt leakage, SSRF and excessive agency — measured 1mo ago.

A static scan of the body, not an audit. Every finding is printed with the line that produced it so you can judge whether it matters here. A mod is markdown that instructs an agent; that is exactly why what it instructs is worth reading.

Nothing flagged

None of the 26 patterns this scan looks for appear in this file: no shell pipes, no recursive deletes, no credential paths, no hidden text, no instruction-override or anti-refusal phrasing, no agent-config snooping. That is not a guarantee, it is the absence of the things that are checkable.

Origin

Copies of this mod

1 near-identical copy found in the catalogue:

example-structures/cypress/.cursor/rules/api-testing.mdc · 340 lines

How it starts

The opening of the file, as written. The whole thing — 340 lines — stays where its author put it; the contents beside it link to each section on GitHub.

Cypress API Testing Excellence

Network Interception Mastery

  • Request/Response Mocking: Control external API responses for reliable testing
  • Network Monitoring: Track and validate API calls during user interactions
  • Error Simulation: Test error handling and edge cases
  • Performance Testing: Monitor response times and optimize user experience

Advanced API Interception

// ✅ Comprehensive API interception setup
describe('API Integration Tests', () => {
  beforeEach(() => {
    // Set up common API routes
    cy.intercept('GET', '/api/users*', { fixture: 'users.json' }).as('getUsers')
    cy.intercept('POST', '/api/users', { fixture: 'user-created.json' }).as('createUser')
    cy.intercept('PUT', '/api/users/*', { fixture: 'user-updated.json' }).as('updateUser')
    cy.intercept('DELETE', '/api/users/*', { statusCode: 204 }).as('deleteUser')
  })

  it('should handle complete user CRUD operations', () => {
    // Visit page and wait for initial data load
    cy.visit('/users')
    cy.wait('@getUsers').then((interception) => {
      expect(interception.response.statusCode).to.equal(200)
      expect(interception.response.body).to.have.property('users')
    })

    // Create new user
    cy.get('[data-cy=add-user-button]').click()
    cy.get('[data-cy=user-form]').within(() => {
      cy.get('[data-cy=first-name]').type('John')
      cy.get('[data-cy=last-name]').type('Doe')
      cy.get('[data-cy=email]').type('[email protected]')
      cy.get('[data-cy=submit-button]').click()
    })

    cy.wait('@createUser').then((interception) => {
      expect(interception.request.body).to.deep.include({
        firstName: 'John',
        lastName: 'Doe',
        email: '[email protected]'
      })
      expect(interception.response.statusCode).to.equal(201)
    })

    // Verify user appears in list
    cy.get('[data-cy=user-list]')
      .should('contain.text', 'John Doe')
      .and('contain.text', '[email protected]')
  })
})

Read the full file on GitHub · 340 lines

Changes

What this file has done since we first saw it

Hashed on every crawl. A supply-chain change to an agent config is a question of when, not whether, so the history is kept rather than the latest state alone.

  1. 1mo ago First seen · 340 lines · 2,697 tokens per session scan A 1c1ca4e284e1

Subscribe to this mod's changes

api-testing is a cursor rule published in the GitHub repository tugkanboz/awesome-cursorrules (22 stars, last pushed 17d ago), licensed MIT. It adds 2,697 tokens to every session, about $0.0108 per session on Opus 5.5. A static security scan graded it A with 0 findings. No closer match exists in the catalogue, so it is treated as the original; first seen 2026-08-30.