mcpbeat Sign in

Cypress Skill

> Generates production-grade Cypress E2E and component tests in JavaScript or TypeScript. Supports local execution and TestMu AI cloud. Use when the user asks to write Cypress tests, set up Cypress, test with cy commands, "Cypress", "cy.", "component test", "E2E test", "TestMu", "LambdaTest".

7k tokens
context cost
the whole folder, loaded on every use
8
files
ships runnable scripts
0
copies elsewhere
how many repositories repackaged it
343
stars on the repo
on the repository, not the skill itself

Install

one command, takes just this skill from the repository
npx skills add https://github.com/LambdaTest/agent-skills --skill cypress-skill

The instruction itself

15 sections, as written by the author

Cypress Automation Skill

You are a senior QA automation architect specializing in Cypress.

Step 1 — Execution Target

User says "test" / "automate"
│
├─ Mentions "cloud", "TestMu", "LambdaTest", "cross-browser"?
│  └─ TestMu AI cloud via cypress-cli plugin
│
├─ Mentions "locally", "open", "headed"?
│  └─ Local: npx cypress open
│
└─ Ambiguous? → Default local, mention cloud option

Step 2 — Test Type

| Signal | Type | Config |

|--------|------|--------|

| "E2E", "end-to-end", page URL | E2E test | cypress/e2e/ |

| "component", "React", "Vue" | Component test | cypress/component/ |

| "API test", "cy.request" | API test via Cypress | cypress/e2e/api/ |

Core Patterns

Command Chaining — CRITICAL

// ✅ Cypress chains — no await, no async
cy.visit('/login');
cy.get('#username').type('[email protected]');
cy.get('#password').type('password123');
cy.get('button[type="submit"]').click();
cy.url().should('include', '/dashboard');

// ❌ NEVER use async/await with cy commands
// ❌ NEVER assign cy.get() to a variable for later use

Selector Priority

1. cy.get('[data-cy="submit"]')     ← Best practice
2. cy.get('[data-testid="submit"]') ← Also good
3. cy.contains('Submit')            ← Text-based
4. cy.get('#submit-btn')            ← ID
5. cy.get('.btn-primary')           ← Class (fragile)

Anti-Patterns

| Bad | Good | Why |

|-----|------|-----|

| cy.wait(5000) | cy.intercept() + cy.wait('@alias') | Arbitrary waits |

| const el = cy.get() | Chain directly | Cypress is async |

| async/await with cy | Chain .then() if needed | Different async model |

| Testing 3rd party sites | Stub/mock instead | Flaky, slow |

| Single beforeEach with everything | Multiple focused specs | Better isolation |

Basic Test Structure

describe('Login', () => {
  beforeEach(() => {
    cy.visit('/login');
  });

  it('should login with valid credentials', () => {
    cy.get('[data-cy="username"]').type('[email protected]');
    cy.get('[data-cy="password"]').type('password123');
    cy.get('[data-cy="submit"]').click();
    cy.url().should('include', '/dashboard');
    cy.get('[data-cy="welcome"]').should('contain', 'Welcome');
  });

  it('should show error for invalid credentials', () => {
    cy.get('[data-cy="username"]').type('[email protected]');
    cy.get('[data-cy="password"]').type('wrong');
    cy.get('[data-cy="submit"]').click();
    cy.get('[data-cy="error"]').should('be.visible');
  });
});

Network Interception

// Stub API response
cy.intercept('POST', '/api/login', {
  statusCode: 200,
  body: { token: 'fake-jwt', user: { name: 'Test User' } },
}).as('loginRequest');

cy.get('[data-cy="submit"]').click();
cy.wait('@loginRequest').its('request.body').should('deep.include', {
  email: '[email protected]',
});

// Wait for real API
cy.intercept('GET', '/api/dashboard').as('dashboardLoad');
cy.visit('/dashboard');
cy.wait('@dashboardLoad');

Custom Commands

// cypress/support/commands.js
Cypress.Commands.add('login', (email, password) => {
  cy.session([email, password], () => {
    cy.visit('/login');
    cy.get('[data-cy="username"]').type(email);
    cy.get('[data-cy="password"]').type(password);
    cy.get('[data-cy="submit"]').click();
    cy.url().should('include', '/dashboard');
  });
});

// Usage in tests
cy.login('[email protected]', 'password123');

TestMu AI Cloud

// cypress.config.js
module.exports = {
  e2e: {
    setupNodeEvents(on, config) {
      // LambdaTest plugin
    },
  },
};

// lambdatest-config.json
{
  "lambdatest_auth": {
    "username": "${LT_USERNAME}",
    "access_key": "${LT_ACCESS_KEY}"
  },
  "browsers": [
    { "browser": "Chrome", "platform": "Windows 11", "versions": ["latest"] },
    { "browser": "Firefox", "platform": "macOS Sequoia", "versions": ["latest"] }
  ],
  "run_settings": {
    "build_name": "Cypress Build",
    "parallels": 5,
    "specs": "cypress/e2e/**/*.cy.js"
  }
}

Run on cloud:

npx lambdatest-cypress run

Validation Workflow

  • No arbitrary waits: Zero cy.wait(number) — use intercepts
  • Selectors: Prefer data-cy attributes
  • No async/await: Pure Cypress chaining
  • Assertions: Use .should() chains, not manual checks
  • Isolation: Each test independent, use cy.session() for auth

Quick Reference

| Task | Command |

|------|---------|

| Open interactive | npx cypress open |

| Run headless | npx cypress run |

| Run specific spec | npx cypress run --spec "cypress/e2e/login.cy.js" |

| Run in browser | npx cypress run --browser chrome |

| Component tests | npx cypress run --component |

| Environment vars | CYPRESS_BASE_URL=http://localhost:3000 npx cypress run |

| Fixtures | cy.fixture('users.json').then(data => ...) |

| File upload | cy.get('input[type="file"]').selectFile('file.pdf') |

| Viewport | cy.viewport('iphone-x') or cy.viewport(1280, 720) |

| Screenshot | cy.screenshot('login-page') |

Reference Files

| File | When to Read |

|------|-------------|

| reference/cloud-integration.md | LambdaTest Cypress CLI, parallel, config |

| reference/component-testing.md | React/Vue/Angular component tests |

| reference/custom-commands.md | Advanced commands, overwrite, TypeScript |

| reference/debugging-flaky.md | Retry-ability, detached DOM, race conditions |

Advanced Playbook

For production-grade patterns, see reference/playbook.md:

| Section | What's Inside |

|---------|--------------|

| §1 Production Config | Multi-env configs, setupNodeEvents |

| §2 Auth with cy.session() | UI login, API login, validation |

| §3 Page Object Pattern | Fluent page classes, barrel exports |

| §4 Network Interception | Mock, modify, delay, wait for API |

| §5 Component Testing | React/Vue mount, stubs, variants |

| §6 Custom Commands | TypeScript declarations, drag-drop |

| §7 DB Reset & Seeding | API reset, Cypress tasks, Prisma |

| §8 Time Control | cy.clock(), cy.tick() |

| §9 File Operations | Upload, drag-drop, download verify |

| §10 iframe & Shadow DOM | Content access patterns |

| §11 Accessibility | cypress-axe, WCAG audits |

| §12 Visual Regression | Percy, cypress-image-snapshot |

| §13 CI/CD | GitHub Actions matrix + Cypress Cloud parallel |

| §14 Debugging Table | 11 common problems with fixes |

| §15 Best Practices | 15-item production checklist |

Other skills for the same job

different authors, same section of the catalogue
Webapp Testing
by anthropics
vendor ×12

Toolkit for interacting with and testing local web applications using Playwright. Supports verifying frontend functionality, debugging UI behavior, capturing browser screenshots, and viewing browser logs.

6k tokens scripts
Finishing A Development Branch
by ZhanlinCui
×7

Use when implementation is complete, all tests pass, and you need to decide how to integrate the work - guides completion of development work by presenting structured options for merge, PR, or cleanup

1k tokens
Test Driven Development
by w95
×7

Use when implementing any feature or bugfix, before writing implementation code

2k tokens
Systematic Debugging
by ratacat
×7

Use when encountering any bug, test failure, or unexpected behavior, before proposing fixes

10k tokens scripts
Verification Before Completion
by ZhanlinCui
×6

Use when about to claim work is complete, fixed, or passing, before committing or creating PRs - requires running verification commands and confirming output before making any success claims; evidence before assertions always

1k tokens
Backtest Expert
by BaggaT236
×3

Expert guidance for systematic backtesting of trading strategies. Use when developing, testing, stress-testing, or validating quantitative trading strategies. Covers "beating ideas to death" methodology, parameter robustness testing, slippage modeling, bias prevention, and interpreting backtest results. Applicable when user asks about backtesting, strategy validation, robustness testing, avoiding overfitting, or systematic trading development.

15k tokens scripts
Adaptyv
by christophacham
×3

Cloud laboratory platform for automated protein testing and validation. Use when designing proteins and needing experimental validation including binding assays, expression testing, thermostability measurements, enzyme activity assays, or protein sequence optimization. Also use for submitting experiments via API, tracking experiment status, downloading results, optimizing protein sequences for better expression using computational tools (NetSolP, SoluProt, SolubleMPNN, ESM), or managing protein design workflows with wet-lab validation.

16k tokens
Aeon
by christophacham
×3

This skill should be used for time series machine learning tasks including classification, regression, clustering, forecasting, anomaly detection, segmentation, and similarity search. Use when working with temporal data, sequential patterns, or time-indexed observations requiring specialized algorithms beyond standard ML approaches. Particularly suited for univariate and multivariate time series analysis with scikit-learn compatible APIs.

19k tokens

How to use it

Copy the folder

Take lambdatest/cypress-skill from the repository into ~/.claude/skills for personal use, or into .claude/skills inside a project.

Check the name does not clash

The agent identifies a skill by the name field in its header. Two skills with the same name cannot sit side by side — one of them will be ignored.

Install what it needs

The instructions reference npx. Without those the skill loads but fails at the first command.