Vofch
Vofch

Reputation: 448

Flutter integration test failing with error `'_pendingFrame == null': is not true.`

I'm creating an integration test to my flutter app but I get this error when finding an TextInput and trying to type inside. The error: 'package:flutter_test/src/binding.dart': Failed assertion: line 1649 pos 12: '_pendingFrame == null': is not true.

The code:

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, "[email protected]");

I didn`t find it anywhere on the internet what this error is.

Does anyone had this exception before and has any idea of how to solve it?

Upvotes: 8

Views: 4632

Answers (3)

Daniel Oliveira
Daniel Oliveira

Reputation: 8963

In our case, turned out to be VS Code. Running the test on Intellij IDEs worked flawlessly. I believe running via command line will also work.

Upvotes: 0

MickaelHrndz
MickaelHrndz

Reputation: 3832

I had this error because of an asynchronous method that I used in my test but didn't await.

Upvotes: 2

CloudDissembler
CloudDissembler

Reputation: 71

I had the same error when the app that I was running the test on threw an exception, if you check the logs do you see any errors occurring before your test failed?

Upvotes: 7

Related Questions