-
Notifications
You must be signed in to change notification settings - Fork 26.7k
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
simulateKeyDownEvent ENTER throwing exception in integration tests Desktop #148406
Comments
Hi @fernandomoraesvr, how are you running your integration tests? If you are using flutter driver, this may be a limitation. See #9383 |
@
Hi, i'm using the integration test driver, i was not able to reproduce my issue in 3.19.6, |
Hi @fernandomoraesvr, please provide a complete minimal runnable code sample so that we can properly investigate this. Thank you |
I created a new Flutter project using version 3.22 and was able to reproduce the issue with the newly created project, without changing code in the initial generated project, i wrote the following integration test:
It looks like it requires two MyHomePage in the sample code is the MyHomePage created by |
I did a deep investigation and found out that the change made by this PR #143847 is causing this issue. Reverting the transitMode in
|
The test above simulates two key down events on the same key, this is why it triggers an error (previously, with version 3.19, the error was not thrown due to a bug). There are two ways to fix this test:
Thanks for trying these. |
I did not remember why we're using simulateKeyDownEvent instead of tester sendKeyEvent, sendKeyEvent worked fine in our integration tests rn (So obviously that a Up is needed to remove from keyPressedEvents and i didn't noticed lmao) Thank you bleroux, this issue can be closed now. TL;DR: Fixed after changing simulateKeyDownEvent to sendKeyEvent or using and Up after Down. |
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 |
Steps to reproduce
Just use
await simulateKeyDownEvent(LogicalKeyboardKey.enter)
in a integration test targeting desktop platform (linux or windows)Expected results
Simulate a KeyDown event from a Logical Key
enter
Actual results
Every test using the aforementioned function call to simulate enter key thrown an error.
Code sample
Code sample
Screenshots or Video
Screenshots / Video demonstration
[Upload media here]
Logs
Logs
[Paste your logs here]
Flutter Doctor output
The text was updated successfully, but these errors were encountered: