rad_test library

Testing library for Rad, built on top of package:test.

Classes

TestStack
Test Stack.
TestWindow
Browser's window mock.
WidgetTester
Class that programmatically interacts with widgets and the test environment.

Constants

areWatchfulMounted → const Matcher
Asserts that list of widgets(only that has watchful render elements) are mounted.
areWatchfulNotMounted → const Matcher
Asserts that list of widgets(only that has watchful render elements) are not mounted.
domNodeHasFocus → const Matcher
Asserts that node has focus.
domNodeHasNotFocus → const Matcher
Asserts that node doesn't have focus.
findsNothing → const Matcher
Asserts that the Finder matches no widgets in the widget tree.
findsOneWidget → const Matcher
Asserts that the Finder locates at exactly one widget in the widget tree.
findsWidgets → const Matcher
Asserts that the Finder locates at least one widget in the widget tree.
hasAGoodToStringDeep → const Matcher
Asserts that an object's toStringDeep() is a plausible multiline description.
hasOneLineDescription → const Matcher
Asserts that an object's toString() is a plausible one-line description.
isWatchfulMounted → const Matcher
Asserts that a watchful render element is mounted.
isWatchfulNotMounted → const Matcher
Asserts that a watchful render element is not mounted.

Functions

domNodeHasContents(String contents) → Matcher
Asserts that textual contents of a dom's node are equals to contents.
domNodeHasValue(String value) → Matcher
Asserts that node.value of a input/textarea node is equals to value.
findsNWidgets(int n) → Matcher
Asserts that the Finder locates the specified number of widgets in the widget tree.
testWidgets(String description, WidgetTesterCallback callback, {DebugOptions? debugOptions, RouterOptions? routerOptions, bool? useWindowMock, bool? skip}) → void
Runs the callback inside the Rad test environment.

Typedefs

RenderElementPredicate = bool Function(RenderElement element)
Signature for CommonFinders.byRenderElementPredicate.
WidgetPredicate = bool Function(Widget widget)
Signature for CommonFinders.byWidgetPredicate.
WidgetTesterCallback = FutureOr<void> Function(WidgetTester widgetTester)
Signature for callback to testWidgets.