context.waitFor(condition[, options])
condition<Function> | <AsyncFunction> 一个断言函数,会定期调用,直到它成功完成或达到定义的轮询超时时间。成功完成的定义是没有抛出异常或拒绝。此函数不接受任何参数,并且可以返回任何值。options<Object> 轮询操作的可选配置对象。支持以下属性:- 返回:<Promise> 充满
condition返回的值。
该方法会轮询 condition 函数,直到该函数成功返回或操作超时。
🌐 This method polls a condition function until that function either returns
successfully or the operation times out.