简体   繁体   English

Flutter 集成测试调试同时使用 integration_test package

[英]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.

相关问题 使用integration_test包在flutter集成测试中设置语言环境 - Setting locale in flutter integration test using integration_test package flutter 集成测试使用新的 integration_test package 测试异常时出错 - Error for flutter integration test using the new integration_test package to test exceptions Flutter / Dart package integration_test with Z37A6259CC0C1DAE299A7866489 安全 - Flutter / Dart package integration_test with null safety integration_test package 可以与 webview 交互吗? - Can integration_test package interact with webview? 如何将参数传递给flutter integration_test? - How to pass parameters into flutter integration_test? Flutter integration_test - 截图 - Flutter integration_test - Making screenshot 使用 Flutter 新的 integration_test 的示例集成测试? - Sample integration test with Flutter new integration_test? Flutter:调试集成测试 - Flutter: Debugging an integration test 如何解决“在 Flutter SDK 中找不到 package integration_test”错误 - How to solve 'could not find package integration_test in the Flutter SDK' error Flutter integration_test package 与我的代码冲突,无法通过调整 package 版本来解决 - 所以整个应用程序无法运行 - Flutter integration_test package conflict with my code and cannot be resolved by tweaking package versions - so the whole app cannot run
 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM