How to Install and Set Up Cypress: A Complete Beginner's Guide

This guide walks you through installing Node.js, creating a project directory, installing Cypress via npm, launching the tool, and understanding its default file structure, providing clear step‑by‑step instructions and screenshots for a smooth setup.

FunTester
FunTester
FunTester
How to Install and Set Up Cypress: A Complete Beginner's Guide

1. Installation

Cypress supports Windows 64/32, Linux 64, and macOS 64. This guide uses the Windows 64 version, downloadable from the official Cypress download site.

First install node.js from https://nodejs.org/en and add it to the system PATH.

Create a new directory (e.g., mycypress) and open a command prompt in that folder.

Run npm init and accept the defaults (press Enter repeatedly, then type yes and press Enter) to generate a package.json file.

Install Cypress as a development dependency:

npm install cypress --save-dev

2. Opening Cypress

After installation, launch Cypress from the project root with one of the following commands:

cypress open
npx cypress open

If the command is not found, navigate to F:\mycypress\node_modules\.bin and execute the command from there.

When the Cypress UI appears, select a test file (e.g., testlogin.js) to run and debug.

3. Project File Structure

The default Cypress project layout contains the following directories:

fixtures : stores external test data such as JSON files.

integration : holds test case files (extensions .js, .jsx, .coffee, .cjsx).

plugins : contains plugin files.

results : generated test report JSON files (configurable via cypress.json).

screenshots : automatically saved screenshots of failed tests, located under cypress/screenshots.

support : includes commands.js for custom commands that are loaded before test files.

videos : stores video recordings produced by cypress run.

Original Source

Signed-in readers can open the original source through BestHub's protected redirect.

Sign in to view source
Republication Notice

This article has been distilled and summarized from source material, then republished for learning and reference. If you believe it infringes your rights, please contactadmin@besthub.devand we will review it promptly.

frontendJavaScriptAutomationtestingInstallationCypress
FunTester
Written by

FunTester

10k followers, 1k articles | completely useless

0 followers
Reader feedback

How this landed with the community

Sign in to like

Rate this article

Was this worth your time?

Sign in to rate
Discussion

0 Comments

Thoughtful readers leave field notes, pushback, and hard-won operational detail here.