我正在为我的flutter应用程序创建一个集成测试,但当我找到一个TextInput
并试图在里面键入时,我遇到了这个错误。错误:'package:flutter_test/src/binding.dart': Failed assertion: line 1649 pos 12: '_pendingFrame == null': is not true.
代码:
final Finder email = find.byWidgetPredicate(
(widget) => widget is FutXTextField && widget.title == 'EMAIL',
);
expect(email, findsOneWidget,
reason: " Só pode haver um botão de escrever email");
await tester.enterText(email, "teste@teste.teste");
我在网上找不到这个错误是什么。
有没有人以前遇到过这种异常,并且知道如何解决它?
当我运行测试的应用程序引发异常时,我也遇到了同样的错误,如果你检查日志,你会发现在测试失败之前发生了任何错误吗?
我出现此错误是因为我在测试中使用了一个异步方法,但没有await
。