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:

  1. setup test DOM
  2. execute user-oriented queries to find nodes of interest (see Query::find and Finder::by_label_text)
  3. fire events as a user would (see crate::Dom::dispatch)
  4. wait for async queries to complete (see Found::until and Until)
  5. 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.

Traits

A type which can be queried as a DOM container, returning results from its subtree.

Convenience methods for dispatching events to targets, primarily useful for testing.