waitForText method

Future<void> waitForText(
  1. String text, {
  2. int timeout = 10,
})

Implementation

Future<void> waitForText(String text, {int timeout = 10}) async {
  for (var i = 0; i < timeout; i++) {
    var contains = (await getHtml()).contains(text);

    if (contains) {
      break;
    }
    await Future.delayed(const Duration(seconds: 1));
  }
}