Cypress is an open-source end-to-end testing tool written in JavaScript and TypeScript that runs your test code directly inside the browser. Unlike Selenium, it does not rely on a separate WebDriver process, which gives it automatic retry-ability between commands and lets you time-travel through every step a test took. Its most common use is testing modern JavaScript web applications at both the end-to-end and component level.
Learn Cypress end-to-end testing with JavaScript/TypeScript examples, time-travel debugging, network stubbing, custom commands and interview questions.
Cypress is a modern E2E testing framework that runs test code inside the browser, offering time-travel debugging and automatic retry-ability. With network stubbing, component testing and real-time visual feedback, it is one of QA engineers' favorite tools.
What you can learn on this page
🌲 What is Cypress? Architecture and Philosophy — Cypress runs inside the same process as the browser — like a surgeon operating with their own hands rather than giving instructions to a remote team over a phone: every cut is immediate, every reaction in real time, with zero round-trip delay. But if Selenium
⚙️ Installation — Cypress is installed via npm and can run in both GUI mode (Test Runner) and CLI mode (headless). Installation is a single package install — unlike Java, there's no separate driver download hassle (ChromeDriver, geckodriver); Cypress downloads its own browser b
🖱️ Basic Commands & Selector Strategy — Every command in Cypress starts with cy and returns a Promise-like but "chainable" object. cy.visit() navigates to a page, cy.get() finds an element by CSS selector, and cy.contains() searches by visible text. These commands are WRITTEN as if synchro
🧩 Actions, Forms & Drag & Drop — cy.type(), cy.click(), cy.check(), cy.uncheck(), and cy.select() are the core form actions. All of them are retry-able: they automatically wait until the element is visible, enabled (not disabled), and "actionable" (not covered by another element). I
🕐 Time Travel & Retry-ability — Cypress's most beloved feature is "time travel debugging": a DOM snapshot is stored in the background after every command. Once a test finishes (or fails), you can click any past entry in the Command Log to see exactly how the app looked AT THAT MOME
🌐 Network & cy.intercept() — cy.intercept() (formerly cy.route(), deprecated since v6) is Cypress's API for capturing the network layer. It can be used in three ways: "stub" the real request by replacing it with fake data, "spy" on the request without modifying it, or
🗂️ Writing & Organizing Tests — Think of the describe() / it() structure like a legal document hierarchy: describe() is the case heading (defines the scope of the behavior under scrutiny), and it() is a single individual claim — precise and independent, evaluable on its own regardless of whe
🏗️ Framework Architecture (SOLID + POM) — In Selenium and Playwright, at this point you would write a "Page Object Model" class — Cypress's official documentation recommends the OPPOSITE: instead of classic POM classes, it recommends "Custom Commands" and "App Actions". W
Frequently Asked Questions
What is Cypress?
Cypress is an open-source end-to-end testing tool written in JavaScript and TypeScript that runs your test code directly inside the browser. It does not rely on a separate WebDriver process.
What is the difference between Cypress and Selenium?
Cypress runs tests inside the browser and gives you automatic retry-ability; Selenium controls the browser from outside through a separate WebDriver process. This means Cypress is not as flexible as Selenium for multi-tab or multi-window testing.
How long does it take to learn Cypress?
You can learn the basic commands and `cy.intercept()` in a few days. Reaching interview-ready level — including custom commands and framework architecture — usually takes 3-4 weeks of regular practice.
Is Cypress free?
Cypress's test-running core is completely free and open-source. Extra services like Cypress Cloud for reporting and parallelization are paid, but writing and running tests locally or in CI costs nothing.
Which languages does Cypress support?
Cypress is written only in JavaScript and TypeScript — unlike Selenium or Playwright, it has no Java/Python/C# support.
What is the most common Cypress error?
"cy.get() timed out" — happens when the element cy.get() is looking for is not found within the retry window (default 4 seconds). It is most often caused by a wrong selector or the element never actually rendering.