Library › Book 1 › Snapshots, Refs, and Sessions -- The Working Vocabulary
Snapshots, Refs, and Sessions -- The Working Vocabulary
6.1🔒Snapshots and RefsChapter 5 gave you the architecture. This chapter gives you the day-to-day vocabulary: snapshots, element refs, the command surface, and…
6.2🔒The Full Command Surface, by CategoryThe complete working surface is small enough to hold in your head -- six groups:
6.3🔒Named SessionsParallel browser contexts come free via named sessions:
6.4🔒Saving and Restoring StateLogging in is the most repeated, least valuable activity in UI testing. The state commands make you stop doing it:
6.5🔒Worked Example: TodoMVC, End to EndAssemble the vocabulary against the Playwright team's TodoMVC demo: add a todo, complete it, verify.
6.6🔒Worked Example: Two Personas, One AgentThe scenario that sells named sessions: an admin changes a product price, and a customer must see it.
6.7🔒Key Takeaways- Snapshots are compact YAML accessibility summaries saved to disk -- roles, accessible names, and stable [ref=...] handles, not raw DOM…
6.8🔒Q&ASelf-Assessment Quiz1. What three kinds of information does a snapshot line like - textbox "What needs to be done?" [ref=e8] convey? 2. Why is the ref model…
6.9🔒Exercises[Beginner] Exercise 6.1: Reproduce the TodoMVC flow from section 6.5 by hand: open, snapshot, fill, press Enter, re-snapshot, check…
6.10🔒Career Translation- Implemented ref-based browser automation over YAML accessibility snapshots (Playwright CLI), eliminating CSS/XPath selector authoring and…
6.11🔒Q&AInterview Depth CheckPrompt: Walk me through what a playwright-cli snapshot contains and why that representation -- rather than DOM or screenshots -- is the…