Functions explained: reusable workflows and diagnostics#
Repeated interactions became easier to maintain when each test could call an operation by name. At TOL, that included email-template controls shared across applications, primary and mailing addresses, consistently named screenshots, and diagnostic output for selector investigations.
Each helper has its own walkthrough with visible source code, an explanation of its arguments and branches, and larger examples of using it. The email and address pages include complete test files with inline values and alternative JSON configurations. The later chapters link back to these implementations as they follow the tests into agent workflows and manual drafts.
Email templates: handle a recurring pattern once#
Read the email-template walkthrough.
The page shows the complete verifyTemplateFields, setReminderHours, and interactWithIframeCell functions. It explains how options accommodate a template without Helper Tags or Notice, how a region scopes reminder fields, and how the iframe interaction fits into a clean test body. Both full test examples include imports and setup.
Primary and mailing addresses: one call for a repeated form#
The page shows the entire basic address function and the configurable CIT Corporation variant. It traces the primary-only, mailing-address, and required-fields branches, then supplies complete inline-value and JSON examples. The docs-as-code chapter later returns to the address modules when explaining generated references and deprecation.
takeNamedScreenshot: give images a reusable identity#
Read the named-screenshot walkthrough.
The page connects the complete capture functions to a full test example, output paths, optional JSON names, and an illustrated manual section containing a figure reference. The Proof of Address test and manual-draft chapter reuse these naming and destination rules.
Diagnostic functions: give the agent evidence about selectors#
Read the selector-diagnostics walkthrough.
The page shows logAllBoxes, textbox discovery, a substantial enhanced-diagnostics implementation excerpt, and the complete historical failure handler. A full integration example passes the correct workflow page into the hook. Sample output and an illustrative before/after selector repair lead into the agent repair loop, including the later, selective use of Playwright MCP.