alchemist
library
Classes
AlchemistConfig
A configuration object that contains settings used by Alchemist for
customizing the behavior of all golden tests.
BlockedTextCanvasAdapter
An adapter used to change how a canvas draws text
BlockedTextPaintingContext
A painting context used to replace all text blocks with colored rectangles.
CiGoldensConfig
The configuration for golden tests intended to be run in CI.
GoldensConfig
The configuration for golden tests.
GoldenTestGroup
A widget responsible for grouping test scenarios for use in golden tests.
GoldenTestScenario
A widget that displays its child with a label for use in golden tests.
GoldenTestTheme
A theme that dictates the behavior and appearance of elements created
by Alchemist during golden testing. This theme is used to ensure that
parts of golden tests controlled by Alchemist are consistent across
Flutter SDK versions.
HostPlatform
A class that represents a host platform that can run golden tests.
PlatformGoldensConfig
The configuration for human readable golden tests.
TestAssetBundle
An AssetBundle class used in golden testing.
Constants
defaultGoldenTestRunner
→ const FlutterGoldenTestRunner
Default golden test runner which uses the flutter test framework.
Functions
goldenTest (String description , {required String fileName , required ValueGetter <Widget > builder , bool skip = false , List <String > tags = const ['golden'] , double textScaleFactor = 1.0 , BoxConstraints constraints = const BoxConstraints() , PumpAction pumpBeforeTest = onlyPumpAndSettle , PumpWidget pumpWidget = onlyPumpWidget , Interaction ? whilePerforming })
→ Future <void >
Performs a Flutter widget test that compares against golden image.
loadFonts ()
→ Future <void >
Loads a font for use in golden tests.
longPress (Finder finder )
→ Interaction
Long-presses all widgets matching finder
.
onlyPumpAndSettle (WidgetTester tester )
→ Future <void >
A custom PumpAction that pumps and settles the widget tree before golden
evaluation.
onlyPumpWidget (WidgetTester tester , Widget widget )
→ Future <void >
A custom PumpWidget that pumps the widget tree before golden
evaluation, analogous to WidgetTester.pumpWidget .
precacheImages (WidgetTester tester )
→ Future <void >
A custom PumpAction to ensure that the images for all Image ,
FadeInImage , and DecoratedBox widgets are loaded before the golden file
is generated.
press (Finder finder , {Duration ? holdFor = const Duration(milliseconds: 300) })
→ Interaction
Presses all widgets matching finder
.
pumpNTimes (int n , [Duration ? duration ])
→ PumpAction
Returns a custom PumpAction that pumps the widget tree n
times before
golden evaluation.
scroll (Finder finder , {required Offset offset , double speed = kMinFlingVelocity })
→ Interaction
Scrolls all widgets matching finder
.