Cypress Tutorial for Beginners
A free, hands-on Cypress tutorial in JavaScript: selectors, retry-ability, intercept, cy.session, component tests, config and debugging, ending with your suite running on TestingBot and in CI.
What you will learn
- Cypress Tutorial for Beginners
- Install Cypress and Run a First Spec
- Selectors and the Cypress Command Queue
- Cypress Assertions and Waiting Without Sleeps
- Fixtures and Network Stubbing with cy.intercept
- Custom Commands and Logging In Once with cy.session
- Cypress Configuration, Environment Variables and Retries
- Cypress Component Testing vs End-to-End Testing
- Run Cypress on TestingBot and in CI
- Debugging Cypress Tests
- Knowledge check
On this page
Last reviewed November 2026 against Cypress 14.2.0 and testingbot-cypress-cli 1.1.5.
Cypress is an open-source end-to-end testing tool for web applications. You write tests in JavaScript (or TypeScript), Cypress opens a real browser, and you watch every command run next to your application. This course teaches it from an empty folder to a suite that runs on several browsers in the cloud and in CI.
If you have used Selenium or Playwright before, three design decisions explain most of what will feel different in Cypress.
1. Your test runs inside the browser#
Selenium and Playwright drive the browser from a separate process. Cypress loads your spec file into the browser itself, next to the application under test, and a Node.js process alongside it handles the things a web page cannot do (reading files, network proxying, screenshots). That is why Cypress can stub network responses, read window and localStorage directly, and show a live snapshot of the page for every step.
It is also why some things work differently: a single test is meant to stay on one origin, and you reach for cy.origin() or a programmatic login (chapter 5) when it cannot.
2. Commands are queued, not executed#
This line does not find a button:
cy.get('[data-test=new-todo]').type('Buy milk{enter}')
It enqueues two commands. Cypress runs the queue after your test function returns, one command at a time, and each query retries until it finds what it needs or its timeout (4 seconds by default) runs out. Once you see this, a lot of beginner confusion disappears: why const el = cy.get(...) does not give you an element, why there is no await, and why you almost never need a sleep. Chapter 2 covers the queue and chapter 3 covers retry-ability.
3. Each test starts clean#
Since Cypress 12, test isolation is on by default: before every test Cypress clears the page, cookies, localStorage and sessionStorage. Tests cannot lean on state a previous test left behind. The price is that every test must set up what it needs, which is exactly what cy.session() (chapter 5) makes fast.
Which Cypress version this course uses#
The course pins Cypress 14.2.0, because it is the newest version that TestingBot's grid runs (the supported versions list), and chapter 8 runs the same suite there. Everything in chapters 1 to 7 works the same way in later 14.x and 15.x releases. Cypress 16 removed Cypress.env() in favour of cy.env() and Cypress.expose(); chapter 6 shows where that matters.
How the course is organised#
Each chapter adds to one small project, so by the end you have a suite you understand line by line:
- Install Cypress and run a first spec
- Selectors and the command queue
- Assertions and waiting without
cy.wait(ms) - Fixtures and network stubbing with
cy.intercept() - Custom commands and logging in once with
cy.session() - Configuration, environment variables and retries
- Component testing, briefly
- Running Cypress on TestingBot and in CI
- Debugging failing tests
- A knowledge check
The examples run against public demo pages, so you can copy them and see them pass: the Cypress team's own example site at example.cypress.io (a todo app and a page that makes network requests) and a login form at the-internet.herokuapp.com. Swap in your own application whenever you are ready.
A note on "Cypress certification", since people search for it: this course and its knowledge check are free and need no account. If you want something to show an employer, the optional TestingBot certification asks for a passed exam and the course suite running green on TestingBot. It is issued by TestingBot, not by Cypress.io, and the certificate says so.
What you'll build#
A JavaScript Cypress project that:
- tests a todo app with stable selectors and retrying assertions,
- stubs and inspects network calls with
cy.intercept()and fixture files, - logs in once per run with a custom command built on
cy.session(), - mounts a React component in isolation,
- runs on Chrome and Firefox on Windows through the TestingBot Cypress CLI, from your laptop and from GitHub Actions.
Prerequisites#
- Node.js 18, 20 or 22 or newer (the course was run on Node.js 22).
- Basic JavaScript: functions, arrow functions, objects. You do not need
async/await; Cypress does not use it. - A terminal and a code editor.
- A GitHub account for the CI part of chapter 8, and a TestingBot account for running in the cloud (the free trial is enough).
If you are still choosing a framework, our Cypress vs Playwright comparison and Cypress vs Selenium comparison walk through the trade-offs, and the Playwright tutorial follows the same arc for Playwright.