cypress-integration-testing-cursorrules-prompt-file

cypress-integration-testing-cursorrules-prompt-file is a cursor rule for coding agents from PatrickJS/awesome-cursorrules. It costs 1,595 tokens per session, scanned A, original, CC0-1.0.

A set of Cursor coding guidelines for Cypress, a tool that tests web applications in a browser. It focuses on integration tests, which check that user interfaces, APIs, and application state work together.

In plain words
What is it for?
It is for writing Cypress and TypeScript tests, mocking API responses, checking state changes, and testing successful and failing workflows.
Why use it?
It helps catch broken user journeys and incorrect error handling without relying on fragile visual checks.

Cursor rule

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.

agentmods
npx agentmods add rules/patrickjs/awesome-cursorrules/cypress-integration-testing-cursorrules-prompt-file
Clone the repo
git clone --depth 1 https://github.com/PatrickJS/awesome-cursorrules

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-integration-testing-cursorrules-prompt-file

README.md
[![agentmods](https://agentmods.dev/badge/rules/patrickjs/awesome-cursorrules/cypress-integration-testing-cursorrules-prompt-file.svg)](https://agentmods.dev/rules/patrickjs/awesome-cursorrules/cypress-integration-testing-cursorrules-prompt-file)
Your own site
<a href="https://agentmods.dev/rules/patrickjs/awesome-cursorrules/cypress-integration-testing-cursorrules-prompt-file"><img src="https://agentmods.dev/badge/rules/patrickjs/awesome-cursorrules/cypress-integration-testing-cursorrules-prompt-file.svg" alt="Measured on agentmods" height="20"></a>
Per session 1,595 This file is loaded in full into every session.
When invoked 1,595 The same file — it is already loaded in full.
Security scan A 0 findings. Scan, not verified.
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 $0.01595 $0.01595
Opus 5 $0.00797 $0.00797
Sonnet 5 $0.00319 $0.00319
Haiku 4.5 $0.00160 $0.00160

Measured 4d ago against content hash de5f846c12b7, method: parsed. Prices are Anthropic first-party input rates as of 2026-08-30, from the pricing page.

Security

Grade A, and why

cypress-integration-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 4d 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-integration-testing-cursorrules-prompt-file.mdc · 212 lines

How it starts

The opening of the file, as written. The whole thing — 212 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 integration tests for web applications.

Auto-detect TypeScript Usage

Check for TypeScript in the project through tsconfig.json or package.json dependencies. Adjust syntax based on this detection.

Integration Testing Focus

Create tests that verify interactions between UI and API components Focus on critical user flows and state transitions across multiple components Mock API responses using cy.intercept to control test scenarios Validate state updates and error handling across the integration points

Best Practices

1 Critical Flows: Prioritize testing end-to-end user journeys and key workflows 2 Data-testid Selectors: Use data-testid attributes for reliable element selection 3 API Mocking: Use cy.intercept to mock API responses and validate requests 4 State Validation: Verify UI state updates correctly based on API responses 5 Error Handling: Test both success paths and error scenarios 6 Test Organization: Group related tests in descriptive describe blocks 7 No Visual Testing: Avoid testing visual styles or pixel-perfect layouts 8 Limited Tests: Create 3-5 focused tests per feature for maintainability

Example Integration Test

describe('Registration Form Integration', () => {
  beforeEach(() => {
    // Visit the registration page
    cy.visit('/register');
    
    // Mock the API response
    cy.intercept('POST', '/api/register', (req) => {
      if (req.body.email && req.body.email.includes('@')) {
        req.reply({ 
          statusCode: 200, 
          body: { message: 'Registration successful' }
        });
      } else {
        req.reply({ 
          statusCode: 400, 
          body: { error: 'Invalid email format' }
        });
      }
    }).as('registerRequest');
  });

  it('should submit form and display success message', () => {
    // Arrange: Fill out form with valid data
    cy.get('[data-testid="name-input"]').type('John Doe');
    cy.get('[data-testid="email-input"]').type('[email protected]');
    cy.get('[data-testid="password-input"]').type('Password123');
    
    // Act: Submit the form
    cy.get('[data-testid="register-button"]').click();
    
    // Wait for API request to complete
    cy.wait('@registerRequest').its('request.body').should('include', {
      name: 'John Doe',
      email: '[email protected]'
    });
    
    // Assert: Verify success message is displayed
    cy.get('[data-testid="success-message"]')
      .should('be.visible')
      .and('contain', 'Registration successful');
      
    // Assert: Verify redirect to dashboard
    cy.url().should('include', '/dashboard');
  });

  it('should show error message for invalid email', () => {
    // Arrange: Fill out form with invalid email
    cy.get('[data-testid="name-input"]').type('John Doe');
    cy.get('[data-testid="email-input"]').type('invalid-email');
    cy.get('[data-testid="password-input"]').type('Password123');
    
    // Act: Submit the form
    cy.get('[data-testid="register-button"]').click();
    
    // Wait for API request to complete
    cy.wait('@registerRequest');
    
    // Assert: Verify error message is displayed
    cy.get('[data-testid="error-message"]')
      .should('be.visible')
      .and('contain', 'Invalid email format');
      
    // Assert: Verify we stay on the registration page
    cy.url().should('include', '/register');
  });

  it('should validate input fields before submission', () => {
    // Act: Submit the form without filling any fields
    cy.get('[data-testid="register-button"]').click();
    
    // Assert: Form validation errors should be displayed
    cy.get('[data-testid="name-error"]').should('be.visible');
    cy.get('[data-testid="email-error"]').should('be.visible');
    cy.get('[data-testid="password-error"]').should('be.visible');
    
    // Assert: No API request should be made
    cy.get('@registerRequest.all').should('have.length', 0);
  });
});

Read the full file on GitHub · 212 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. 4d ago First seen · 212 lines · 0 tokens per session scan A de5f846c12b7

Subscribe to this mod's changes

cypress-integration-testing-cursorrules-prompt-file is a cursor rule published in the GitHub repository PatrickJS/awesome-cursorrules (40,717 stars, last pushed 3mo ago), licensed CC0-1.0. It adds 1,595 tokens to every session, about $0.0080 per session on Opus 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.