waitConditionGetLast method
Future<TestInfo<St> >
waitConditionGetLast(
- StateCondition<
St> condition, { - bool testImmediately = true,
- bool ignoreIni = true,
- int timeoutInSeconds = defaultTimeout,
Runs until the predicate function condition
returns true.
This function will receive each testInfo, from where it can
access the state, action, errors etc.
When testImmediately
is true (the default), it will test the condition
immediately when the method is called. If the condition is true, the
method will return immediately, without waiting for any actions to be
dispatched.
When testImmediately
is false, it will only test
the condition once an action is dispatched.
Only END states will be received, unless you pass ignoreIni
as false.
Returns the info after the condition is met.
Implementation
Future<TestInfo<St>> waitConditionGetLast(
StateCondition<St> condition, {
bool testImmediately = true,
bool ignoreIni = true,
int timeoutInSeconds = defaultTimeout,
}) async {
var infoList = await waitCondition(
condition,
testImmediately: testImmediately,
ignoreIni: ignoreIni,
timeoutInSeconds: timeoutInSeconds,
);
return infoList.last;
}