widgetbook_golden_test library

Classes

GoldenPlayAction
Represents a single play action to be performed during a golden test.
WidgetbookGoldenTestBuilder
A builder widget that wraps a child widget and provides additional functionality for golden tests generated by widgetbook_golden_test.
WidgetbookGoldenTestsProperties
Properties for configuring widgetbook golden tests.

Functions

createGoldenTest(WidgetbookUseCase useCase, String goldenSnapshotsOutputPath, WidgetbookGoldenTestsProperties properties) → void
Creates and runs a golden test of the given Widgetbook useCase. The golden snapshot is saved in goldenSnapshotsOutputPath
handleError(FlutterErrorDetails details, WidgetbookGoldenTestsProperties properties, dynamic previousOnError(FlutterErrorDetails)?) → void
runWidgetbookGoldenTests({required List<WidgetbookNode> nodes, required WidgetbookGoldenTestsProperties properties, String goldenSnapshotsOutputPath = "."}) → void
Recursively generates golden tests for all WidgetbookUseCases inside the provided nodes.
validatePlayFunction(WidgetTester widgetTester, WidgetbookGoldenTestsProperties properties, WidgetbookUseCase useCase, GoldenPlayAction play, Widget widgetToTest, String goldenSnapshotsOutputPath) Future<void>

Typedefs

NetworkImageResolver = List<int> Function(Uri uri)
WidgetFinderCallback = Finder Function(CommonFinders find)
A finder callback to locate a widget for a golden snapshot.
WidgetPlayCallback = Future<void> Function(WidgetTester tester, CommonFinders find)
A callback function to execute a play action.