-
Notifications
You must be signed in to change notification settings - Fork 3.2k
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
Codelab "How to test a Flutter app" Step 6 Widget tests throw exceptions #5190
Comments
@johnpryan, I see this person is using the dev channel. Could that explain why the test is failing? |
This is not a dev channel channel issue. The 'Testing Scrolling' test case fails consistently and exceprions are thrown as reported also in Flutter 2.0.2 stable channel and across different physical devices and emulators. The scrolling never takes place. |
Some more information. The unit tests and integration tests in the codelab run fine. The widget tests in Step 6 look strange after loading as mentioned above: #5190 (comment) All widget tests that involve scrolling or tapping consistently fail: 'Testing Scrolling', 'Testing IconButtons', 'Testing Remove Button' This fails on physical devices both iOS and Android as well as emulators across different versions of the test package ^1.14.4 (as in the codelab) to ^1.16.5 (latest version compatible with Flutter 2.02 stable). Hope that helps someone to identify and fix. |
Even with your repo "SETP_07" the problem persists, i tried on Beta, Dev and Master channels on the latest versions. Error generated:An Observatory debugger and profiler on SM G950F is available at: http://127.0.0.1:56495/ZPK6zZ6X-_Y=/ Flutter doctor -v:[√] Flutter (Channel master, 2.3.0-17.0.pre.397, on Microsoft Windows [versão 10.0.19042.1052], locale pt-BR) • Flutter version 2.3.0-17.0.pre.397 at C:\src\flutter • Upstream repository https://github.com/flutter/flutter.git • Framework revision 03034e9e4a (6 hours ago), 2021-06-18 00:14:03 -0700 • Engine revision ced58ef9c1 • Dart version 2.14.0 (build 2.14.0-217.0.dev)[√] Android toolchain - develop for Android devices (Android SDK version 30.0.2) [√] Chrome - develop for the web [√] Visual Studio - develop for Windows (Visual Studio Community 2019 16.10.1) [√] Android Studio (version 4.0) [√] VS Code (version 1.57.1) [√] Connected device (4 available) • No issues found! |
"This fails on physical devices both iOS and Android as well as emulators across different versions of the test package ^1.14.4 (as in the codelab) to ^1.16.5 (latest version compatible with Flutter 2.02 stable)." The physical devices I tested don't have notches. I haven't seen a case where it doesn't fail, which specific devices did the test pass for you? |
It would be helpful if someone from the Flutter team could comment if #5190 (comment) is expected behaviour or if this "weird" rendering of widgets already indicates a bug. Because the warning messages clearly indicate that the fling and tap events are not recognized which appears to make these Widget tests fail (I can see the fling cursor but it is not recognized as an UI event). In Integration tests, Widgets render as expected and scrolling and tapping events work just fine. |
Is this related? flutter/flutter#82542 |
appears related, but the description there reads particular and does not match the scope of the problem. On my side ALL widget tests that interact with UI such as fling and tap throw exceptions on ALL devices - simulators and hardware, Android ad iOS. I have seen similiar bug reports - someone at Flutter would need to connect the dots. |
Thanks for the explanation. IIUC, TahaTesser, who answered in flutter/flutter#82542 (comment):
is a member of the Flutter team. It wasn't clear to me whether abd99 filed any related issues as requested. |
It is not an issue of platform, it is independent of platform, I wrote that a couple of times. The testing documentation on Flutter currently has some errors. On top of that Widget testing is broken in Flutter. There are already issues open, some of them for a long time. I try to help, but opening more separate issues does not cut it. Someone at Flutter needs to look at the full picture and make testing and documentation of testing a priority. |
Yeah I understand what you are saying. It's not obvious to me that this discussion is being attended to by flutter folks at the moment (iiuc, there are a lot of issues across the various repositories) so my comments were intended to provide possible leads on either a person to explicitly inform (e.g. TahaTesser) or other places to look for such people. |
I went through this codelab and I wasn't able to reproduce either error. Attached is a project that contains the files for step 6: If I unzip the project, create the iOS / Android project files, and run the tests, the tests are passing:
I tried to reproduce on iOS and Android but the tests are passing for both of those. |
According to https://codelabs.developers.google.com/codelabs/flutter-app-testing/#5 the widget tests can be 'run in the same way as unit tests' (i.e. with In the codelab the widget tests are run on the device or emulator, i.e. with |
I posted an initial analysis of what broke this at flutter/flutter#82542 (comment). @johnpryan Should we de-dup these two bugs? Given my analysis above, this is probably a bug in the framework. Should we therefore close this bug and redirect people to the bug filed in the framework repository? |
Yeah, I don't think there are any required changes to the codelab. I'll close this issue. |
I don't think it is a good idea to close this issue. I recommend to amend the codelab or at least leave the issue open until the underlying issue is fixed. As such the codelab is not working and people going through it will run into the problem. |
Hi @i3games, I understand the desire to keep the bug open as a tracking bug, but we don't have a process for closing this bug when flutter/flutter#82542 is fixed. De-duping and forwarding people to the active issue prevents duplication of conversation. hth, brett |
Following the instructions on the Codelab "How to test a Flutter app" through to Step 6 "Widget Testing"
on page
https://codelabs.developers.google.com/codelabs/flutter-app-testing#5
beginning with 'Testing Scrolling', widget tests throw exceptions (see below) and fail, regardless of platform and regardless if physical device or emulator. 'Testing if ListView shows up' does succeed.
Code is copy / pasted from the codelab.
Note: The unit tests and integration tests from the same codelab work as expected.
The text was updated successfully, but these errors were encountered: