Expand description
Driving a page from outside it: what a host’s driving verb answers, what that answer says, and the clock a page arms.
A ## Test works a page the way a visitor would — Click, Type … into, Press, Submit,
Choose, Hover — and every tier reports the outcome in the same three words: the element the
selector names is not there, it is there and nothing on the page answers what was done to it,
or something answered. A lowered page answers through its node dispatcher, which says whether
anything heard each event the verb raised; the reference tier knows it directly. Either way the
sentence a test author reads comes from HERE, so the two tiers cannot word one failure two ways.
The page clock is the other half of what a host does to a page it drives. A browser page arms
setInterval(ms, handler) and the browser calls the handler every ms milliseconds; a host
with a virtual clock does the same arithmetic when a test says Advance time by …. The armed
intervals are recorded here, beside the answers, because they are the host’s to fire.
Structs§
- Clock
State - The intervals a page has armed — what
takesaves andrestoreputs back. - Interval
- One interval a page armed: its period and the closure the host fires each period.
Enums§
- Answer
- What a driving verb found.
- Focus
Target - Where a verb’s default action sends keyboard focus (
Verb::focus_target). - Verb
- A driving verb a test aims at an element, and the events it raises there — the events a browser raises for the same act, in the order it raises them.
Functions§
- answer_
failure - The failure an answer means for
eventsaimed atselector, orNonewhen it is no failure. - arm_
interval setInterval(ms, handler)— record an interval the host fires everymsmilliseconds.- cannot_
take Typing into "#x" enters nothing. …/Choosing "v" in "#x" selects nothing. …— the element is there and cannot take the verb, so the browser’s own default action does nothing and raises noinputorchange.- element_
required `Focus "#x"` found no such element. …— a command that acts on one element (focus, blur) aimed at an element that is not there.- form_
urlencoded - A form’s fields as the body a browser submits:
a=1&b=2, each name and value percent-encoded with the unreserved characters kept and a space as+(application/x-www-form-urlencoded). - intervals
- Every interval the page has armed, in the order it armed them.
- mount_
target_ missing Mount App at "#root": no element matches that selector. …- no_
element No element matches "#x". …— the selector names nothing on the page.- no_
routes_ to_ serve Serve fetches with routes.in a program that declares no route.- nothing_
answers Nothing answers a click on "#x". …— the element is there and nothing listens.- reset_
clock - A fresh page: no intervals armed.
- restore
- Put back intervals a matching
takereturned. - take
- Take the armed intervals, leaving none in their place — like
reset_clock, but they come back to the caller instead of being dropped. A nested run (a candidate page tier compared against the reference) takes the caller’s own armed intervals before it arms its own, andrestores them when it is done.