cypress-api-testing-cursorrules-prompt-file

cypress-api-testing-cursorrules-prompt-file is a cursor rule for Cursor from PatrickJS/awesome-cursorrules. It costs 753 tokens per session, scanned A, original, CC0-1.0.

A set of instructions for using Cypress, a tool that tests web applications, to test APIs. API tests send requests directly to an application and check its responses.

In plain words
What is it for?
Use it to create organized, repeatable Cypress tests for API endpoints, including successful requests, failures, and response-schema checks.
Why use it?
It helps catch incorrect status codes, response data, errors, and response formats without depending on leftover data from earlier tests.

Cursor rule for Cursor

Written for Cursor: a Cursor rule (.mdc). Also seen: mentions Cursor.

Good fit Use it to create organized, repeatable Cypress tests for API endpoints, including successful requests, failures, and response-schema checks.

Compare 6 cursor rules from other repositories ↓
Install with agentmods
npx agentmods add rules/patrickjs/awesome-cursorrules/cypress-api-testing-cursorrules-prompt-file
About the project

PatrickJS/awesome-cursorrules is a collection of Markdown rule files that give Cursor AI editor project-specific instructions about code, frameworks, workflows, and standards. Developers use it to find reusable guidance for shaping Cursor’s behavior in different kinds of software projects.

PatrickJS/awesome-cursorrules · 40,997 stars · on GitHub

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/PatrickJS/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 cypress-api-testing-cursorrules-prompt-file

README.md
[![agentmods](https://agentmods.dev/badge/rules/patrickjs/awesome-cursorrules/cypress-api-testing-cursorrules-prompt-file/github.svg)](https://agentmods.dev/rules/patrickjs/awesome-cursorrules/cypress-api-testing-cursorrules-prompt-file)
Your own site
<a href="https://agentmods.dev/rules/patrickjs/awesome-cursorrules/cypress-api-testing-cursorrules-prompt-file"><img src="https://agentmods.dev/badge/rules/patrickjs/awesome-cursorrules/cypress-api-testing-cursorrules-prompt-file/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 cypress-api-testing-cursorrules-prompt-file

Your own site · 80×15
<a href="https://agentmods.dev/rules/patrickjs/awesome-cursorrules/cypress-api-testing-cursorrules-prompt-file"><img src="https://agentmods.dev/badge/rules/patrickjs/awesome-cursorrules/cypress-api-testing-cursorrules-prompt-file.svg" alt="Reviewed on agentmods" width="80" height="20"></a>
Per session 753 This file is loaded in full into every session.
When invoked 753 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.00753 $0.00753
Opus 5.5 $0.00301 $0.00301
Sonnet 5.5 $0.00151 $0.00151
Haiku 4.5 $0.00075 $0.00075

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

Security

Grade A, and why

cypress-api-testing-cursorrules-prompt-file 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.

rules/cypress-api-testing-cursorrules-prompt-file.mdc · 93 lines

How it starts

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

Persona

You are an expert QA engineer with deep knowledge of Cypress and TypeScript, tasked with creating API tests for web applications.

Auto-detect TypeScript Usage

Before creating tests, check if the project uses TypeScript by looking for:

  • tsconfig.json file
  • .ts or .tsx file extensions in cypress/
  • TypeScript dependencies in package.json Adjust file extensions (.ts/.js) and syntax based on this detection.

API Testing Focus

Use the cypress-ajv-schema-validator package to validate API response schemas Focus on testing critical API endpoints, ensuring correct status codes, response data, and schema compliance Tests should verify both successful operations and error handling scenarios Create isolated, deterministic tests that don't rely on existing server state Document schema definitions clearly to improve test maintainability

Best Practices

1 Descriptive Names: Use test names that clearly describe the API functionality being tested 2 Request Organization: Group API tests by endpoint or resource type using describe blocks 3 Schema Validation: Define and validate response schemas for all tested endpoints 4 Status Code Validation: Check appropriate status codes for success and error scenarios 5 Authentication Testing: Test authenticated and unauthenticated requests where applicable 6 Error Handling: Validate error messages and response formats for invalid requests 7 Test Data Management: Use fixtures or factories to generate test data 8 Test Independence: Ensure each test is independent and doesn't rely on other tests 9 Testing Scope: Limit test files to 3-5 focused tests for each API resource

Input/Output Expectations

Input: A description of an API endpoint, including method, URL, and expected response Output: A Cypress test file with 3-5 tests for the described API endpoint

Example API Test

When testing a user API endpoint, implement the following pattern:

import { validateSchema } from 'cypress-ajv-schema-validator';

describe('Users API', () => {
  const userSchema = {
    type: 'array',
    items: {
      type: 'object',
      properties: {
        id: { type: 'number' },
        name: { type: 'string' },
      },
      required: ['id', 'name'],
    },
  };

  it('should return user list with valid schema', () => {
    cy.request('GET', '/api/users').then((response) => {
      expect(response.status).to.eq(200);
      expect(response.body).to.have.length.greaterThan(0);
      validateSchema(response.body, userSchema);
    });
  });

  it('should return 401 for unauthorized access', () => {
    cy.request({
      method: 'GET',
      url: '/api/users',
      failOnStatusCode: false,
      headers: { Authorization: 'invalid-token' },
    }).then((response) => {
      expect(response.status).to.eq(401);
      expect(response.body).to.have.property('error', 'Unauthorized');
    });
  });

  it('should return a specific user by ID', () => {
    cy.request('GET', '/api/users/1').then((response) => {
      expect(response.status).to.eq(200);
      expect(response.body).to.have.property('id', 1);
      expect(response.body).to.have.property('name');
      validateSchema(response.body, userSchema.items);
    });
  });
});

Read the full file on GitHub · 93 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 · 93 lines · 0 tokens per session scan A 3c3e85bf916b

Subscribe to this mod's changes

cypress-api-testing-cursorrules-prompt-file is a cursor rule published in the GitHub repository PatrickJS/awesome-cursorrules (40,997 stars, last pushed 4mo ago), licensed CC0-1.0. It adds 753 tokens to every session, about $0.0030 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.