Start testing with Cypress
Install Cypress from your terminal and run your first test. Need help getting started? Check out our docs.
Paste this prompt into your coding agent, or run the commands below.
Install Cypress in this project and open it. 1. Pick the package manager from the lockfile in the project root: package-lock.json (npm), yarn.lock (Yarn), pnpm-lock.yaml (pnpm), bun.lock or bun.lockb (Bun). If there is no lockfile, use npm. 2. Check that Node.js and the package manager meet the system requirements in the install guide: https://docs.cypress.io/app/get-started/install-cypress.md?utm_medium=website&utm_source=cypress.io&utm_content=install-ai-prompt 3. From the project root, install Cypress as a dev dependency: - npm: npm install cypress --save-dev - Yarn: yarn add cypress --dev - pnpm: pnpm add --save-dev cypress - Bun: bun add --dev cypress 4. Confirm the Cypress binary is installed: - npm: npx cypress verify - Yarn: yarn cypress verify - pnpm: pnpm cypress verify - Bun: bunx cypress verify If verification fails because the package manager blocked Cypress's postinstall script, follow the package manager configuration steps in the install guide, then verify again. 5. Launch Cypress. `cypress open` keeps running until the Cypress window is closed, so start it without waiting for it to exit: - npm: npx cypress open - Yarn: yarn cypress open - pnpm: pnpm cypress open - Bun: bunx cypress open Don't create a Cypress config or spec files yourself. Cypress may show a welcome screen first. After that, I choose end-to-end or component testing in the Cypress window, and Cypress scaffolds the config for me. When you're done, tell me which package manager you used and what you changed.
$ npm install cypress --save-dev$ npx cypress open