DsGoldenFileComparator class
Golden comparator of the members with design-system goldens. In a CI golden (a file under
ci/, the path of D-M4-04-5) a pixel differs only when one channel differs by more than
dsCiGoldenChannelTolerance, and the image passes while at most dsCiGoldenDiffThreshold
of its pixels differ; a platform golden must match exactly, as it is recorded and compared
on macOS only. A different size always fails.
Install it in test/flutter_test_config.dart and pass no diffThreshold to alchemist,
which then keeps this comparator (docs/DECISIONS.md PL/5).
goldenFileComparator = DsGoldenFileComparator(
(goldenFileComparator as LocalFileComparator).basedir.resolve('test.dart'));
- Inheritance
-
- Object
- GoldenFileComparator
- LocalFileComparator
- DsGoldenFileComparator
Constructors
- DsGoldenFileComparator(Uri testFile)
-
Compares against the golden files next to
testFile.
Properties
Methods
-
compare(
Uint8List imageBytes, Uri golden) → Future< bool> -
Compares the pixels of decoded png
imageBytesagainst the golden file identified bygolden.override -
generateFailureOutput(
ComparisonResult result, Uri golden, Uri basedir, {String key = ''}) → Future< String> -
Writes out diffs from the ComparisonResult of a golden file test.
inherited
-
getFailureFile(
String failure, Uri golden, Uri basedir) → File -
Returns the appropriate file for a given diff from a ComparisonResult.
inherited
-
getGoldenBytes(
Uri golden) → Future< List< int> > -
Returns the bytes of the given
goldenfile.inherited -
getTestUri(
Uri key, int? version) → Uri -
Returns a new golden file Uri to incorporate any
versionnumber with thekey.inherited -
noSuchMethod(
Invocation invocation) → dynamic -
Invoked when a nonexistent method or property is accessed.
inherited
-
toString(
) → String -
A string representation of this object.
inherited
-
update(
Uri golden, Uint8List imageBytes) → Future< void> -
Updates the golden file identified by
goldenwithimageBytes.inherited
Operators
-
operator ==(
Object other) → bool -
The equality operator.
inherited