Cette page est affichée en anglais. Une traduction française est en cours.
SkillsApr 11, 2026·2 min de lecture

Cypress — Fast, Easy & Reliable Browser Testing

Cypress is a next-generation front-end testing tool built for the modern web. Runs in the same run-loop as your app for superior debuggability, with time-travel, automatic waiting, real-time reloads, and screenshots on failure.

Prêt pour agents

Installation agent prête

Cet actif peut être installé après choix du runtime, vérification du plan et exécution de la commande adaptée.

Native · 98/100Policy : autoriser
Surface agent
Tout agent MCP/CLI
Type
Skill
Installation
Single
Confiance
Confiance : Established
Point d'entrée
step-1.md
Commande d'installation directe
npx -y tokrepo@latest install 4fa5c7a2-3580-11f1-9bc6-00163e2b0d79 --target codex

À exécuter après confirmation du plan en dry-run.

TL;DR
Cypress runs end-to-end tests in the browser alongside your app, providing time-travel debugging, automatic waiting, and screenshots on failure.
§01

What it is

Cypress is a front-end testing framework built for modern web applications. Unlike Selenium-based tools that operate outside the browser, Cypress runs in the same event loop as your application. This architecture enables time-travel debugging, automatic waiting for elements and network requests, real-time reloads during test development, and automatic screenshots on failure.

Cypress targets front-end developers and QA engineers testing web applications. It supports end-to-end testing, component testing, and API testing with a unified API. The test runner provides a visual interface showing each test step alongside your running application.

§02

How it saves time or tokens

Cypress eliminates the flakiness common in Selenium-based tests. Automatic waiting means you never write explicit sleep or waitFor calls. The time-travel feature lets you hover over each command in the test log to see the DOM state at that exact moment. Real-time reloads re-run tests as you save files. These features cut debugging time significantly compared to traditional E2E frameworks.

§03

How to use

  1. Install Cypress as a dev dependency: npm i -D cypress.
  2. Open the interactive test runner with npx cypress open or run headlessly with npx cypress run.
  3. Write test files in cypress/e2e/ using the Cypress API for visiting pages, selecting elements, and making assertions.
§04

Example

// cypress/e2e/login.cy.ts
describe('Login', () => {
  it('logs in with valid credentials', () => {
    cy.visit('/login');
    cy.get('[data-test=email]').type('user@example.com');
    cy.get('[data-test=password]').type('secret123');
    cy.get('[data-test=submit]').click();
    cy.url().should('include', '/dashboard');
    cy.contains('Welcome back').should('be.visible');
  });

  it('shows error for invalid password', () => {
    cy.visit('/login');
    cy.get('[data-test=email]').type('user@example.com');
    cy.get('[data-test=password]').type('wrong');
    cy.get('[data-test=submit]').click();
    cy.contains('Invalid credentials').should('be.visible');
  });
});
§05

Related on TokRepo

§06

Common pitfalls

  • Cypress runs inside the browser and cannot test across multiple domains in a single test. If your flow involves OAuth redirects to a third-party domain, you need workarounds.
  • Cypress tests are JavaScript/TypeScript only. If your team prefers Python or Java for test code, Cypress is not the right fit.
  • The free tier of Cypress Cloud (formerly Dashboard) has limited parallelization. CI pipeline speed depends on how many parallel runners you configure.

Questions fréquentes

How does Cypress differ from Selenium?+

Cypress runs inside the browser event loop alongside your application, while Selenium operates externally via WebDriver. This gives Cypress automatic waiting, time-travel debugging, and consistent results. Selenium supports more browsers and languages but requires more setup and flake management.

Does Cypress support component testing?+

Yes. Cypress supports both end-to-end testing and component testing. Component testing mounts individual React, Vue, Angular, or Svelte components in isolation and tests them with the same Cypress API used for E2E tests.

Which browsers does Cypress support?+

Cypress supports Chrome, Edge, Firefox, and Electron. Safari support is not available. Chrome-family browsers get the best support since Cypress uses the Chrome DevTools Protocol for advanced features.

Can Cypress test API endpoints?+

Yes. Cypress provides cy.request() for making HTTP requests and asserting on responses. You can test API endpoints alongside UI tests or use cy.intercept() to mock API responses during E2E tests.

How do I run Cypress in CI?+

Run npx cypress run for headless execution. Cypress supports Docker images, GitHub Actions, GitLab CI, and all major CI platforms. Cypress Cloud provides parallel test execution and test recording for CI optimization.

Sources citées (3)

Fil de discussion

Connectez-vous pour rejoindre la discussion.
Aucun commentaire pour l'instant. Soyez le premier à partager votre avis.

Actifs similaires