cypress
Cypress enables you to build robust automated browser testing workflows with intelligent selector strategies and predictable wait handling. This skill integrates with SkillFed's agent ecosystem to streamline end-to-end test development, helping you catch regressions early and maintain test reliability across your application.
Cypress enables you to build stable tests by using data-testid selectors instead of brittle CSS classes, implementing deterministic waiting patterns that poll for element readiness rather than fixed delays, and leveraging cy.intercept() to stub network responses. The framework's intelligent retry logic automatically waits for DOM elements and network requests, eliminating the need for arbitrary timeouts. Focus on selecting elements by their test attributes, avoid hard-coded waits, and ensure your assertions target elements that are guaranteed to exist before interaction.
AI-generated summary based on this skill's SKILL.md
Install
bobmatnyc/claude-mpm-skills/cypress · repository language: Python
git clone https://github.com/bobmatnyc/claude-mpm-skills
cp -r claude-mpm-skills/toolchains/javascript/testing/cypress ~/.claude/skills/cypressFrequently asked questions
AI-generated answers based on this skill's SKILL.md and metadata
How do I write stable cypress tests that won't fail intermittently?
Cypress enables you to build stable tests by using data-testid selectors instead of brittle CSS classes, implementing deterministic waiting patterns that poll for element readiness rather than fixed delays, and leveraging cy.intercept() to stub network responses. The framework's intelligent retry logic automatically waits for DOM elements and network requests, eliminating the need for arbitrary timeouts. Focus on selecting elements by their test attributes, avoid hard-coded waits, and ensure your assertions target elements that are guaranteed to exist before interaction.
What are the best practices for cypress e2e testing to reduce flaky tests?
Cypress best practices for reducing flaky tests include: using cy.session() to manage authentication state efficiently across tests, stubbing external API calls with cy.intercept() to eliminate network variability, selecting elements with stable identifiers like data-testid rather than dynamic class names, and avoiding fixed waits in favor of Cypress's built-in retry mechanisms. Additionally, structure your tests around critical user paths, keep tests isolated and independent, and leverage Cypress's time-travel debugging to inspect application state at each step. These strategies ensure your test suite remains reliable in CI environments and local development.
How can I control network requests and stub API responses in cypress?
Cypress enables you to control network requests through the cy.intercept() command, which allows you to stub API responses, mock server errors, and simulate network delays for comprehensive testing. By intercepting requests before they reach your backend, you can return predetermined responses, test error handling paths, and run tests faster without external dependencies. This approach isolates your tests from backend changes and CI environment variability, making your test suite more deterministic and maintainable across different environments.
How do I debug cypress tests and troubleshoot failures in CI environments?
Cypress provides time-travel debugging capabilities that let you inspect application state, DOM snapshots, and network activity at each test step. When tests fail in CI only, use Cypress's built-in screenshot and video recording features to capture test artifacts, then replay them locally to diagnose the issue. Common CI-specific failures stem from timing assumptions, environment-specific selectors, or unhandled network conditions—verify your selectors work across environments, use cy.intercept() to mock external services, and ensure your waits are deterministic rather than time-based. The Cypress dashboard also integrates with your CI pipeline to centralize failure analysis.
Can cypress be used for component testing with React and modern frameworks?
Cypress supports component testing for React and other modern frontend frameworks, allowing you to test individual components in isolation without spinning up a full application server. This approach accelerates your test feedback loop by focusing on component behavior, props, and state interactions. Component testing with Cypress complements your end-to-end tests by catching bugs earlier in development, reducing the number of slow e2e tests needed, and enabling faster CI pipelines while maintaining comprehensive coverage across your application.
How do I parallelize cypress tests and optimize my CI pipeline?
Cypress enables test parallelization in CI by distributing your test suite across multiple machines or containers, significantly reducing overall execution time. Configure your CI environment to run tests in parallel by splitting your test files across workers, and use Cypress's built-in load balancing to ensure even distribution. By combining parallelization with deterministic test design—stable selectors, network stubbing, and proper waits—you can maintain reliability while dramatically improving CI performance and reducing feedback time for developers.
SKILL.md
rendered from the published skill — quoted content, verbatim
Cypress (E2E + Component Testing)
Overview
Cypress runs browser automation with first-class network control, time-travel debugging, and a strong local dev workflow. Use it for critical path
(truncated - see the full file via the links below)
Read as markdown · JSON record · Browse the source repository
File tree — 2 files
toolchains/javascript/testing/cypress/SKILL.md
toolchains/javascript/testing/cypress/metadata.json