Nikhileshwar
Nikhileshwar

Reputation: 1684

Flutter integration test debugging while using integration_test package

I am writing integration tests with integration_test package. Its working well.

I run the following command in CLI to start the testing.

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.

Also can a debugger be attached to the test cases like the debugging unit or widget tests.

Upvotes: 5

Views: 2216

Answers (2)

Seyi
Seyi

Reputation: 35

Running Tests on VS Code Normally Runs on debug mode, so this allows you add breakpoints to your test files

Upvotes: 0

Lee Mordell
Lee Mordell

Reputation: 641

If you're using VS Code, you can add a configuration in launch.json to run the test. 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. If you don't use VS Code, it should be easy enough to set up a similar configuration in ANdroid studio.

Upvotes: 4

Related Questions