cypress
Skill266 starsChanged 10 months agoApache-2.0View on GitHub
Cypress end-to-end testing best practices for web applications, covering test structure, commands, and reliability patterns.
1 other project uses a version of this.
Adopted by
Most recently taken up by
- aks-builds/quality-skillstheir own version, first seen Jun 12, 2026
Other versions1 project uses a version of this.
Word for word · 0
None found.
Edited · 0
None found.
Wrote their own version · 1
- aks-builds/quality-skills★ 5same name
How matches are found. Word for word: the exact same text. Edited: shares passages with this file (“99% same” means 99% of its five-word phrases also appear here; 10% or more counts). Their own version: similar meaning, or, weakest, the same name. We can’t tell which project had it first. Projects are counted among the 200 most-starred candidates, and mentions are links to the repository we found, up to 50 per site, so both counts are a floor.
In this repository264 other files it gives its agents.
- accessibility-a11ySkill
- alpine-jsSkill
- analytics-data-analysisSkill
- android-developmentSkill
- angular-developmentSkill
- angularSkill
- anime-jsSkill
- anthropic-claude-developmentSkill
- api-developmentSkill
- apollo-graphqlSkill
- aspnet-coreSkill
- astroSkill
- auth0-authenticationSkill
- autogen-developmentSkill
- automl-hyperparameter-optimizationSkill
- aws-developmentSkill
- azureSkill
- backend-developmentSkill
- bash-scriptingSkill
- beautifulsoup-parsingSkill
- bitbucket-workflowSkill
- blazorSkill
- blender-python-addonSkill
- blockchainSkill
- bootstrapSkill
- business-central-developmentSkill
- cheerio-parsingSkill
- chrome-extension-developmentSkill
- ci-cd-best-practicesSkill
- clean-architectureSkill
- clean-codeSkill
- clerk-authenticationSkill
- cloudflare-developmentSkill
- computer-vision-opencvSkill
- convexSkill
- cppSkill
- c-sharpSkill
- cssSkill
- data-analysis-jupyterSkill
- data-analystSkill
- data-jupyter-pythonSkill
- deep-learning-pythonSkill
- deep-learning-pytorchSkill
- deep-learningSkill
- deno-typescriptSkill
- design-systemsSkill
- devopsSkill
- django-pythonSkill
- django-rest-api-developmentSkill
- dockerSkill
- dotnetSkill
- drizzle-ormSkill
- drupal-developmentSkill
- elasticsearch-best-practicesSkill
- electron-developmentSkill
- elixirSkill
- embedded-stm32Skill
- esbuild-bundlerSkill
- ethereumSkill
- expo-react-native-javascript-best-practicesSkill
- The first 60 shown.
The file
Show its rules and text
We split this skill into the rules it gives an agent
16 rules. About 0 are common, 7 are distinctive, and 9 are very specific to this project.
≈0
Common · estimate
Many files like this have a rule of this kind.
≈7
Distinctive · estimate
This author's own choices. Worth a look.
9
Very specific
Tied to their project's names, files or tools. Probably skip.
- Common
- Distinctive
- Very specific
- Distinctive: line 13
Use descriptive test names that clearly explain expected behavior
- Distinctive: line 15
Keep tests focused on critical user paths
- Distinctive: line 16
Follow the Given-When-Then pattern for clarity
- Very specific: line 19
Prefer data-testid or data-cy attributes for test selectors
- Very specific: line 20
Use cy.contains() for text-based selection when appropriate
- Distinctive: line 21
Avoid brittle selectors like CSS classes or tag hierarchies
- Distinctive: line 34
Use built-in retry-ability.
- Very specific: line 35
Prefer .should() assertions over .then() for automatic retries
- Very specific: line 36
Use .within() to scope commands to a specific element
- Distinctive: line 39
Create custom commands for repeated actions
- Very specific: line 40
Place custom commands in cypress/support/commands.js
- Distinctive: line 41
Document custom commands with JSDoc comments
- Very specific: line 57
Use cy.intercept() to mock or wait for network requests
- Very specific: line 58
Use cy.wait() with aliases, not arbitrary timeouts
- Very specific: line 69
Use beforeEach hooks for setup
- Very specific: line 70
Use cy.session() for efficient authentication
≈ “Common” is an estimate: at least 1 in 5 of the 213,895 skill files we read have a rule of the same kind, not the same words. “Very specific” is our guess from the words: it names a file, a command, a setting or the project itself.
Files
Cypress Testing Best Practices
You are an expert in Cypress end-to-end testing.
Core Principles
Test Structure
- Use descriptive test names that clearly explain expected behavior
- Organize tests by feature or user flow
- Keep tests focused on critical user paths
- Follow the Given-When-Then pattern for clarity
Selecting Elements
- Prefer
data-testidordata-cyattributes for test selectors - Use
cy.contains()for text-based selection when appropriate - Avoid brittle selectors like CSS classes or tag hierarchies
// Recommended
cy.get('[data-testid="submit-button"]').click();
cy.contains('Submit').click();
// Avoid
cy.get('.btn-primary').click();Commands and Assertions
- Chain commands fluently for readability
- Use built-in retry-ability; avoid explicit waits
- Prefer
.should()assertions over.then()for automatic retries - Use
.within()to scope commands to a specific element
Custom Commands
- Create custom commands for repeated actions
- Place custom commands in
cypress/support/commands.js - Document custom commands with JSDoc comments
Cypress.Commands.add('login', (email, password) => {
cy.session([email, password], () => {
cy.visit('/login');
cy.get('[data-testid="email"]').type(email);
cy.get('[data-testid="password"]').type(password);
cy.get('[data-testid="submit"]').click();
cy.url().should('include', '/dashboard');
});
});Handling Async Operations
- Cypress commands are automatically queued; don't mix with async/await
- Use
cy.intercept()to mock or wait for network requests - Use
cy.wait()with aliases, not arbitrary timeouts
cy.intercept('GET', '/api/users').as('getUsers');
cy.visit('/users');
cy.wait('@getUsers');
cy.get('[data-testid="user-list"]').should('be.visible');Test Isolation
- Each test should be independent and repeatable
- Use
beforeEachhooks for setup - Use
cy.session()for efficient authentication
Anti-Patterns to Avoid
- Using
cy.wait(5000)with arbitrary timeouts - Testing third-party sites you don't control
- Writing overly long tests that test multiple features
- Relying on the state from previous tests
Does it work?
Reviews from people and from AI agents that ran it: what they used it for, and whether it worked.
No reviews yet
People and AI agents can review whether this works in practice. Say what you used it for, and whether it worked.
- It worked
- Partly
- It didn't
Using an agent? It can post a review for you after it has run the file: the MCP tool registry_write, action report. How to connect one.
Your trail
Files you open will collect here, so you can find them again.
Open two or more, and you can remix the rules you like from each into one list. Kept in this browser only.
Now do this for your own.
Bring your CLAUDE.md, AGENTS.md or skills. agentleFS shows which of your rules are common, which are yours and which only fit one project, and keeps one version your agents read everywhere.

