Skip to content

[Flutter drive/integration_test] improve commands experience #97519

Open

Description

@cedvdb

Since the area of focus for 2022 roadmap is developer experience, the developer experience regarding integration test commands could be improved. Mainly by not requiring hard coded device ids.

Currently you have to:

  • for web, start chromedriver with the correct port in another shell
  • for android, start the emulator and set the right emulator id in the command

Here is a few ideas, for android it could:

 1. check that `adb devices` has devices
 2a. if multiple devices are available display menu to pick device on which to run 
 3a. run
 
 2b. there is no device then display menu to pick emulator from `emulator -list-avds`
 3b. wait emulator started
 4b. run test on that emulator
 
 2c. if argument `--first-device` is passed, run test on first device found in `adb devices`, same for `--first-emulator`

For web it could:

   1. start chromedriver
   2. run tests with the correct port
   3. kill both unless `--keep-chromedriver-alive`

The --port parameter is also lacking in web integration test, which makes whitelisting localhost:port impossible, you have to whitelist every ports.

Activity

  1. changed the title [-][Flutter drive] improve cli experience[/-] [+][Flutter drive] improve commands experience[/+] on Jan 31, 2022
  2. darshankawar commented on Jan 31, 2022

    @darshankawar
    Member

    @cedvdb
    Is this for flutter driver or integration_test package ?
    Currently, to run integration_test on Android for example, according to the documentation, we need to run ./gradlew app:connectedAndroidTest -Ptarget=pwd/../integration_test/foo_test.dart

    See below links for Android and iOS device settings:

    https://github.com/flutter/flutter/tree/master/packages/integration_test#android-device-testing
    https://github.com/flutter/flutter/tree/master/packages/integration_test#ios-device-testing

    Currently, we can't directly run flutter test command for web and need to start chrome driver in another shell as you mentioned.

  3. added
    waiting for responseThe Flutter team cannot make further progress on this issue until the original reporter responds
    on Jan 31, 2022
  4. cedvdb commented on Jan 31, 2022

    @cedvdb
    ContributorAuthor

    @darshankawar that is not true, you do not need to run such command on android, I believe it is for firebase Lab test. Similarly this command you posted, with its required setup should also be made more developer friendly. I opened another issue this weekend about that. #97464

    It is for the command flutter driver but the underlying package is integration_test (not the old deprecated package).

    The command to run on android is:

    # run tests
    flutter drive \
      --driver=test/driver/integration_test_driver.dart \
      --target=test/integration/create_property_integration_test.dart \
      -d $DEVICE_ID

    Where the DEVICE_ID is either the emulator or the real device.

    This command is unrealistic to be run without a predefined shell script. Because it requires too much setup. Not only you'd have to type all the command above but you have also to start up an emulator and gets its id. This becomes annoying very quickly.

    Making this process easier is what I think would be a added value.

  5. removed
    waiting for responseThe Flutter team cannot make further progress on this issue until the original reporter responds
    on Jan 31, 2022
  6. added
    frameworkflutter/packages/flutter repository. See also f: labels.
    f: integration_testThe flutter/packages/integration_test plugin
    c: proposalA detailed proposal for a change to Flutter
    t: flutter driver"flutter driver", flutter_drive, or a driver test
    platform-androidAndroid applications specifically
    platform-webWeb applications specifically
    and removed
    frameworkflutter/packages/flutter repository. See also f: labels.
    t: flutter driver"flutter driver", flutter_drive, or a driver test
    c: proposalA detailed proposal for a change to Flutter
    f: integration_testThe flutter/packages/integration_test plugin
    in triagePresently being triaged by the triage team
    on Feb 1, 2022
  7. changed the title [-][Flutter drive] improve commands experience[/-] [+][Flutter drive/integration_test] improve commands experience[/+] on Feb 1, 2022
  8. added
    c: new featureNothing broken; request for a new capability
    P3Issues that are less important to the Flutter project
    toolAffects the "flutter" command-line tool. See also t: labels.
    on Feb 3, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    P3Issues that are less important to the Flutter projectc: new featureNothing broken; request for a new capabilityc: proposalA detailed proposal for a change to Flutterf: integration_testThe flutter/packages/integration_test pluginframeworkflutter/packages/flutter repository. See also f: labels.platform-androidAndroid applications specificallyplatform-webWeb applications specificallyteam-frameworkOwned by Framework teamtoolAffects the "flutter" command-line tool. See also t: labels.triaged-frameworkTriaged by Framework team

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions