Skip to content
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

Support running/debugging Flutter Driver integration tests #2614

Merged
merged 8 commits into from
Jul 8, 2020

Conversation

DanTup
Copy link
Member

@DanTup DanTup commented Jul 7, 2020

  • Tests

This adds some special treatment for the test_driver folder so the files in it can be considered tests, and entry points. This doesn't user flutter drive (as it doesn't seem to have a good API mode) but allows you to do the same thing it does by launching the instrumented app and then running tests against it.

  • Open test_driver/app.dart and press F5 - this should launch this file (the instrumented version)
  • Wait for the app to launch
  • Switch to test_driver.app_test.dart
  • Press F5 to run the whole file, or use the CodeLens Run/Debug links to run individual tests

This should give full debugging of both the app and the test, and shouldn't need launch configs. If you do want to be able to launch these from launch configs, you should be able to use basic configs as you'd expect:

 {
      "name": "Integration Tests: Launch App",
      "request": "launch",
      "type": "dart",
      "program": "test_driver/app.dart",
    },
    {
      "name": "Integration Tests: Launch Driver",
      "request": "launch",
      "type": "dart",
      "program": "test_driver/app_test.dart",
    },

I made it automatically Hot Restart the app at the start of the test run, as it seemed weird to run with existing state (the sample tests here would fail if run multiple times due to the counter state not being reset).

@DanTup DanTup added is enhancement in flutter Relates to running Flutter apps in debugger Relates to the debug adapter or process of launching a debug session in testing Relates to test execution of Dart/Flutter tests for end users labels Jul 7, 2020
@DanTup DanTup added this to the v3.13.0 milestone Jul 7, 2020
@DanTup DanTup merged commit 7c946e2 into master Jul 8, 2020
@DanTup DanTup deleted the integration-tests branch July 8, 2020 13:03
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
in debugger Relates to the debug adapter or process of launching a debug session in flutter Relates to running Flutter apps in testing Relates to test execution of Dart/Flutter tests for end users is enhancement
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

1 participant