[英]Flutter integration test debugging while using integration_test package
I am writing integration tests with integration_test package.我正在使用 integration_test package 编写集成测试。 Its working well.
它运作良好。
I run the following command in CLI to start the testing.我在 CLI 中运行以下命令来开始测试。
flutter drive --driver=test_driver/integration_test_driver.dart --target=test/integration_tests/app_test.dart
But it requires to rebuild the app every time I re run the test.但是每次我重新运行测试时都需要重建应用程序。 Can we avoid the rebuilding of App.
能否避免 App 的重建?
Also can a debugger be attached to the test cases like the debugging unit or widget tests.也可以将调试器附加到测试用例,如调试单元或小部件测试。
If you're using VS Code, you can add a configuration in launch.json
to run the test.如果您使用的是 VS Code,您可以在
launch.json
中添加配置来运行测试。 Set the 'program' property to the path of the integration test.将“程序”属性设置为集成测试的路径。
{
"name": "Integration Test: Run Test",
"program": "project_root/integration_test/foo_test.dart",
"request": "launch",
"type": "dart"
},
Then you can add breakpoints within the test to pause execution.然后您可以在测试中添加断点来暂停执行。 You can also restart the program via VS Code and the test will run again.
您也可以通过 VS Code 重新启动程序,测试将再次运行。 If you don't use VS Code, it should be easy enough to set up a similar configuration in ANdroid studio.
如果您不使用 VS Code,在 ANdroid 工作室中设置类似的配置应该很容易。
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.