Cypress

15.14.0 · active · verified Sat Apr 18

Cypress is a next-generation front-end testing tool built for the modern web, enabling fast, easy, and reliable testing for anything that runs in a browser. It supports end-to-end, component, and API testing. The current stable version is 15.14.0, and it maintains a regular release cadence with frequent minor updates and periodic major versions.

Common errors

Warnings

Install

Imports

Quickstart

This quickstart shows how to define a basic Cypress configuration file (`cypress.config.ts`) and a simple end-to-end test (`example.cy.ts`) that navigates to a URL, interacts with an element, and asserts its state. After installing `cypress` as a dev dependency (`npm install -D cypress`), you can run `npx cypress open` to launch the test runner.

import { defineConfig } from 'cypress';

export default defineConfig({
  e2e: {
    setupNodeEvents(on, config) {
      // implement node event listeners here
    },
  },
});

// cypress/e2e/example.cy.ts

describe('My First Test', () => {
  it('Visits the Kitchen Sink', () => {
    cy.visit('https://example.cypress.io');
    cy.contains('type').click();
    cy.url().should('include', '/commands/actions');
    cy.get('.action-email')
      .type('test@example.com')
      .should('have.value', 'test@example.com');
  });
});

view raw JSON →