-
Notifications
You must be signed in to change notification settings - Fork 303
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
Support running/debugging Flutter Driver integration tests #2609
Comments
Could you try this version out for me?
This should give you full debugging of both the app and the test, and you shouldn't need to mess around with launch configs. If you do want to be able to launch these from launch configs, you should be able to just strip out all the {
"name": "Integration Tests: Launch App",
"request": "launch",
"type": "dart",
"program": "test_driver/app.dart",
},
{
"name": "Integration Tests: Launch Driver",
"request": "launch",
"type": "dart",
"program": "test_driver/app_test.dart",
}, Let me know if this seems to work ok for you (I've never used driver tests before, so I'm flying a little blind here). If you hit any issues, let me know (ether here, or once this issue is closed, in new issues). If it all works, you can remain on this test version and when the next stable release goes out you'll be automatically changed over to it (if you have auto updates for extensions enabled). BTW - I made it automatically Hot Restart the app at the start of the test run, as it seemed weird to run with existing state.. if this feels weird, let me know (I did it because the sample tests here would fail if run multiple times due to the counter state not being reset). |
@DanTup it works!!! this is brilliant |
Great, thanks for confirming! |
@DanTup how long does it usually take for new versions to show up at https://marketplace.visualstudio.com/items?itemName=Dart-Code.dart-code |
@themightychris this feature isn't included in a release yet - it'll be in the version in the assigned milestone (v3.13.0) which is likely to ship around the end of the month (there was a release today, but it was a minor version to support using the Flutter SDK Snap). The issues are automatically closed when the work is merged to master. For now, you should stick with the preview build from above - if you have auto-updates on, VS Code will automatically upgrade you to the stable v3.13.0 when it's published. |
Hi @themightychris, you mention here that you can use --dart-define inside args. I already tried but it's not working on the test driver, it is only working on my default app. Are there any gotchas that I need to carefully check? |
@tijanirf it's all super easy to do now, and built into the vscode extension. You don't need to pass |
Any ideas how to debug integration tests using new integration_test package from SDK? |
@tomasfly it should generally just work since v3.22 (see https://dartcode.org/releases/v3-22/#flutter-integration-testing). If you're having issues with it not doing as you'd expect, please file a new issue with detailed steps and I'll take a look. Thanks! |
Does anyone have any tips for doing this in IntelliJ? Currently I just run |
@DanTup Is it possible to debug integration test using chrome driver?. As @JaredEzz mentioned, right now I'm running on the terminal using |
@gabrielchaves7 unfortunately I don't think this is currently possible. The ideal way would be for I did wonder if in the meantime if you only need the debugging part (not test tree etc.) you could do this with a launch configuration that does an
...does not appear to start paused (as would be required for an |
I'm working through this guide trying to get to a point where I can step through driver scripts and/or driven apps in VSCode: https://medium.com/flutter-community/hot-reload-for-flutter-integration-tests-e0478b63bd54
Running the terminal commands works, but I haven't been able to get either side to work when launched from VSCode yet. There seem to be two things in the way:
--observation-port
via"args"
inlaunch.json
seems to get overridden by the extensionlaunch.json
-level override. It gets launched on the Android device I just launched the app on, and I can breakpoint through it but it kills the app on the device to launch the driverHere's my best guess so far:
The text was updated successfully, but these errors were encountered: