FirebaseStorageTestStore class
Test Store for the Automated Testing Framework that can read and write tests to Firebase Storage.
Constructors
- FirebaseStorageTestStore({String? imagePath, int maxDataSize = 50 * 1024 * 1024, String? reportCollectionPath, required FirebaseStorage storage, String? testCollectionPath})
-
Initializes the test store. This requires the
FirebaseStorage
to be assigned and initialized.
Properties
- hashCode → int
-
The hash code for this object.
no setterinherited
- imagePath → String?
-
Optional path for screenshots to be uploated to within Firebase Storage.
If storage is null or if this is on the web platform, this value is
ignored.
final
- maxDataSize → int
-
The maximum size for data. Due to Android's unit, ensure this remains
less than a signed 32 bit max value or else it will crash on Android.
final
- reportCollectionPath → String?
-
Optional collection path to store test reports. If omitted, this defaults
to 'reports'. Provided to allow for a single Firebase instance the
ability to host multiple applications or environments.
final
- runtimeType → Type
-
A representation of the runtime type of the object.
no setterinherited
- storage → FirebaseStorage
-
Optional
FirebaseStorage
reference object. If set, and the platform is not web, then this will be used to upload screenshot results from test reports. If omitted, screenshots will not be uploaded anywhere and will be lost if this test store is used for test reports.final - testCollectionPath → String?
-
Optional collection path to store test data. If omitted, this defaults
to 'tests'. Provided to allow for a single Firebase instance the ability
to host multiple applications or environments.
final
Methods
-
downloadImage(
String? hash) → Future< Uint8List?> -
Downloads an image with the given
hash
from Cloud Firestore. Will returnnull
if thehash
isnull
. Will throw an exception ifhash
is notnull
but could not be retrieved. -
downloadTextFile(
List< String> children) → Future<String> -
Downloads a text file from Cloud Firestore. If the text file was encoded
via GZIP, this will first decode it and then return the string. The
children
must contain one or more path elements to the location of the text file. -
goldenImageWriter(
TestReport report) → Future< void> -
Writes the golden images from the
report
to Cloud Storage and also writes the metadata that allows the reading of the golden images. This will throw an exception on failure. -
noSuchMethod(
Invocation invocation) → dynamic -
Invoked when a nonexistent method or property is accessed.
inherited
-
testImageReader(
{required TestDeviceInfo deviceInfo, required String imageId, String? suiteName, required String testName, int? testVersion}) → Future< Uint8List?> - Reader to read a golden image from Cloud Storage.
-
testReader(
BuildContext? context, {String? suiteName}) → Future< List< PendingTest> > -
Implementation of the
TestReader
functional interface that can read test data from Firebase Realtime Database. -
testReporter(
TestReport report) → Future< bool> -
Implementation of the
TestReport
functional interface that can submit test reports to Firebase Realtime Database. -
testWriter(
BuildContext context, Test test) → Future< bool> -
Implementation of the
TestWriter
functional interface that can submit test data to Firebase Realtime Database. -
toString(
) → String -
A string representation of this object.
inherited
-
uploadImages(
TestReport report, {bool goldenOnly = false}) → Future< void> -
Uploads the images from the given
report
. IfgoldenOnly
istrue
then only the images marked as golden compatible will be uploaded. -
uploadTextFile(
List< String?> children, String data, {bool gzipData = true}) → Future<void> -
Uploads a text file to Cloud Firestore. If the
gzipData
is set totrue
then the data will be encoded via GZIP before transmission and the encoding will be set to 'gzip', otherwise the data will be sent with vanilla UTF8 encoding and the encoding will be set to 'utf8'.
Operators
-
operator ==(
Object other) → bool -
The equality operator.
inherited