waitUntilAll method
Runs until all actions of the given types are dispatched and finish, in any order. Returns a list with all info until the last action finishes. Ignores other actions types.
Implementation
Future<TestInfoList<St>> waitUntilAll(
List<Type> actionTypes, {
bool ignoreIni = true,
int timeoutInSeconds = defaultTimeout,
}) async {
assert(actionTypes.isNotEmpty);
TestInfoList<St> infoList = TestInfoList<St>();
Set<Type> actionsIni = Set.from(actionTypes);
Set<Type> actionsEnd = {};
TestInfo<St>? testInfo;
while (actionsIni.isNotEmpty || actionsEnd.isNotEmpty) {
testInfo = await _next(timeoutInSeconds: timeoutInSeconds);
if (!ignoreIni || testInfo.isEND) infoList._add(testInfo);
Type actionType = testInfo.action.runtimeType;
if (testInfo.isINI) {
if (actionsIni.remove(actionType)) {
actionsEnd.add(actionType);
}
} else
actionsEnd.remove(actionType);
}
lastInfo = infoList.last;
return infoList;
}