Cypress: Front-End Testing That Runs in the Browser

Shriira Press

Preface

A comprehensive, self-contained guide to Cypress — the JavaScript/TypeScript framework for testing web applications end to end (and at the componen…

Welcome to Cypress: Front-End Testing That Runs in the Browser.

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.

This title is part of the ShriIra library and is free to read in full, right here — our small contribution to making world-class knowledge easy to reach.

A note on reading it: open the Contents menu at the top of the reader to jump between chapters, use the Aa menu to set a comfortable text size, theme (light, sepia, or night), and single- or two-page layout. Your place is saved automatically, so you can always pick up where you left off.

We hope it serves you well.

— Shriira Press

Contents

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