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