dom/queries library Dom

Classes

NormalizerOptions
Options to be passed into a custom NormalizerFn.
ScreenQueries
WithinQueries Queries
Queries scoped to the provided container.

Properties

screen ScreenQueries Queries
Exposes all the "top-level" queries exposed by the dom-testing-library, but the scope/container is defaulted to document.body.
getter/setter pair

Functions

findAllByAltText<E extends Element>(Node container, dynamic text, {bool exact = true, NormalizerFn normalizer([NormalizerOptions?])?, Duration? timeout, Duration interval = defaultAsyncCallbackCheckInterval, QueryTimeoutFn? onTimeout, MutationObserverOptions mutationObserverOptions = defaultMutationObserverOptions}) Future<List<E>> Async ByAltText Queries
Returns a list of ImageElements, InputElements and/or AreaElements with the given text as the value of the alt attribute, defaulting to an exact match after waiting 1000ms (or the specified timeout duration).
findAllByDisplayValue<E extends Element>(Node container, dynamic value, {bool exact = true, NormalizerFn normalizer([NormalizerOptions?])?, Duration? timeout, Duration interval = defaultAsyncCallbackCheckInterval, QueryTimeoutFn? onTimeout, MutationObserverOptions mutationObserverOptions = defaultMutationObserverOptions}) Future<List<E>> Async ByDisplayValue Queries
Returns a list of InputElement, TextAreaElement or SelectElement that has the matching value displayed, defaulting to an exact match after waiting 1000ms (or the provided timeout duration).
findAllByLabelText<E extends Element>(Node container, dynamic text, {bool exact = true, NormalizerFn normalizer([NormalizerOptions?])?, String? selector, Duration? timeout, Duration interval = defaultAsyncCallbackCheckInterval, QueryTimeoutFn? onTimeout, MutationObserverOptions mutationObserverOptions = defaultMutationObserverOptions}) Future<List<E>> Async ByLabelText Queries
Returns a list of elements that are associated with a LabelElement with the given text, defaulting to an exact match after waiting 1000ms (or the provided timeout duration).
findAllByPlaceholderText<E extends Element>(Node container, dynamic text, {bool exact = true, NormalizerFn normalizer([NormalizerOptions?])?, Duration? timeout, Duration interval = defaultAsyncCallbackCheckInterval, QueryTimeoutFn? onTimeout, MutationObserverOptions mutationObserverOptions = defaultMutationObserverOptions}) Future<List<E>> Async ByPlaceholderText Queries
Returns a list of elements with the given text as the value of the placeholder attribute, defaulting to an exact match after waiting 1000ms (or the specified timeout duration).
findAllByRole<E extends Element>(Node container, dynamic role, {bool exact = true, NormalizerFn normalizer([NormalizerOptions?])?, bool hidden = false, dynamic name, bool? selected, bool? checked, bool? pressed, bool? expanded, bool queryFallbacks = false, int? level, Duration? timeout, Duration interval = defaultAsyncCallbackCheckInterval, QueryTimeoutFn? onTimeout, MutationObserverOptions mutationObserverOptions = defaultMutationObserverOptions}) Future<List<E>> Async ByRole Queries
Returns a list of elements with the given role value, defaulting to an exact match after waiting 1000ms (or the provided timeout duration).
findAllByTestId<E extends Element>(Node container, dynamic testId, {bool exact = true, NormalizerFn normalizer([NormalizerOptions?])?, Duration? timeout, Duration interval = defaultAsyncCallbackCheckInterval, QueryTimeoutFn? onTimeout, MutationObserverOptions mutationObserverOptions = defaultMutationObserverOptions}) Future<List<E>> Async ByTestId Queries
Returns a list of elements with the given testId value for the data-test-id attribute, defaulting to an exact match after waiting 1000ms (or the provided timeout duration).
findAllByText<E extends Element>(Node container, dynamic text, {bool exact = true, NormalizerFn normalizer([NormalizerOptions?])?, String? selector, dynamic ignore = 'script', Duration? timeout, Duration interval = defaultAsyncCallbackCheckInterval, QueryTimeoutFn? onTimeout, MutationObserverOptions mutationObserverOptions = defaultMutationObserverOptions}) Future<List<E>> Async ByText Queries
Returns a list of elements with the given text content, defaulting to an exact match after waiting 1000ms (or the provided timeout duration).
findAllByTitle<E extends Element>(Node container, dynamic title, {bool exact = true, NormalizerFn normalizer([NormalizerOptions?])?, Duration? timeout, Duration interval = defaultAsyncCallbackCheckInterval, QueryTimeoutFn? onTimeout, MutationObserverOptions mutationObserverOptions = defaultMutationObserverOptions}) Future<List<E>> Async ByTitle Queries
Returns a list of elements with the given title as the value of the title attribute, defaulting to an exact match after waiting 1000ms (or the specified timeout duration).
findByAltText<E extends Element>(Node container, dynamic text, {bool exact = true, NormalizerFn normalizer([NormalizerOptions?])?, Duration? timeout, Duration interval = defaultAsyncCallbackCheckInterval, QueryTimeoutFn? onTimeout, MutationObserverOptions mutationObserverOptions = defaultMutationObserverOptions}) Future<E> Async ByAltText Queries
Returns a future with a single ImageElement, InputElement or AreaElement value with the given text as the value of the alt attribute, defaulting to an exact match after waiting 1000ms (or the specified timeout duration).
findByDisplayValue<E extends Element>(Node container, dynamic value, {bool exact = true, NormalizerFn normalizer([NormalizerOptions?])?, Duration? timeout, Duration interval = defaultAsyncCallbackCheckInterval, QueryTimeoutFn? onTimeout, MutationObserverOptions mutationObserverOptions = defaultMutationObserverOptions}) Future<E> Async ByDisplayValue Queries
Returns a future with a single InputElement, TextAreaElement or SelectElement that has the matching value displayed, defaulting to an exact match after waiting 1000ms (or the provided timeout duration).
findByLabelText<E extends Element>(Node container, dynamic text, {bool exact = true, NormalizerFn normalizer([NormalizerOptions?])?, String? selector, Duration? timeout, Duration interval = defaultAsyncCallbackCheckInterval, QueryTimeoutFn? onTimeout, MutationObserverOptions mutationObserverOptions = defaultMutationObserverOptions}) Future<E> Async ByLabelText Queries
Returns a future with a single element that is associated with a LabelElement with the given text, defaulting to an exact match after waiting 1000ms (or the provided timeout duration).
findByPlaceholderText<E extends Element>(Node container, dynamic text, {bool exact = true, NormalizerFn normalizer([NormalizerOptions?])?, Duration? timeout, Duration interval = defaultAsyncCallbackCheckInterval, QueryTimeoutFn? onTimeout, MutationObserverOptions mutationObserverOptions = defaultMutationObserverOptions}) Future<E> Async ByPlaceholderText Queries
Returns a future with a single element value with the given text as the value of the placeholder attribute, defaulting to an exact match after waiting 1000ms (or the specified timeout duration).
findByRole<E extends Element>(Node container, dynamic role, {bool exact = true, NormalizerFn normalizer([NormalizerOptions?])?, bool hidden = false, dynamic name, bool? selected, bool? checked, bool? pressed, bool? expanded, bool queryFallbacks = false, int? level, Duration? timeout, Duration interval = defaultAsyncCallbackCheckInterval, QueryTimeoutFn? onTimeout, MutationObserverOptions mutationObserverOptions = defaultMutationObserverOptions}) Future<E> Async ByRole Queries
Returns a future with a single element value with the given role value, defaulting to an exact match after waiting 1000ms (or the provided timeout duration).
findByTestId<E extends Element>(Node container, dynamic testId, {bool exact = true, NormalizerFn normalizer([NormalizerOptions?])?, Duration? timeout, Duration interval = defaultAsyncCallbackCheckInterval, QueryTimeoutFn? onTimeout, MutationObserverOptions mutationObserverOptions = defaultMutationObserverOptions}) Future<E> Async ByTestId Queries
Returns a future with a single element value with the given testId value for the data-test-id attribute, defaulting to an exact match after waiting 1000ms (or the provided timeout duration).
findByText<E extends Element>(Node container, dynamic text, {bool exact = true, NormalizerFn normalizer([NormalizerOptions?])?, String? selector, dynamic ignore = 'script', Duration? timeout, Duration interval = defaultAsyncCallbackCheckInterval, QueryTimeoutFn? onTimeout, MutationObserverOptions mutationObserverOptions = defaultMutationObserverOptions}) Future<E> Async ByText Queries
Returns a future with a single element value with the given text content, defaulting to an exact match after waiting 1000ms (or the provided timeout duration).
findByTitle<E extends Element>(Node container, dynamic title, {bool exact = true, NormalizerFn normalizer([NormalizerOptions?])?, Duration? timeout, Duration interval = defaultAsyncCallbackCheckInterval, QueryTimeoutFn? onTimeout, MutationObserverOptions mutationObserverOptions = defaultMutationObserverOptions}) Future<E> Async ByTitle Queries
Returns a future with a single element value with the given title as the value of the title attribute, defaulting to an exact match after waiting 1000ms (or the specified timeout duration).
getAllByAltText<E extends Element>(Node container, dynamic text, {bool exact = true, NormalizerFn normalizer([NormalizerOptions?])?}) List<E> ByAltText Queries
Returns a list of ImageElements, InputElements and/or AreaElements with the given text as the value of the alt attribute, defaulting to an exact match.
getAllByDisplayValue<E extends Element>(Node container, dynamic value, {bool exact = true, NormalizerFn normalizer([NormalizerOptions?])?}) List<E> ByDisplayValue Queries
Returns a list of InputElements, TextAreaElements or SelectElements that have the matching value displayed, defaulting to an exact match.
getAllByLabelText<E extends Element>(Node container, dynamic text, {bool exact = true, NormalizerFn normalizer([NormalizerOptions?])?, String? selector}) List<E> ByLabelText Queries
Returns a list of elements that are associated with a LabelElement with the given text, defaulting to an exact match.
getAllByPlaceholderText<E extends Element>(Node container, dynamic text, {bool exact = true, NormalizerFn normalizer([NormalizerOptions?])?}) List<E> ByPlaceholderText Queries
Returns a list of elements with the given text as the value of the placeholder attribute, defaulting to an exact match.
getAllByRole<E extends Element>(Node container, dynamic role, {bool exact = true, NormalizerFn normalizer([NormalizerOptions?])?, bool hidden = false, dynamic name, bool? selected, bool? checked, bool? pressed, bool? expanded, bool queryFallbacks = false, int? level}) List<E> ByRole Queries
Returns a list of elements with the given role value, defaulting to an exact match.
getAllByTestId<E extends Element>(Node container, dynamic testId, {bool exact = true, NormalizerFn normalizer([NormalizerOptions?])?}) List<E> ByTestId Queries
Returns a list of elements with the given testId value for the data-test-id attribute, defaulting to an exact match.
getAllByText<E extends Element>(Node container, dynamic text, {bool exact = true, NormalizerFn normalizer([NormalizerOptions?])?, String? selector, dynamic ignore = 'script'}) List<E> ByText Queries
Returns a list of elements with the given text content, defaulting to an exact match.
getAllByTitle<E extends Element>(Node container, dynamic title, {bool exact = true, NormalizerFn normalizer([NormalizerOptions?])?}) List<E> ByTitle Queries
Returns a list of elements with the given title as the value of the title attribute, defaulting to an exact match.
getByAltText<E extends Element>(Node container, dynamic text, {bool exact = true, NormalizerFn normalizer([NormalizerOptions?])?}) → E ByAltText Queries
Returns a single ImageElement, InputElement or AreaElement with the given text as the value of the alt attribute, defaulting to an exact match.
getByDisplayValue<E extends Element>(Node container, dynamic value, {bool exact = true, NormalizerFn normalizer([NormalizerOptions?])?}) → E ByDisplayValue Queries
Returns a single InputElement, TextAreaElement or SelectElement that has the matching value displayed, defaulting to an exact match.
getByLabelText<E extends Element>(Node container, dynamic text, {bool exact = true, NormalizerFn normalizer([NormalizerOptions?])?, String? selector}) → E ByLabelText Queries
Returns a single element that is associated with a LabelElement with the given text, defaulting to an exact match.
getByPlaceholderText<E extends Element>(Node container, dynamic text, {bool exact = true, NormalizerFn normalizer([NormalizerOptions?])?}) → E ByPlaceholderText Queries
Returns a single element with the given text as the value of the placeholder attribute, defaulting to an exact match.
getByRole<E extends Element>(Node container, dynamic role, {bool exact = true, NormalizerFn normalizer([NormalizerOptions?])?, bool hidden = false, dynamic name, bool? selected, bool? checked, bool? pressed, bool? expanded, bool queryFallbacks = false, int? level}) → E ByRole Queries
Returns a single element with the given role value, defaulting to an exact match.
getByTestId<E extends Element>(Node container, dynamic testId, {bool exact = true, NormalizerFn normalizer([NormalizerOptions?])?}) → E ByTestId Queries
Returns a single element with the given testId value for the data-test-id attribute, defaulting to an exact match.
getByText<E extends Element>(Node container, dynamic text, {bool exact = true, NormalizerFn normalizer([NormalizerOptions?])?, String? selector, dynamic ignore = 'script'}) → E ByText Queries
Returns a single element with the given text content, defaulting to an exact match.
getByTitle<E extends Element>(Node container, dynamic title, {bool exact = true, NormalizerFn normalizer([NormalizerOptions?])?}) → E ByTitle Queries
Returns a single element with the given title as the value of the title attribute, defaulting to an exact match.
getDefaultNormalizer([NormalizerOptions? options]) NormalizerFn Function([NormalizerOptions?])
The default "normalizer" used to normalize the string query value provided to a query by trimming whitespace from the start and end of text, and collapsing multiple adjacent whitespace characters into a single space.
queryAllByAltText<E extends Element>(Node container, dynamic text, {bool exact = true, NormalizerFn normalizer([NormalizerOptions?])?}) List<E> ByAltText Queries
Returns a list of ImageElements, InputElements and/or AreaElements with the given text as the value of the alt attribute, defaulting to an exact match.
queryAllByDisplayValue<E extends Element>(Node container, dynamic value, {bool exact = true, NormalizerFn normalizer([NormalizerOptions?])?}) List<E> ByDisplayValue Queries
Returns a list of InputElements, TextAreaElements or SelectElements that have the matching value displayed, defaulting to an exact match.
queryAllByLabelText<E extends Element>(Node container, dynamic text, {bool exact = true, NormalizerFn normalizer([NormalizerOptions?])?, String? selector}) List<E> ByLabelText Queries
Returns a list of elements that are associated with a LabelElement with the given text, defaulting to an exact match.
queryAllByPlaceholderText<E extends Element>(Node container, dynamic text, {bool exact = true, NormalizerFn normalizer([NormalizerOptions?])?}) List<E> ByPlaceholderText Queries
Returns a list of elements with the given text as the value of the placeholder attribute, defaulting to an exact match.
queryAllByRole<E extends Element>(Node container, dynamic role, {bool exact = true, NormalizerFn normalizer([NormalizerOptions?])?, bool hidden = false, dynamic name, bool? selected, bool? checked, bool? pressed, bool? expanded, bool queryFallbacks = false, int? level}) List<E> ByRole Queries
Returns a list of elements with the given role value, defaulting to an exact match.
queryAllByTestId<E extends Element>(Node container, dynamic testId, {bool exact = true, NormalizerFn normalizer([NormalizerOptions?])?}) List<E> ByTestId Queries
Returns a list of elements with the given testId value for the data-test-id attribute, defaulting to an exact match.
queryAllByText<E extends Element>(Node container, dynamic text, {bool exact = true, NormalizerFn normalizer([NormalizerOptions?])?, String? selector, dynamic ignore = 'script'}) List<E> ByText Queries
Returns a list of elements with the given text content, defaulting to an exact match.
queryAllByTitle<E extends Element>(Node container, dynamic title, {bool exact = true, NormalizerFn normalizer([NormalizerOptions?])?}) List<E> ByTitle Queries
Returns a list of elements with the given title as the value of the title attribute, defaulting to an exact match.
queryByAltText<E extends Element>(Node container, dynamic text, {bool exact = true, NormalizerFn normalizer([NormalizerOptions?])?}) → E? ByAltText Queries
Returns a single ImageElement, InputElement or AreaElement with the given text as the value of the alt attribute, defaulting to an exact match.
queryByDisplayValue<E extends Element>(Node container, dynamic value, {bool exact = true, NormalizerFn normalizer([NormalizerOptions?])?}) → E? ByDisplayValue Queries
Returns a single InputElement, TextAreaElement or SelectElement that has the matching value displayed, defaulting to an exact match.
queryByLabelText<E extends Element>(Node container, dynamic text, {bool exact = true, NormalizerFn normalizer([NormalizerOptions?])?, String? selector}) → E? ByLabelText Queries
Returns a single element that is associated with a LabelElement with the given text, defaulting to an exact match.
queryByPlaceholderText<E extends Element>(Node container, dynamic text, {bool exact = true, NormalizerFn normalizer([NormalizerOptions?])?}) → E? ByPlaceholderText Queries
Returns a single element with the given text as the value of the placeholder attribute, defaulting to an exact match.
queryByRole<E extends Element>(Node container, dynamic role, {bool exact = true, NormalizerFn normalizer([NormalizerOptions?])?, bool hidden = false, dynamic name, bool? selected, bool? checked, bool? pressed, bool? expanded, bool queryFallbacks = false, int? level}) → E? ByRole Queries
Returns a single element with the given role value, defaulting to an exact match.
queryByTestId<E extends Element>(Node container, dynamic testId, {bool exact = true, NormalizerFn normalizer([NormalizerOptions?])?}) → E? ByTestId Queries
Returns a single element with the given testId value for the data-test-id attribute, defaulting to an exact match.
queryByText<E extends Element>(Node container, dynamic text, {bool exact = true, NormalizerFn normalizer([NormalizerOptions?])?, String? selector, dynamic ignore = 'script'}) → E? ByText Queries
Returns a single element with the given text content, defaulting to an exact match.
queryByTitle<E extends Element>(Node container, dynamic title, {bool exact = true, NormalizerFn normalizer([NormalizerOptions?])?}) → E? ByTitle Queries
Returns a single element with the given title as the value of the title attribute, defaulting to an exact match.
within(Node node) WithinQueries Queries
Takes a DOM node and binds it to the raw query functions.

Typedefs

NormalizerFn = String Function(String)
The function signature for a custom normalizer argument in a query.