Cypress: Front-End Testing That Runs in the Browser cover

Web · Ebook

Cypress: Front-End Testing That Runs in the Browser

by Shriira Press

4.9(6,741)88 pagesPublished 2026

A comprehensive, self-contained guide to Cypress — the JavaScript/TypeScript framework for testing web applications end to end (and at the component level). Where Selenium and Playwright drive a browser from the outside via a protocol, Cypress takes a radically different approach: it runs your test code inside the browser, in the same event loop as the app under test. That architecture gives it its signature strengths — a famous interactive Test Runner with time-travel debugging, automatic waiting and retry-ability baked into every command, and a developer experience tuned for the people who build the front end. This book teaches it end to end — the cy command chain, selecting and interacting with elements, retry-able assertions, network control with cy.intercept, test structure and custom commands, real-world app patterns, component testing, and CI — blending intuition, the concepts behind the framework, and runnable code.

Contents

  1. 1Preface
  2. 2Chapter 1 — What Is Cypress?
  3. 3Chapter 2 — How Cypress Works: In-Browser Architecture
  4. 4Chapter 3 — Getting Started: Install and the Test Runner
  5. 5Chapter 4 — Commands, Queries, and the Chain
  6. 6Chapter 5 — Selecting Elements and Best Practices
  7. 7Chapter 6 — Interacting with Elements
  8. 8Chapter 7 — Assertions and Automatic Retry-Ability
  9. 9Chapter 8 — Waiting, Network Control, and cy.intercept
  10. 10Chapter 9 — Test Structure: Fixtures, Hooks, Custom Commands, and Config
  11. 11Chapter 10 — Real-World Apps: Auth, Navigation, and Cross-Origin
  12. 12Chapter 11 — Component Testing
  13. 13Chapter 12 — Debugging, CI, and Flake
  14. 14Chapter 13 — In Practice, the Ecosystem, and the Profession
  15. 15Appendix A — Glossary and Quick Reference
  16. 16Appendix B — Further Reading and Resources