🧪
Testing5M+/wkMIT

cypress

Cypress is a next-generation front-end testing tool built for the modern web, providing a complete end-to-end testing experience with time-travel debugging, aut

Installation

npm
npm install -D cypress
yarn
yarn add -D cypress
pnpm
pnpm add -D cypress

Import

ESM
// Cypress uses global cy object

Quick Example

usage
describe('Login', () => {
  it('should log in successfully', () => {
    cy.visit('/login');
    cy.get('[data-testid=email]').type('[email protected]');
    cy.get('[data-testid=password]').type('password');
    cy.get('button[type=submit]').click();
    cy.url().should('include', '/dashboard');
  });
});

About cypress

Cypress is a next-generation front-end testing tool built for the modern web, providing a complete end-to-end testing experience with time-travel debugging, automatic waiting, and real-time reloading. Unlike Selenium-based tools that execute commands remotely, Cypress runs directly in the browser alongside your application, giving it native access to the DOM, window objects, network layer, and local storage. This architecture enables Cypress to automatically wait for DOM elements, animations, API responses, and page loads without explicit wait commands. The Cypress Test Runner provides a visual interface showing your application alongside test execution with time-travel snapshots that let you hover over each command to see the application state at that point. Cypress includes built-in support for network request stubbing and interception, viewport resizing, screenshot and video recording, and automatic retry of assertions. The framework supports component testing in addition to end-to-end testing for React, Vue, Angular, and Svelte components. Cypress Dashboard provides CI/CD integration with parallel test execution, test analytics, and flake detection.

Quick Facts

Packagecypress
CategoryTesting
Weekly Downloads5M+
LicenseMIT
Installnpm install -D cypress

Related Packages

Browse npm Packages by Category

Explore our reference of 200 popular npm packages with install commands, examples, and quick-start guides.