execute method
Future<void>
execute({
- required CancelToken cancelToken,
- required TestReport report,
- required TestController tester,
Attempts to locate the Testable
identified by the testableId
and will
then set the associated value to the found widget.
Implementation
@override
Future<void> execute({
required CancelToken cancelToken,
required TestReport report,
required TestController tester,
}) async {
String collectionPath = tester.resolveVariable(this.collectionPath);
String? documentId = tester.resolveVariable(this.documentId);
String value = tester.resolveVariable(this.value);
assert(collectionPath.isNotEmpty == true);
assert(documentId?.isNotEmpty == true);
var name = "$id('$collectionPath', '$documentId', '$value')";
log(
name,
tester: tester,
);
var firestore = TestFirestoreHelper.firestore;
var doc = firestore.collection(collectionPath).doc(documentId);
var data = json.decode(value);
await doc.set(data);
}