Skip to content

Guide · Open source

How to use Cypress: install, run browser tests and get started

Updated · written with AI from the project's own documentation and checked against our catalogue data

Cypress is an open-source testing tool (MIT licensed, written in TypeScript) that runs automated tests against anything that runs in a web browser. It is aimed at developers who want to check that a web application behaves correctly, for example by simulating user actions and verifying the results. This guide shows you how to add Cypress to a JavaScript project, what it is suited to, and where it is not the right choice.

Cypresscypress-io/cypress · ★ 51k · MIT

Quick start

  1. 1Check your project. Confirm your web project uses JavaScript and a package manager: npm, Yarn or pnpm.
  2. 2Install Cypress. Run npm install cypress --save-dev, or the Yarn or pnpm equivalent, in your project folder.
  3. 3Open the getting-started guide. Follow the install guide at on.cypress.io/install to set up your first test run.
  4. 4Read the documentation. Use the documentation at on.cypress.io for details on writing and running tests.
  5. 5Check the changelog. Review on.cypress.io/changelog when you upgrade to see what has changed.

What is Cypress used for?

Cypress runs tests against web applications. Developers use it to check that their app behaves correctly by simulating user actions and verifying the results.

The project README describes Cypress as fast, easy and reliable testing for anything that runs in a browser, and points to its documentation for details.

  • Automated browser tests for a web application
  • Testing components from frameworks such as React, Vue, Angular or Svelte, as listed in the project topics

Who should use Cypress?

Cypress fits developers who want automated browser tests and teams that already work with npm, Yarn or pnpm in their JavaScript projects. The README assumes you install packages through one of these managers.

It is not a fit for non-developers looking for a no-code testing tool, for projects that need to test native mobile apps, or for anyone needing testing beyond the browser. The README only describes browser-based testing.

Install Cypress with npm, Yarn or pnpm

Cypress is installed as a development dependency using your package manager. Pick the command that matches the tool your project already uses. The README says Cypress installs on Mac, Linux, or Windows, and links to a getting-started guide for the next steps.

The README lists no separate prerequisites.

  • npm: use the npm install command below
  • Yarn: use the yarn add command below
  • pnpm: use the pnpm add command below
npm install cypress --save-dev

Other install commands

If your project uses Yarn or pnpm, run the matching command from your project folder instead of the npm one.

yarn add cypress --dev pnpm add cypress --save-dev

Next steps after installing

Once installed, follow the official getting-started guide linked from the README at on.cypress.io/install. The README also links to the full documentation at on.cypress.io, the changelog and the roadmap.

If you want to contribute to Cypress itself, the README points to a Contributing Guideline that explains repository organization, linting and testing.

  • Documentation: on.cypress.io
  • Changelog: on.cypress.io/changelog
  • Roadmap: on.cypress.io/roadmap

How does Cypress compare to other tools?

Cypress is one of several tools for browser testing. The other projects commonly compared with it are Playwright, Selenium, Puppeteer and WebdriverIO. Choose based on your team's language, workflow and testing needs rather than on popularity alone.

Cypress's README focuses on being fast, easy and reliable for browser-based testing.

  • Playwright
  • Selenium
  • Puppeteer
  • WebdriverIO

What people use it for

  • Checking that a web application's key user flows work in a real browser
  • Testing components built with React, Vue, Angular or Svelte
  • Adding automated browser tests to a project that already uses npm, Yarn or pnpm

Frequently asked questions

Is Cypress free?

Cypress is open source and released under the MIT license, as stated in the project README. The license file is linked from the repository.

How do I install Cypress?

Install it as a dev dependency with npm install cypress --save-dev, yarn add cypress --dev, or pnpm add cypress --save-dev. Run the command in your project folder. The README links to a getting-started guide for next steps.

What do I need before installing Cypress?

The README lists no specific prerequisites. It does assume you are working in a JavaScript project and installing packages with npm, Yarn or pnpm.

Can Cypress test mobile apps?

No. The README describes Cypress only for browser-based testing and does not cover native mobile apps.

Is Cypress good for non-developers?

The README assumes a developer audience who installs packages with a JavaScript package manager. Non-developers looking for a no-code tool should choose something else.

What are alternatives to Cypress?

The README's comparison list names Playwright, Selenium, Puppeteer and WebdriverIO. Each is a browser testing option you can evaluate against your project's needs.

New agent skills, repos and AI tools — every week

The best new skills and open-source projects, the fastest-growing repos, and one free prompt. Five minutes to read. Unsubscribe anytime.

Our verdict

Cypress suits developers and teams who already work with npm, Yarn or pnpm and want automated browser tests for their web applications. If you need no-code testing, native mobile app testing, or anything outside the browser, pick a different tool.

Install options & downloads