{"id":10384,"library":"cypress","title":"Cypress","description":"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.","status":"active","version":"15.14.0","language":"javascript","source_language":"en","source_url":"https://github.com/cypress-io/cypress","tags":["javascript","automation","browser","cypress","cypress.io","e2e","end-to-end","integration","component","typescript"],"install":[{"cmd":"npm install cypress","lang":"bash","label":"npm"},{"cmd":"yarn add cypress","lang":"bash","label":"yarn"},{"cmd":"pnpm add cypress","lang":"bash","label":"pnpm"}],"dependencies":[],"imports":[{"note":"Used in `cypress.config.ts` or `cypress.config.js` for project configuration.","symbol":"defineConfig","correct":"import { defineConfig } from 'cypress'"}],"quickstart":{"code":"import { defineConfig } from 'cypress';\n\nexport default defineConfig({\n  e2e: {\n    setupNodeEvents(on, config) {\n      // implement node event listeners here\n    },\n  },\n});\n\n// cypress/e2e/example.cy.ts\n\ndescribe('My First Test', () => {\n  it('Visits the Kitchen Sink', () => {\n    cy.visit('https://example.cypress.io');\n    cy.contains('type').click();\n    cy.url().should('include', '/commands/actions');\n    cy.get('.action-email')\n      .type('test@example.com')\n      .should('have.value', 'test@example.com');\n  });\n});\n","lang":"typescript","description":"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."},"warnings":[{"fix":"Upgrade your Node.js runtime to version `^20.1.0 || ^22.0.0 || >=24.0.0` or higher to match the package's engine requirements.","message":"Cypress requires specific Node.js versions. Ensure your Node.js environment meets the minimum requirements.","severity":"breaking","affected_versions":"<15.x"},{"fix":"Chain Cypress commands using their built-in chaining mechanism and `should()` or `then()` for assertions and further actions. Avoid mixing `cy` commands directly with `async/await` without careful wrapping or understanding of the command queue.","message":"Cypress commands are asynchronous and queued, not immediately executed. They do not return promises directly, which can lead to common JavaScript asynchronous patterns (like `async/await`) not working as expected with `cy` commands.","severity":"gotcha","affected_versions":">=3.0.0"},{"fix":"Rename your `cypress.json` to `cypress.config.js` (or `.ts`) and update its structure to use the `defineConfig` helper. Refer to the Cypress migration guide for detailed instructions.","message":"Configuration files moved from `cypress.json` to `cypress.config.js` or `cypress.config.ts`.","severity":"breaking","affected_versions":">=10.0.0"},{"fix":"Refactor existing `cy.route()` calls to use `cy.intercept()`. `cy.intercept()` offers more powerful and flexible control over network requests.","message":"The `cy.route()` command for network stubbing has been deprecated and replaced by `cy.intercept()`.","severity":"breaking","affected_versions":">=6.0.0"},{"fix":"Prefer using Cypress's built-in retryability and explicit waiting commands like `cy.wait('@alias')` for network requests, `cy.get('selector', { timeout: ms })` for element visibility, or `cy.contains('text')` to wait for specific content.","message":"Over-reliance on `cy.wait(ms)` for arbitrary time delays can lead to flaky tests, as it doesn't wait for specific conditions to be met.","severity":"gotcha","affected_versions":">=3.0.0"}],"env_vars":null,"last_verified":"2026-04-18T00:00:00.000Z","next_check":"2026-07-17T00:00:00.000Z","problems":[{"fix":"Upgrade your Node.js to a version compatible with Cypress (e.g., `^20.1.0 || ^22.0.0 || >=24.0.0`). You might use a tool like NVM (Node Version Manager) to manage multiple Node.js versions.","cause":"Your Node.js runtime version does not meet Cypress's minimum requirements.","error":"Cypress detected that you are running a very old version of Node.js"},{"fix":"Replace all instances of `cy.route()` with `cy.intercept()`. Review the Cypress documentation for `cy.intercept()` for detailed usage.","cause":"You are using an outdated command for network stubbing/spying.","error":"Cypress command `cy.route()` is deprecated. Please use `cy.intercept()` instead."},{"fix":"Verify the selector is correct and the element is present in the DOM within the expected time. Add explicit waits using `cy.wait('@alias')` for network requests, increase the command timeout if genuinely needed (`cy.get('selector', { timeout: 10000 })`), or ensure the element is rendered after any asynchronous operations.","cause":"Cypress could not find the specified DOM element within the default command timeout (usually 4 seconds).","error":"Timed out retrying: Expected to find element: '...', but never found it."},{"fix":"Ensure you have a `cypress.config.js` or `cypress.config.ts` file in your project root, and it's correctly structured using `defineConfig`. If migrating from an older version, rename and update `cypress.json`.","cause":"Cypress cannot find or correctly parse its configuration file.","error":"Cypress failed to start. This may be due to a missing or invalid configuration file."}],"ecosystem":"npm"}