-
Notifications
You must be signed in to change notification settings - Fork 146
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
Debugging code in tests? #1777
Comments
After some research, yes we can wait in tests for (e.g. 15 seconds) and in that window we can run Flutter Attach and breakpoints will work. The only issue I had was that in IntelliJ New UI Flutter Attach icon was not there (fixed it with https://stackoverflow.com/a/74728357/4110778). So, to conclude: there is a way for us to attach and debug. It would be ideal if there's a smarter way than adding 15-second await. If there's nothing to add we can close this issue. |
Let's keep it open for now, every discussion is good so we can better understand your needs :) Thanks for researching this as well! Related: |
Oi, how you guys doing? Hey @itsJoKr do we have to attach using the test_bundle.dart? I'm trying to debug using vscode and in the configuration file I'm setting the program file to test_bundle.dart but It seems that is not working 🥲 Does anyone has any tips? I appreciate It. |
@joaoantoniomartinsfilho I'm not attaching to test bundle, all I do is:
|
I think it would be nice to just setup launch.json file in VS code to debug any test. Some kind of this "configurations": [
{
"name": "Debug Patrol",
"request": "launch",
"type": "dart",
"program": "integration_test/test_bundle.dart",
"args": ["--flavor", "develop"]
}, Maybe developing of VS Code extension is required to setup such launch configuration |
Hello, I have implemented a workflow which works for me locally. It works like this:
In launch.json:
in tasks.json
and the capture script:
|
This method works great. Thank you! |
Use case
When a test fails, it is often very beneficial to be able to set a breakpoint, run the debug mode and see what is actually happening. This is possible to do with
test
widgetTest
.Anyway, I'm not sure how to do that with patrol. Didn't find anything in docs or issues. Is this even possible to do?
Proposal
There are many ways to do this, but some minimal case would be a docs page that explains how to set up and run debug in tests. I would assume since it's not run from the Intellij/Studio it is possible to attach to running test after it is run.
The text was updated successfully, but these errors were encountered: