wildness_ui_golden_toolkit
library
Functions
-
addStateInfo(Map matchState, Map values)
→ void
-
Useful utility for nesting match states.
-
addTearDown(dynamic callback())
→ void
-
Registers a function to be run after the current test.
-
allOf(Object? arg0, [Object? arg1, Object? arg2, Object? arg3, Object? arg4, Object? arg5, Object? arg6])
→ Matcher
-
This returns a matcher that matches if all of the matchers passed as
arguments (up to 7) match.
-
anyElement(Object? valueOrMatcher)
→ Matcher
-
Returns a matcher which matches Iterables in which at least one
element matches the given
valueOrMatcher.
-
anyOf(Object? arg0, [Object? arg1, Object? arg2, Object? arg3, Object? arg4, Object? arg5, Object? arg6])
→ Matcher
-
Matches if any of the given matchers evaluate to true.
-
benchmarkWidgets(WidgetTesterCallback callback, {bool mayRunWithAsserts = false, bool semanticsEnabled = false})
→ Future<void>
-
Runs the
callback inside the Flutter benchmark environment.
-
captureImage(Element element)
→ Future<Image>
-
Render the closest RepaintBoundary of the
element into an image.
-
clipsWithBoundingRRect({required BorderRadius borderRadius})
→ Matcher
-
Asserts that a Finder locates a single object whose root RenderObject
is a RenderClipRRect with no clipper set, and border radius equals to
borderRadius, or an equivalent RenderClipPath.
-
clipsWithShapeBorder({required ShapeBorder shape})
→ Matcher
-
Asserts that a Finder locates a single object whose root RenderObject
is a RenderClipPath with a ShapeBorderClipper that clips to
shape.
-
closeTo(num value, num delta)
→ Matcher
-
Returns a matcher which matches if the match argument is within
delta
of some value.
-
collapseWhitespace(String string)
→ String
-
Utility function to collapse whitespace runs to single spaces
and strip leading/trailing whitespace.
-
collectAllElementsFrom(Element rootElement, {required bool skipOffstage})
→ Iterable<Element>
-
Provides an iterable that efficiently returns all the Elements
rooted at the given Element. See CachingIterable for details.
-
collectAllSemanticsNodesFrom(SemanticsNode root, {DebugSemanticsDumpOrder order = DebugSemanticsDumpOrder.traversalOrder})
→ Iterable<SemanticsNode>
-
Provides an iterable that efficiently returns all the SemanticsNodes
rooted at the given SemanticsNode. See CachingIterable for details.
-
compareLists(List<int>? test, List<int>? master)
→ Future<ComparisonResult>
-
Returns a ComparisonResult to describe the pixel differential of the
test and master image bytes provided.
-
completion(Object? matcher, [String? description])
→ Matcher
-
Matches a Future that completes successfully with a value that matches
matcher.
-
contains(Object? expected)
→ Matcher
-
Returns a matcher that matches if the match argument contains the expected
value.
-
containsAll(Iterable expected)
→ Matcher
-
Matches Iterables which contain an element matching every value in
expected in any order, and may contain additional values.
-
containsAllInOrder(Iterable expected)
→ Matcher
-
Matches Iterables which contain an element matching every value in
expected in the same order, but may contain additional values interleaved
throughout.
-
containsOnce(Object? expected)
→ Matcher
-
Matches Iterables where exactly one element matches the expected
value, and all other elements don't match.
-
containsPair(Object? key, Object? valueOrMatcher)
→ Matcher
-
Returns a matcher which matches maps containing the key-value pair
with
key => valueOrMatcher.
-
containsSemantics({String? identifier, String? label, AttributedString? attributedLabel, String? hint, AttributedString? attributedHint, String? value, AttributedString? attributedValue, String? increasedValue, AttributedString? attributedIncreasedValue, String? decreasedValue, AttributedString? attributedDecreasedValue, String? tooltip, TextDirection? textDirection, Rect? rect, Size? size, double? elevation, double? thickness, int? platformViewId, int? maxValueLength, int? currentValueLength, SemanticsValidationResult? validationResult, SemanticsInputType? inputType, bool? hasCheckedState, bool? isChecked, bool? isCheckStateMixed, bool? isSelected, bool? hasSelectedState, bool? isButton, bool? isSlider, bool? isKeyboardKey, bool? isLink, bool? isFocused, bool? isFocusable, bool? isTextField, bool? isReadOnly, bool? hasEnabledState, bool? isEnabled, bool? isInMutuallyExclusiveGroup, bool? isObscured, bool? isMultiline, bool? namesRoute, bool? scopesRoute, bool? isHidden, bool? isImage, bool? isLiveRegion, bool? hasToggledState, bool? isToggled, bool? hasImplicitScrolling, bool? hasExpandedState, bool? isExpanded, bool? hasRequiredState, bool? isRequired, bool? hasTapAction, bool? hasFocusAction, bool? hasLongPressAction, bool? hasScrollLeftAction, bool? hasScrollRightAction, bool? hasScrollUpAction, bool? hasScrollDownAction, bool? hasIncreaseAction, bool? hasDecreaseAction, bool? hasShowOnScreenAction, bool? hasMoveCursorForwardByCharacterAction, bool? hasMoveCursorBackwardByCharacterAction, bool? hasMoveCursorForwardByWordAction, bool? hasMoveCursorBackwardByWordAction, bool? hasSetTextAction, bool? hasSetSelectionAction, bool? hasCopyAction, bool? hasCutAction, bool? hasPasteAction, bool? hasDidGainAccessibilityFocusAction, bool? hasDidLoseAccessibilityFocusAction, bool? hasDismissAction, String? onTapHint, String? onLongPressHint, List<CustomSemanticsAction>? customActions, List<Matcher>? children})
→ Matcher
-
Asserts that a SemanticsNode contains the specified information.
-
containsValue(Object? value)
→ Matcher
-
Returns a matcher which matches maps containing the given
value.
-
Asserts that 2 paths cover the same area by sampling multiple points.
-
createTestImage({int width = 1, int height = 1, bool cache = true})
→ Future<Image>
-
Creates an arbitrarily sized image for testing.
-
defaultDeviceFileNameFactory(String name, Device device)
→ String
-
This is the default file name factory which is used by multiScreenGolden to determine the
actual file name for a golden test. The given
name is the name passed into multiScreenGolden.
-
defaultFileNameFactory(String name)
→ String
-
This is the default file name factory which is used by screenMatchesGolden to determine the
actual file name for a golden test. The given
name is the name passed into screenMatchesGolden.
-
defaultPrimeAssets(WidgetTester tester)
→ Future<void>
-
A function that waits for all Image widgets found in the widget tree to finish decoding.
-
doesNotMeetGuideline(AccessibilityGuideline guideline)
→ AsyncMatcher
-
The inverse matcher of meetsGuideline.
-
emits(Object? matcher)
→ StreamMatcher
-
Returns a StreamMatcher for
matcher.
-
emitsAnyOf(Iterable matchers)
→ StreamMatcher
-
Returns a StreamMatcher that matches the stream if at least one of
matchers matches.
-
emitsError(Object? matcher)
→ StreamMatcher
-
Returns a StreamMatcher that matches a single error event that matches
matcher.
-
emitsInAnyOrder(Iterable matchers)
→ StreamMatcher
-
Returns a StreamMatcher that matches the stream if each matcher in
matchers matches, in any order.
-
emitsInOrder(Iterable matchers)
→ StreamMatcher
-
Returns a StreamMatcher that matches the stream if each matcher in
matchers matches, one after another.
-
emitsThrough(Object? matcher)
→ StreamMatcher
-
Returns a StreamMatcher that matches any number of events followed by
events that match
matcher.
-
endsWith(String suffixString)
→ Matcher
-
Returns a matcher that matches if the match argument is a string and
ends with
suffixString.
-
equals(Object? expected, [int limit = 100])
→ Matcher
-
Returns a matcher that matches if the value is structurally equal to
expected.
-
equalsIgnoringCase(String value)
→ Matcher
-
Returns a matcher which matches if the match argument is a string and
is equal to
value when compared case-insensitively.
-
equalsIgnoringHashCodes(Object value)
→ Matcher
-
Asserts that two Strings or
Iterable<String>s are equal after
normalizing likely hash codes.
-
equalsIgnoringWhitespace(String value)
→ Matcher
-
Returns a matcher which matches if the match argument is a string and
is equal to
value, ignoring whitespace.
-
escape(String str)
→ String
-
Returns
str with all whitespace characters represented as their escape
sequences.
-
everyElement(Object? valueOrMatcher)
→ Matcher
-
Returns a matcher which matches Iterables in which all elements
match the given
valueOrMatcher.
-
expect(dynamic actual, dynamic matcher, {String? reason, dynamic skip})
→ void
-
Assert that
actual matches matcher.
-
expectAsync(Function callback, {int count = 1, int max = 0, String? id, String? reason})
→ Function
-
This function is deprecated because it doesn't work well with strong mode.
Use expectAsync0, expectAsync1,
expectAsync2, expectAsync3, expectAsync4, expectAsync5, or
expectAsync6 instead.
-
expectAsync0<T>(T callback(), {int count = 1, int max = 0, String? id, String? reason})
→ Func0<T>
-
Informs the framework that the given
callback of arity 0 is expected to be
called count number of times (by default 1).
-
expectAsync1<T, A>(T callback(A), {int count = 1, int max = 0, String? id, String? reason})
→ Func1<T, A>
-
Informs the framework that the given
callback of arity 1 is expected to be
called count number of times (by default 1).
-
expectAsync2<T, A, B>(T callback(A, B), {int count = 1, int max = 0, String? id, String? reason})
→ Func2<T, A, B>
-
Informs the framework that the given
callback of arity 2 is expected to be
called count number of times (by default 1).
-
expectAsync3<T, A, B, C>(T callback(A, B, C), {int count = 1, int max = 0, String? id, String? reason})
→ Func3<T, A, B, C>
-
Informs the framework that the given
callback of arity 3 is expected to be
called count number of times (by default 1).
-
expectAsync4<T, A, B, C, D>(T callback(A, B, C, D), {int count = 1, int max = 0, String? id, String? reason})
→ Func4<T, A, B, C, D>
-
Informs the framework that the given
callback of arity 4 is expected to be
called count number of times (by default 1).
-
expectAsync5<T, A, B, C, D, E>(T callback(A, B, C, D, E), {int count = 1, int max = 0, String? id, String? reason})
→ Func5<T, A, B, C, D, E>
-
Informs the framework that the given
callback of arity 5 is expected to be
called count number of times (by default 1).
-
expectAsync6<T, A, B, C, D, E, F>(T callback(A, B, C, D, E, F), {int count = 1, int max = 0, String? id, String? reason})
→ Func6<T, A, B, C, D, E, F>
-
Informs the framework that the given
callback of arity 6 is expected to be
called count number of times (by default 1).
-
expectAsyncUntil0<T>(T callback(), bool isDone(), {String? id, String? reason})
→ Func0<T>
-
Informs the framework that the given
callback of arity 0 is expected to be
called until isDone returns true.
-
expectAsyncUntil1<T, A>(T callback(A), bool isDone(), {String? id, String? reason})
→ Func1<T, A>
-
Informs the framework that the given
callback of arity 1 is expected to be
called until isDone returns true.
-
expectAsyncUntil2<T, A, B>(T callback(A, B), bool isDone(), {String? id, String? reason})
→ Func2<T, A, B>
-
Informs the framework that the given
callback of arity 2 is expected to be
called until isDone returns true.
-
expectAsyncUntil3<T, A, B, C>(T callback(A, B, C), bool isDone(), {String? id, String? reason})
→ Func3<T, A, B, C>
-
Informs the framework that the given
callback of arity 3 is expected to be
called until isDone returns true.
-
expectAsyncUntil4<T, A, B, C, D>(T callback(A, B, C, D), bool isDone(), {String? id, String? reason})
→ Func4<T, A, B, C, D>
-
Informs the framework that the given
callback of arity 4 is expected to be
called until isDone returns true.
-
expectAsyncUntil5<T, A, B, C, D, E>(T callback(A, B, C, D, E), bool isDone(), {String? id, String? reason})
→ Func5<T, A, B, C, D, E>
-
Informs the framework that the given
callback of arity 5 is expected to be
called until isDone returns true.
-
expectAsyncUntil6<T, A, B, C, D, E, F>(T callback(A, B, C, D, E, F), bool isDone(), {String? id, String? reason})
→ Func6<T, A, B, C, D, E, F>
-
Informs the framework that the given
callback of arity 6 is expected to be
called until isDone returns true.
-
expectLater(dynamic actual, dynamic matcher, {String? reason, dynamic skip})
→ Future<void>
-
Just like expect, but returns a Future that completes when the matcher
has finished matching.
-
expectSync(dynamic actual, dynamic matcher, {String? reason})
→ void
-
Assert that
actual matches matcher.
-
fail(String message)
→ Never
-
Convenience method for throwing a new TestFailure with the provided
message.
-
findsAtLeast(int n)
→ Matcher
-
Asserts that the FinderBase locates at least the given number of candidates.
-
findsAtLeastNWidgets(int n)
→ Matcher
-
Asserts that the FinderBase locates at least a number of widgets in the widget tree.
-
findsExactly(int n)
→ Matcher
-
Asserts that the FinderBase locates the specified number of candidates.
-
findsNWidgets(int n)
→ Matcher
-
Asserts that the FinderBase locates the specified number of widgets in the widget tree.
-
greaterThan(Object value)
→ Matcher
-
Returns a matcher which matches if the match argument is greater
than the given
value.
-
greaterThanOrEqualTo(Object value)
→ Matcher
-
Returns a matcher which matches if the match argument is greater
than or equal to the given
value.
-
group(Object description, void body(), {dynamic skip, int? retry})
→ void
-
Creates a group of tests.
-
hasLength(Object? matcher)
→ Matcher
-
Returns a matcher that matches if an object has a length property
that matches
matcher.
-
inClosedOpenRange(num low, num high)
→ Matcher
-
Returns a matcher which matches if the match argument is greater
than or equal to a
low and less than high.
-
inExclusiveRange(num low, num high)
→ Matcher
-
Returns a matcher which matches if the match argument is greater
than
low and less than high.
-
inInclusiveRange(num low, num high)
→ Matcher
-
Returns a matcher which matches if the match argument is greater
than or equal to
low and less than or equal to high.
-
inOpenClosedRange(num low, num high)
→ Matcher
-
Returns a matcher which matches if the match argument is greater
than
low and less than or equal to high.
-
isA<T>()
→ TypeMatcher<T>
-
Returns a matcher that matches objects with type
T.
-
isIn(Object? expected)
→ Matcher
-
Returns a matcher that matches if the match argument is in
the expected value. This is the converse of contains.
-
isInstanceOf<T>()
→ TypeMatcher<T>
-
A matcher that compares the type of the actual value to the type argument T.
-
isMethodCall(String name, {required dynamic arguments})
→ Matcher
-
A matcher for MethodCalls, asserting that it has the specified
method
name and arguments.
-
isNot(Object? valueOrMatcher)
→ Matcher
-
Returns a matcher that inverts
valueOrMatcher to its logical negation.
-
isPathThat({Iterable<Offset> includes = const <Offset>[], Iterable<Offset> excludes = const <Offset>[]})
→ Matcher
-
Matches a Path that contains (as defined by Path.contains) the given
includes points and does not contain the given excludes points.
-
isSameColorAs(Color color, {double threshold = colorEpsilon})
→ Matcher
-
Asserts that the object represents the same color as
color when used to paint.
-
isSameColorSwatchAs<T>(ColorSwatch<T> color, {double threshold = colorEpsilon})
→ Matcher
-
Asserts that the object represents the same color swatch as
color when
used to paint.
-
isSystemTextScaler({double? withScaleFactor})
→ Matcher
-
Asserts that the object is a TextScaler that reflects the user's font
scale preferences from the platform's accessibility settings.
-
legacyPrimeAssets(WidgetTester tester)
→ Future<void>
-
A function that primes all assets by just wasting time and hoping that it is enough for all assets to
finish loading. Doing so is not recommended and very flaky. Consider switching to defaultPrimeAssets or
a custom implementation.
-
lessThan(Object value)
→ Matcher
-
Returns a matcher which matches if the match argument is less
than the given
value.
-
lessThanOrEqualTo(Object value)
→ Matcher
-
Returns a matcher which matches if the match argument is less
than or equal to the given
value.
-
loadAppFonts()
→ Future<void>
-
By default, flutter test only uses a single "test" font called Ahem.
-
markTestSkipped(String message)
→ void
-
Marks the current test as skipped.
-
matches(Pattern re)
→ Matcher
-
Returns a matcher that matches if the match argument is a string and
matches the regular expression given by
re.
-
matchesGoldenFile(Object key, {int? version})
→ AsyncMatcher
-
Asserts that a Finder, Future<ui.Image>, or ui.Image matches the
golden image file identified by
key, with an optional version number.
-
matchesReferenceImage(Image image)
→ AsyncMatcher
-
Asserts that a Finder, Future<ui.Image>, or ui.Image matches a
reference image identified by
image.
-
matchesSemantics({String? identifier, String? label, AttributedString? attributedLabel, String? hint, AttributedString? attributedHint, String? value, AttributedString? attributedValue, String? increasedValue, AttributedString? attributedIncreasedValue, String? decreasedValue, AttributedString? attributedDecreasedValue, String? tooltip, TextDirection? textDirection, Rect? rect, Size? size, double? elevation, double? thickness, int? platformViewId, int? maxValueLength, int? currentValueLength, SemanticsValidationResult validationResult = SemanticsValidationResult.none, SemanticsInputType? inputType, bool hasCheckedState = false, bool isChecked = false, bool isCheckStateMixed = false, bool isSelected = false, bool hasSelectedState = false, bool isButton = false, bool isSlider = false, bool isKeyboardKey = false, bool isLink = false, bool isFocused = false, bool isFocusable = false, bool isTextField = false, bool isReadOnly = false, bool hasEnabledState = false, bool isEnabled = false, bool isInMutuallyExclusiveGroup = false, bool isObscured = false, bool isMultiline = false, bool namesRoute = false, bool scopesRoute = false, bool isHidden = false, bool isImage = false, bool isLiveRegion = false, bool hasToggledState = false, bool isToggled = false, bool hasImplicitScrolling = false, bool hasExpandedState = false, bool isExpanded = false, bool hasRequiredState = false, bool isRequired = false, bool hasTapAction = false, bool hasFocusAction = false, bool hasLongPressAction = false, bool hasScrollLeftAction = false, bool hasScrollRightAction = false, bool hasScrollUpAction = false, bool hasScrollDownAction = false, bool hasIncreaseAction = false, bool hasDecreaseAction = false, bool hasShowOnScreenAction = false, bool hasMoveCursorForwardByCharacterAction = false, bool hasMoveCursorBackwardByCharacterAction = false, bool hasMoveCursorForwardByWordAction = false, bool hasMoveCursorBackwardByWordAction = false, bool hasSetTextAction = false, bool hasSetSelectionAction = false, bool hasCopyAction = false, bool hasCutAction = false, bool hasPasteAction = false, bool hasDidGainAccessibilityFocusAction = false, bool hasDidLoseAccessibilityFocusAction = false, bool hasDismissAction = false, String? onTapHint, String? onLongPressHint, List<CustomSemanticsAction>? customActions, List<Matcher>? children})
→ Matcher
-
Asserts that a SemanticsNode contains the specified information.
-
materialAppWrapper({TargetPlatform platform = TargetPlatform.android, Iterable<LocalizationsDelegate>? localizations, NavigatorObserver? navigatorObserver, Iterable<Locale>? localeOverrides, ThemeData? theme})
→ WidgetWrapper
-
This materialAppWrapper is a convenience function to wrap your widget in MaterialApp
Wraps your widget in MaterialApp, inject custom theme, localizations, override surfaceSize and platform
-
matrix3MoreOrLessEquals(Matrix3 value, {double epsilon = precisionErrorTolerance})
→ Matcher
-
Asserts that two
Matrix3s are equal, within some tolerated error.
-
matrixMoreOrLessEquals(Matrix4 value, {double epsilon = precisionErrorTolerance})
→ Matcher
-
Asserts that two Matrix4s are equal, within some tolerated error.
-
mayEmit(Object? matcher)
→ StreamMatcher
-
Returns a StreamMatcher that allows (but doesn't require)
matcher to
match the stream.
-
mayEmitMultiple(Object? matcher)
→ StreamMatcher
-
Returns a StreamMatcher that matches any number of events that match
matcher.
-
meetsGuideline(AccessibilityGuideline guideline)
→ AsyncMatcher
-
Asserts that the currently rendered widget meets the provided accessibility
guideline.
-
moreOrLessEquals(double value, {double epsilon = precisionErrorTolerance})
→ Matcher
-
Asserts that two doubles are equal, within some tolerated error.
-
multiScreenGolden(WidgetTester tester, String name, {Finder? finder, bool? autoHeight, double? overrideGoldenHeight, CustomPump? customPump, DeviceSetup? deviceSetup, List<Device>? devices, bool? skip})
→ Future<void>
-
This multiScreenGolden will run
scenarios for given devices list
-
neverEmits(Object? matcher)
→ StreamMatcher
-
Returns a StreamMatcher that matches a stream that never matches
matcher.
-
nonconst<T>(T t)
→ T
-
This function can be used to call a const constructor in such a way as to
create a new instance rather than creating the common const instance.
-
noWrap()
→ WidgetWrapper
-
This noWrap is a convenience function if you don't want to wrap widgets in default materialAppWrapper
-
offsetMoreOrLessEquals(Offset value, {double epsilon = precisionErrorTolerance})
→ Matcher
-
Asserts that two Offsets are equal, within some tolerated error.
-
orderedEquals(Iterable expected)
→ Matcher
-
Returns a matcher which matches Iterables that have the same
length and the same elements as
expected, in the same order.
-
paintsExactlyCountTimes(Symbol methodName, int count)
→ Matcher
-
Matches objects or functions that draw
methodName exactly count number
of times.
-
pairwiseCompare<S, T>(Iterable<S> expected, bool comparator(S, T), String description)
→ Matcher
-
A pairwise matcher for Iterables.
-
predicate<T>(bool f(T), [String description = 'satisfies function'])
→ Matcher
-
Returns a matcher that uses an arbitrary function that returns whether the
value is considered a match.
-
printOnFailure(String message)
→ void
-
Prints
message if and when the current test fails.
-
prints(Object? matcher)
→ Matcher
-
Matches a Function that prints text that matches
matcher.
-
pumpEventQueue({int times = 20})
→ Future
-
Returns a Future that completes after the event loop has run the given
number of
times (20 by default).
-
rectMoreOrLessEquals(Rect value, {double epsilon = precisionErrorTolerance})
→ Matcher
-
Asserts that two Rects are equal, within some tolerated error.
-
registerException(Object error, [StackTrace stackTrace = StackTrace.empty])
→ void
-
Registers an exception that was caught for the current test.
-
rendersOnPhysicalModel({BoxShape? shape, BorderRadius? borderRadius, double? elevation})
→ Matcher
-
Asserts that a Finder locates a single object whose root RenderObject
is a RenderPhysicalModel or a RenderPhysicalShape.
-
rendersOnPhysicalShape({required ShapeBorder shape, double? elevation})
→ Matcher
-
Asserts that a Finder locates a single object whose root RenderObject
is RenderPhysicalShape that uses a ShapeBorderClipper that clips to
shape as its clipper.
If elevation is non null asserts that RenderPhysicalShape.elevation is
equal to elevation.
-
reportExpectCall(StackTrace stack, List<DiagnosticsNode> information)
→ int
-
Report call site for
expect() call. Returns the number of frames that
should be elided if a stack were to be modified to hide the expect call, or
zero if no such call was found.
-
runWithConfiguration(Future<void> testMain())
→ Future<void>
-
create a
flutter_test_config.dart
and set testExecutable function for add default config
-
same(Object? expected)
→ Matcher
-
Returns a matches that matches if the value is the same instance
as
expected, using identical.
-
screenMatchesGolden(WidgetTester tester, String name, {bool? autoHeight, Finder? finder, CustomPump? customPump, bool? skip})
→ Future<void>
-
A function that wraps matchesGoldenFile with some extra functionality. The function finds the first widget
in the tree if
finder is not specified. Furthermore a fileNameFactory can be used in combination with a name
to specify a custom path and name for the golden file. In addition to that the function makes sure all images are
available before
-
setUp(dynamic body())
→ void
-
Registers a function to be run before tests.
-
setUpAll(dynamic body())
→ void
-
Registers a function to be run once before all tests.
-
simulateKeyDownEvent(LogicalKeyboardKey key, {String? platform, PhysicalKeyboardKey? physicalKey, String? character})
→ Future<bool>
-
Simulates sending a hardware key down event through the system channel.
-
simulateKeyRepeatEvent(LogicalKeyboardKey key, {String? platform, PhysicalKeyboardKey? physicalKey, String? character})
→ Future<bool>
-
Simulates sending a hardware key repeat event through the system channel.
-
simulateKeyUpEvent(LogicalKeyboardKey key, {String? platform, PhysicalKeyboardKey? physicalKey})
→ Future<bool>
-
Simulates sending a hardware key up event through the system channel.
-
spawnHybridCode(String dartCode, {Object? message, bool stayAlive = false})
→ StreamChannel
-
Spawns a VM isolate that runs the given
dartCode, which is loaded as the
contents of a Dart library.
-
spawnHybridUri(Object uri, {Object? message, bool stayAlive = false})
→ StreamChannel
-
Spawns a VM isolate for the given
uri, which may be a Uri or a String.
-
startsWith(String prefixString)
→ Matcher
-
Returns a matcher that matches if the match argument is a string and
starts with
prefixString.
-
stringContainsInOrder(List<String> substrings)
→ Matcher
-
Returns a matcher that matches if the match argument is a string and
contains a given list of
substrings in relative order.
-
tearDown(dynamic body())
→ void
-
Registers a function to be run after tests.
-
tearDownAll(dynamic body())
→ void
-
Registers a function to be run once after all tests.
-
test(Object description, dynamic body(), {String? testOn, Timeout? timeout, dynamic skip, dynamic tags, Map<String, dynamic>? onPlatform, int? retry})
→ void
-
Creates a new test case with the given description (converted to a string)
and body.
-
testColumnComponent({required String name, required List<Component> scenarios, String? groupName, Future<TestGesture?> gestureBuilder(WidgetTester tester)?, List<Device>? devices, Size surfaceSize = const Size(800, 740), Key? touchKey, Widget wrap(Widget child)?, bool? autoHeight = true, double? textScaleSize, Iterable<LocalizationsDelegate>? localizationsDelegates, Iterable<Locale>? supportedLocales, WildnessProperties? config, TextStyle? defaultTextStyle, Color? primaryColor})
→ void
-
-
testDeviceComponent({required String name, required List<Component> scenarios, String? groupName, Future<TestGesture?> gestureBuilder(WidgetTester tester)?, List<Device>? devices, Size surfaceSize = const Size(800, 740), Key? touchKey, Widget wrap(Widget child)?, bool? autoHeight = true, double? textScaleSize, Iterable<LocalizationsDelegate>? localizationsDelegates, Iterable<Locale>? supportedLocales, WildnessProperties? config, TextStyle? defaultTextStyle, Color? primaryColor})
→ void
-
-
testGoldens(String description, Future<void> test(WidgetTester), {bool? skip, Object? tags = _defaultTagObject})
→ void
-
This testGoldens method exists as a way to enforce the proper naming of tests that contain golden diffs so that we can reliably run all goldens
-
testWidgets(String description, WidgetTesterCallback callback, {bool? skip, Timeout? timeout, bool semanticsEnabled = true, TestVariant<Object?> variant = const DefaultTestVariant(), dynamic tags, int? retry, LeakTesting? experimentalLeakTesting})
→ void
-
Runs the
callback inside the Flutter test environment.
-
throwsA(Object? matcher)
→ Matcher
-
This can be used to match three kinds of objects:
-
unorderedEquals(Iterable expected)
→ Matcher
-
Returns a matcher which matches Iterables that have the same length and
the same elements as
expected, but not necessarily in the same order.
-
unorderedMatches(Iterable expected)
→ Matcher
-
Returns a matcher which matches Iterables whose elements match the
matchers in
expected, but not necessarily in the same order.
-
wildnessApp({required Widget child, Iterable<LocalizationsDelegate>? localizationsDelegates, Iterable<Locale>? supportedLocales, WildnessProperties? config, TextStyle? defaultTextStyle, Color? primaryColor})
→ WildnessApp
-
-
wildnessWidgetWrapper({Iterable<LocalizationsDelegate>? localizationsDelegates, Iterable<Locale>? supportedLocales, WildnessProperties? config, TextStyle? defaultTextStyle, Color? primaryColor = const Color.fromARGB(255, 3, 85, 3)})
→ WidgetWrapper
-
This
wildnessAppWrapper is a convenience function to wrap your widget in wildnessApp
Wraps your widget in MaterialApp, inject custom theme, localizations, override surfaceSize and platform
-
within<T>({required num distance, required T from, DistanceFunction<T>? distanceFunction})
→ Matcher
-
Asserts that two values are within a certain distance from each other.
-
wrapMatcher(Object? valueOrMatcher)
→ Matcher
-
Takes an argument and returns an equivalent Matcher.
Typedefs
-
AllMessagesHandler
= Future<ByteData?>? Function(String channel, MessageHandler? handler, ByteData? message)
-
A function which takes the name of the method channel, it's handler,
platform message and asynchronously returns an encoded response.
-
AnyDistanceFunction
= num Function(Never a, Never b)
-
The type of a union of instances of DistanceFunction<T> for various types
T.
-
CustomPump
= Future<void> Function(WidgetTester)
-
CustomPump is a function that lets you do custom pumping before golden evaluation.
Sometimes, you want to do a golden test for different stages of animations, so its crucial to have a precise control over pumps and durations
-
DescribeMatchCallback
= String Function(Plurality plurality)
-
Signature for FinderBase.describeMatch.
-
DeviceFileNameFactory
= String Function(String name, Device device)
-
A factory to determine a file name/path from a name and a device.
-
DeviceSetup
= Future<void> Function(Device device, WidgetTester tester)
-
Function definition for allowing for device or test setup to occur for each device configuration under test
-
DistanceFunction<T>
= num Function(T a, T b)
-
Computes the distance between two values.
-
ElementPredicate
= bool Function(Element element)
-
Signature for CommonFinders.byElementPredicate.
-
ErrorFormatter
= String Function(Object? actual, Matcher matcher, String? reason, Map matchState, bool verbose)
-
The type used for functions that can be used to build up error reports
upon failures in
expect.
-
EventDispatcher
= Future<void> Function(PointerEvent event)
-
Signature for a callback that can dispatch events and returns a future that
completes when the event dispatch is complete.
-
FileNameFactory
= String Function(String name)
-
A factory to determine an actual file name/path from a given name.
-
Func0<T>
= T Function()
-
-
Func1<T, A>
= T Function([A a])
-
-
Func2<T, A, B>
= T Function([A a, B b])
-
-
Func3<T, A, B, C>
= T Function([A a, B b, C c])
-
-
Func4<T, A, B, C, D>
= T Function([A a, B b, C c, D d])
-
-
Func5<T, A, B, C, D, E>
= T Function([A a, B b, C c, D d, E e])
-
-
Func6<T, A, B, C, D, E, F>
= T Function([A a, B b, C c, D d, E e, F f])
-
-
HitTester
= HitTestResult Function(Offset location)
-
Signature for callbacks that perform hit-testing at a given location.
-
MockStreamHandlerOnCancelCallback
= void Function(Object? arguments)
-
Typedef for the inline onCancel callback.
-
MockStreamHandlerOnListenCallback
= void Function(Object? arguments, MockStreamHandlerEventSink events)
-
Typedef for the inline onListen callback.
-
OnScenarioCreate
= Future<void> Function(Key scenarioWidgetKey)
-
Hook for running arbitrary behavior for a particular scenario
-
PaintPatternPredicate
= bool Function(Symbol methodName, List arguments)
-
Signature for the PaintPattern.something and PaintPattern.everything
predicate argument.
-
PrimeAssets
= Future<void> Function(WidgetTester tester)
-
A function that primes all needed assets for the given
tester.
-
SemanticsNodePredicate
= bool Function(SemanticsNode node)
-
Signature for CommonSemanticsFinders.byPredicate.
-
SkipGoldenAssertion
= bool Function()
-
A func that will be evaluated at runtime to determine if the golden assertion should be skipped
-
TestExceptionReporter
= void Function(FlutterErrorDetails details, String testDescription)
-
Signature for the reportTestException callback.
-
WidgetPredicate
= bool Function(Widget widget)
-
Signature for CommonFinders.byWidgetPredicate.
-
WidgetTesterCallback
= Future<void> Function(WidgetTester widgetTester)
-
Signature for callback to testWidgets and benchmarkWidgets.
-
WidgetWrapper
= Widget Function(Widget)
-
Typedef for wrapping a widget with one or more other widgets
Exceptions / Errors
-
TestFailure
-
An exception thrown when a test assertion fails.