waitUntilErrorGetLast method

Future<TestInfo<St>> waitUntilErrorGetLast({
  1. Object? error,
  2. Object? processedError,
  3. int? timeoutInSeconds,
})

If error is a Type, runs until after an action throws an error of this exact type. If error is NOT a Type, runs until after an action throws this error (using equals).

You can also, instead, define processedError, which is the error after wrapped by the action's wrapError() method. Note, if you define both error and processedError, both need to match.

Returns the info after the error condition is met.

Implementation

Future<TestInfo<St>> waitUntilErrorGetLast({
  Object? error,
  Object? processedError,
  int? timeoutInSeconds,
}) async {
  timeoutInSeconds ??= defaultTimeout;

  var infoList = await waitUntilError(
    error: error,
    processedError: processedError,
    timeoutInSeconds: timeoutInSeconds,
  );

  return infoList.last;
}