LocalFileComparatorWithThreshold class
Source : https://blog.rows.com/p/writing-a-localfilecomparator-with?s=r Works just like LocalFileComparator but includes a threshold that, when exceeded, marks the test as a failure.
- Inheritance
-
- Object
- GoldenFileComparator
- LocalFileComparator
- LocalFileComparatorWithThreshold
Constructors
- LocalFileComparatorWithThreshold(Uri testFile, double threshold)
Properties
- basedir → Uri
-
The directory in which the test was loaded.
finalinherited
- hashCode → int
-
The hash code for this object.
no setterinherited
- runtimeType → Type
-
A representation of the runtime type of the object.
no setterinherited
- threshold → double
-
Threshold above which tests will be marked as failing.
Ranges from 0 to 1, both inclusive.
final
Methods
-
compare(
Uint8List imageBytes, Uri golden) → Future< bool> -
Copy of LocalFileComparator's compare method, except for the fact that
it checks if the ComparisonResult.diffPercent is not greater than
threshold to decide whether this test is successful or a failure.
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
golden
file.inherited -
getTestUri(
Uri key, int? version) → Uri -
Returns a new golden file Uri to incorporate any
version
number 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
golden
withimageBytes
.inherited
Operators
-
operator ==(
Object other) → bool -
The equality operator.
inherited