cypress-excellence

cypress-excellence is a cursor rule for Cursor from tugkanboz/awesome-cursorrules. It costs 1,743 tokens per session, scanned A, original, MIT.

A set of guidance for writing Cypress tests, which check web applications in a browser, using reusable commands, page objects, fixtures, and network checks.

In plain words
What is it for?
It is for organizing Cypress end-to-end and component tests, choosing stable selectors, managing test data, and reusing login or other test actions.
Why use it?
It helps keep browser tests readable and less likely to break when the user interface changes.

Cursor rule for Cursor

Written for Cursor: installed under .cursor/.

Good fit It is for organizing Cypress end-to-end and component tests, choosing stable selectors, managing test data, and reusing login or other test actions.

Compare 6 cursor rules from other repositories ↓
Install with agentmods
npx agentmods add rules/tugkanboz/awesome-cursorrules/cypress-excellence
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 cypress-excellence

README.md
[![agentmods](https://agentmods.dev/badge/rules/tugkanboz/awesome-cursorrules/cypress-excellence.svg)](https://agentmods.dev/rules/tugkanboz/awesome-cursorrules/cypress-excellence)
Your own site
<a href="https://agentmods.dev/rules/tugkanboz/awesome-cursorrules/cypress-excellence"><img src="https://agentmods.dev/badge/rules/tugkanboz/awesome-cursorrules/cypress-excellence.svg" alt="Measured on agentmods" height="20"></a>
Per session 1,743 This file is loaded in full into every session.
When invoked 1,743 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.01743 $0.01743
Opus 5 $0.00872 $0.00872
Sonnet 5 $0.00349 $0.00349
Haiku 4.5 $0.00174 $0.00174

Measured 8d ago against content hash dce41722a062, method: parsed. Prices are Anthropic first-party input rates as of 2026-09-07, from the pricing page.

Security

Grade A, and why

cypress-excellence 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 8d 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.

frameworks/cypress/.cursor/rules/cypress-excellence.mdc · 246 lines

How it starts

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

Cypress Testing Excellence

Modern Framework Architecture

  • TypeScript Integration: Full TypeScript support with intelligent intellisense
  • Component Testing: Isolated component testing alongside E2E scenarios
  • Advanced Page Objects: Modular page object patterns with inheritance
  • Smart Fixture Management: Dynamic test data with environment-aware loading

Element Selection Revolution

// Modern approach: Reliable, maintainable selectors
cy.get('[data-cy=user-dashboard]')         // Preferred: Test-specific attributes
  .find('[data-cy=profile-section]')       // Hierarchical selection
  .within(() => {                          // Scoped interactions
    cy.get('[data-cy=edit-button]').click()
  })

// Avoid: Brittle selectors that break with UI changes
// cy.get('.btn.btn-primary.user-btn')     // CSS classes
// cy.get('#user-123-edit')                // Dynamic IDs

Advanced Custom Commands

// Example: Intelligent login command with session management
Cypress.Commands.add('loginAs', (userType, options = {}) => {
  const { persist = true, skipWelcome = true } = options
  
  cy.session(userType, () => {
    cy.visit('/login')
    cy.fixture(`users/${userType}`).then(user => {
      cy.get('[data-cy=email-input]').type(user.email)
      cy.get('[data-cy=password-input]').type(user.password)
      cy.get('[data-cy=login-button]').click()
      
      // Wait for successful authentication
      cy.url().should('include', '/dashboard')
      cy.get('[data-cy=user-avatar]').should('be.visible')
    })
  }, {
    validate: () => {
      // Verify session is still valid
      cy.getCookie('auth-token').should('exist')
    },
    cacheAcrossSpecs: persist
  })
  
  if (skipWelcome) {
    cy.dismissWelcomeModal()
  }
})

Network Testing Mastery

// Example: Comprehensive API testing with validation
it('should handle user creation workflow', () => {
  // Set up network intercepts
  cy.intercept('POST', '/api/users', {
    statusCode: 201,
    body: { id: 'user-123', status: 'created' }
  }).as('createUser')
  
  cy.intercept('GET', '/api/users/user-123', {
    fixture: 'user-profile.json'
  }).as('getUserProfile')
  
  // Perform user actions
  cy.visit('/users/new')
  cy.fillUserForm({
    name: 'John Doe',
    email: '[email protected]',
    role: 'admin'
  })
  cy.get('[data-cy=submit-button]').click()
  
  // Validate network interactions
  cy.wait('@createUser').then(interception => {
    expect(interception.request.body).to.deep.include({
      name: 'John Doe',
      email: '[email protected]'
    })
  })
  
  cy.wait('@getUserProfile')
  cy.get('[data-cy=success-message]').should('contain', 'User created successfully')
})

Read the full file on GitHub · 246 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. 8d ago First seen · 246 lines · 1,743 tokens per session scan A dce41722a062

Subscribe to this mod's changes

cypress-excellence is a cursor rule published in the GitHub repository tugkanboz/awesome-cursorrules (20 stars, last pushed today), licensed MIT. It adds 1,743 tokens to every session, about $0.0087 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.