Testing - adventures-in/projects_summary GitHub Wiki
Debugging Integration Tests
Note: this is quite old now and I haven't had a chance to test if it still works yet.
With Android Studio
Hot Reload For Flutter Integration Tests
-
Needed to add --disable-service-auth-codes
-
Port may need to be 8888 - I had tried using 8889 and was having problems, could have been coincidence that changing to 8888 fixed the problem
My setup that worked:
with VSCode
See also Toolchain > IDEs > VSCode
Added a macro using this extension that restarts the app and opens the debug options
"macros": {
"restartIntegrationTest": [
"flutter.hotRestart",
"workbench.action.debug.selectandstart",
]
}
And a keyboard shortcut that uses the macro
{
"key": "cmd+d",
"command": "macros.restartIntegrationTest"
}
This allows me to wait till the restart finishes then hit enter to launch my Driver config - around 2-3 seconds wait vs. 15-20 for flutter driver from command line and more importantly, allows debugging
Limitations
Flutter Driver currently has no way to interact with UI from plugins (eg. signing in etc.)
- Apparently can access adb from test script
- https://github.com/flutter/flutter/issues/12561