-
Notifications
You must be signed in to change notification settings - Fork 26.8k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
flutter_test: Tap on a button don't work in drawer #31066
Comments
I tried to investigate deeper by using methods getTopLeft, getBottomRight, getCenter and tapAt : With for loops I tapped everywhere and found a zone where it's working : same y coordinates as the button and x=0 |
finally found a workaround : just need to add some delay before tapping in the drawer. :-/ So I added took me too long to figure it. |
For those reaching here because tapping something in
It seems that, due to entering animation of the whole screen, the IconButton was out of the screen, and waiting a little make it show on the screen and tapping on it will now work. Sorry for using your issue @hawkbee1, but as the solution was almost the same for a related problem, it may help some people. |
I'm still seeing that tester.tap() stops working. I don't know what precise conditions trigger it. But depending on the hierarchy of pumpWidget() it seems tap() will stop working (despite all pump and pumpAndSettle). For now I went with this workaround:
|
Calling |
This thread has been automatically locked since there has not been any recent activity after it was closed. If you are still experiencing a similar issue, please open a new bug, including the output of |
I may have found an issue.
I'm trying to do some TDD with flutter and when the test is running, tapping on a button doesn't work if it's in a drawer. The button works perfectly fine with a normal user.
In the following example we press on two buttons which print a message in the console. Here's the actions :
locate and tap on a button in the scaffold: OK
open the drawer: OK
Locate button in drawer: OK
Tap on the drawer button: nothing happen
I've posted about it on stackoverflow
The text was updated successfully, but these errors were encountered: