Module augdom::testing [−][src]
Expand description
Quoting from DOM Testing Library’s motivations, as this crate’s test utilities are similar in design:
The more your tests resemble the way your software is used, the more confidence they can give you.
As part of this goal, the utilities this library provides facilitate querying the DOM in the same way the user would. Finding form elements by their label text (just like a user would), finding links and buttons from their text (like a user would), and more.
These tools lend themselves to this basic test design:
- setup test DOM
- execute user-oriented queries to find nodes of interest (see
Query::find
andFinder::by_label_text
) - fire events as a user would (see
crate::Dom::dispatch
) - wait for async queries to complete (see
Found::until
andUntil
) - assert on results
TODO write examples that work in doctests
Structs
Executes a search strategy over a DOM container’s subtree via depth-first pre-order traversal.
The final description of a subtree query. The methods on this struct execute the underlying search and return the results in various forms.
A query which resolves asynchronously
Enums
A keyboard “key” which can be entered.
The outcome of a failed query.