golden_toolkit library


Copyright 2019-2020 eBay Inc.

Use of this source code is governed by a BSD-style license that can be found in the LICENSE file or at https://opensource.org/licenses/BSD-3-Clause


Classes

Device
This Device is a configuration for golden test. Can be provided for multiScreenGolden
GoldenBuilder
GoldenBuilder builds column/grid layout for it's children

Extensions

TestingToolsExtension
Extensions for a WidgetTester

Constants

textScaleFactorMaxSupported → const double
as of iOS 13.2.3 the max textScaleFactor a user can set is ~3.1176
3.2

Functions

loadAppFonts() Future<void>
By default, flutter test only uses a single "test" font called Ahem. [...]
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 [...]
multiScreenGolden(WidgetTester tester, String goldenFileName, {Finder finder, double overrideGoldenHeight, CustomPump customPump: _onlyPumpAndSettle, DeviceSetup deviceSetup: _twoPumps, List<Device> devices: const [Device.phone, Device.tabletLandscape], bool skip: false}) Future<void>
This multiScreenGolden will run scenarios for given devices list [...]
noWrap() WidgetWrapper
This noWrap is a convenience function if you don't want to wrap widgets in default materialAppWrapper
screenMatchesGolden(WidgetTester tester, String goldenFileName, {Finder finder, CustomPump customPump: _onlyPumpAndSettle, bool skip: false}) Future<void>
This screenMatchesGolden is wrapper on top of matchesGoldenFile [...]
testGoldens(String description, Future<void> test(WidgetTester), {bool skip: false}) → 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 [...]
@isTestGroup

Typedefs

CustomPump(WidgetTester) Future<void>
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
DeviceSetup(Device device, WidgetTester tester) Future<void>
WidgetWrapper(Widget) Widget