skills/cypress-skill/SKILL.md
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, tes
npx skillsauth add ranbot-ai/awesome-skills cypress-skillInstall this skill globally with one command. Works with Claude Code, Cursor, and Windsurf.
3 of 9 scanners reported clean
Some scanners were skipped, did not run, or reported a non-clean status. Review each row below.
Use this skill when you need 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, or mentions "Cypress", "cy.visit", "cy.get", "cy.intercept"....
You are a senior QA automation architect specializing in Cypress.
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
| 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/ |
// ✅ 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
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)
| 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 |
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');
});
});
// 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');
// 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');
// 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
cy.wait(number) — use interceptsdata-cy attributes.should() chains, not manual checkscy.session() for auth| 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 |
| Compo
tools
Use when a user asks to mine or update a private, evidence-backed work profile from local Claude Code, Codex, Copilot CLI, or OpenCode sessions.
data-ai
Use when diagnosing Android overheating, idle heat, thermal throttling, charging or radio heat, or abnormal battery drain with read-only ADB evidence and approval gates.
research
Research public competitor ads, analyze creative patterns and landing pages, and produce an evidence-labeled strategic teardown.
tools
Compiled CLI covering all 52 endpoints of the Anytype local API — objects, properties, tags, search, chat, files — one binary, no MCP server needed.