Skip to content

Duplicate browsers start for test given on 'An introduction to integration testing' page #148915

Open

Description

@zpsean

See linked issue for more context: #100447
[Web][Integration Test] Two Chrome instances launched, and the unnecessary Chrome instance breaks the foundation of the integration test [Edited]

Page URL

https://docs.flutter.dev/cookbook/testing/integration/introduction/

Page source

https://github.com/flutter/website/tree/main/src/cookbook/testing/integration/introduction.md

Describe the problem

After executing the command:

flutter drive \
  --driver=test_driver/integration_test.dart \
  --target=integration_test/app_test.dart \
  -d chrome

One Chrome is opened. Notice that it is not labeled with "chrome is controlled by automated test software".

image

Then try to execute the command plus arg --no-headless:

flutter drive \
  --driver=test_driver/integration_test.dart \
  --target=integration_test/app_test.dart \
  -d chrome \
  --no-headless 

Two Chrome instances are launched:

  • One [backend one] is launched as a device [this is NOT intended for test cases execution]
  • The other [frontend one] is launched via webdriver (chromedriver this case) [this is intended for test cases execution, labeled with 'chrome is controlled by automated test software']

[Note: Mostly, the two Chromes are overlaid, please try to drag it away (up or down), then back one would be visible.]

image

Expected fix

Issue code raised: #100447
[Web][Integration Test] Two Chrome instances launched, and the unnecessary Chrome instance breaks the foundation of the integration test [Edited]

Before issue 100447 is fixed. Please kindly add the above info to this page to clear the context to avoid misleading users.

Additional context

No response

Activity

  1. changed the title [-][PAGE ISSUE]: 'An introduction to integration testing'[/-] [+][PAGE ISSUE]: 'An introduction to integration testing', the content in this page is misleading[/+] on Mar 22, 2022
  2. danagbemava-nc commented on Mar 22, 2022

    @danagbemava-nc
    Member

    Hi @zpsean, I'm not sure I fully understand what your request is.

    Are you saying the page should recommend using --no-headless ?

  3. zpsean commented on Mar 22, 2022

    @zpsean
    Author

    @danagbemava-nc in summary, as stated in: #100447
    the function of flutter drive for integration_test has issues. that is, if use command below, the expected results need to be addressed as no Chrome is launched. However, currently, it has one Chrome launched wrongly, which will mislead the user. I suggest here need comments to clarify this in the page.

    flutter drive \
      --driver=test_driver/integration_test.dart \
      --target=integration_test/app_test.dart \
      -d chrome
    
  4. danagbemava-nc commented on Mar 23, 2022

    @danagbemava-nc
    Member

    The command on this page does not state to use chrome as the device but rather web-server and it suggests to launch chromedriver separately. Are you proposing to add a cautionary statement for when the user uses chrome as the device?

  5. zpsean commented on Mar 23, 2022

    @zpsean
    Author

    Yes, maybe most of the users would try to use real browser (like Chrome) but not -d web-server, as the command itself also gives such suggestion.

    The web-server device requires the Dart Debug Chrome extension for debugging. Consider using the Chrome or Edge devices for an improved development workflow.

    %flutter drive --driver=test_driver/IT_driver_test.dart --target=integration_test/IT_test.dart -d web-server  
                
    Running "flutter pub get" in myapp...                               3.1s
    Launching integration_test/IT_test.dart on Web Server in debug mode...
    Waiting for connection from debug service on Web Server...         27.3s
    integration_test/IT_test.dart is being served at http://localhost:62423
    The web-server device requires the Dart Debug Chrome extension for debugging. Consider using the Chrome or Edge devices for an improved development workflow.
    All tests passed.
    Application finished.
    
    
  6. danagbemava-nc commented on Mar 24, 2022

    @danagbemava-nc
    Member

    Thanks for feedback

  7. changed the title [-][PAGE ISSUE]: 'An introduction to integration testing', the content in this page is misleading[/-] [+]Duplicate browsers start for test given on 'An introduction to integration testing' page[/+] on May 23, 2023
  8. atsansone commented on May 23, 2023

    @atsansone

    @yjbanov , I know that the original issue(s) were closed in flutter/flutter (#100447, #67090), but I would like to provide better guidance in the docs. Do you have a recommendation I can include to avoid the double browser effect? I understand why it would happen, but I agree that this could make the tests wonky.

  9. transferred this issue fromflutter/websiteon May 22, 2024
  10. added
    ⏳Bot is counting down the days until it unassigns the issue
    on May 24, 2024
  11. flutter-triage-bot commented on May 24, 2024

    @flutter-triage-bot

    This issue is assigned to @yjbanov but has had no recent status updates. Please consider unassigning this issue if it is not going to be addressed in the near future. This allows people to have a clearer picture of what work is actually planned. Thanks!

  12. flutter-triage-bot commented on May 24, 2024

    @flutter-triage-bot

    This issue was assigned to @yjbanov but has had no status updates in a long time. To remove any ambiguity about whether the issue is being worked on, the assignee was removed.

  13. removed
    ⏳Bot is counting down the days until it unassigns the issue
    on May 24, 2024
  14. added
    in triagePresently being triaged by the triage team
    on May 27, 2024
  15. huycozy commented on May 27, 2024

    @huycozy
    Member

    Reproduced this issue on the latest Flutter stable & master channels.

    flutter doctor -v (stable and master)
    [✓] Flutter (Channel stable, 3.22.1, on macOS 14.1 23B74 darwin-x64, locale en-VN)
        • Flutter version 3.22.1 on channel stable at /Users/huynq/Documents/GitHub/flutter
        • Upstream repository https://github.com/flutter/flutter.git
        • Framework revision a14f74ff3a (11 hours ago), 2024-05-22 11:08:21 -0500
        • Engine revision 55eae6864b
        • Dart version 3.4.1
        • DevTools version 2.34.3
    
    [✓] Android toolchain - develop for Android devices (Android SDK version 34.0.0)
        • Android SDK at /Users/huynq/Library/Android/sdk
        • Platform android-34, build-tools 34.0.0
        • ANDROID_HOME = /Users/huynq/Library/Android/sdk
        • Java binary at: /Applications/Android Studio.app/Contents/jbr/Contents/Home/bin/java
        • Java version OpenJDK Runtime Environment (build 17.0.9+0-17.0.9b1087.7-11185874)
        • All Android licenses accepted.
    
    [✓] Xcode - develop for iOS and macOS (Xcode 15.3)
        • Xcode at /Applications/Xcode15.3.app/Contents/Developer
        • Build 15E204a
        • CocoaPods version 1.15.2
    
    [✓] Chrome - develop for the web
        • Chrome at /Applications/Google Chrome.app/Contents/MacOS/Google Chrome
    
    [✓] Android Studio (version 2023.2)
        • Android Studio at /Applications/Android Studio.app/Contents
        • Flutter plugin can be installed from:
          🔨 https://plugins.jetbrains.com/plugin/9212-flutter
        • Dart plugin can be installed from:
          🔨 https://plugins.jetbrains.com/plugin/6351-dart
        • android-studio-dir = /Applications/Android Studio.app/
        • Java version OpenJDK Runtime Environment (build 17.0.9+0-17.0.9b1087.7-11185874)
    
    [✓] VS Code (version 1.89.1)
        • VS Code at /Applications/Visual Studio Code.app/Contents
        • Flutter extension version 3.88.0
    
    [✓] Connected device (2 available)
        • macOS (desktop) • macos  • darwin-x64     • macOS 14.1 23B74 darwin-x64
        • Chrome (web)    • chrome • web-javascript • Google Chrome 125.0.6422.76
    
    [✓] Network resources
        • All expected network resources are available.
    
    • No issues found!
    [!] Flutter (Channel master, 3.23.0-8.0.pre.8, on macOS 14.1 23B74 darwin-x64, locale en-VN)
        • Flutter version 3.23.0-8.0.pre.8 on channel master at /Users/huynq/Documents/GitHub/flutter_master
        ! Warning: `flutter` on your path resolves to /Users/huynq/Documents/GitHub/flutter/bin/flutter, which is not inside your current Flutter SDK checkout at /Users/huynq/Documents/GitHub/flutter_master. Consider adding /Users/huynq/Documents/GitHub/flutter_master/bin to the front of your path.
        ! Warning: `dart` on your path resolves to /Users/huynq/Documents/GitHub/flutter/bin/dart, which is not inside your current Flutter SDK checkout at /Users/huynq/Documents/GitHub/flutter_master. Consider adding /Users/huynq/Documents/GitHub/flutter_master/bin to the front of your path.
        • Upstream repository https://github.com/flutter/flutter.git
        • Framework revision 8fd8e66de4 (3 hours ago), 2024-05-26 21:49:30 -0400
        • Engine revision 469193ef0e
        • Dart version 3.5.0 (build 3.5.0-191.0.dev)
        • DevTools version 2.36.0-dev.10
        • If those were intentional, you can disregard the above warnings; however it is recommended to use "git" directly to perform update checks and upgrades.
    
    [✓] Android toolchain - develop for Android devices (Android SDK version 34.0.0)
        • Android SDK at /Users/huynq/Library/Android/sdk
        • Platform android-34, build-tools 34.0.0
        • ANDROID_HOME = /Users/huynq/Library/Android/sdk
        • Java binary at: /Applications/Android Studio.app/Contents/jbr/Contents/Home/bin/java
        • Java version OpenJDK Runtime Environment (build 17.0.9+0-17.0.9b1087.7-11185874)
        • All Android licenses accepted.
    
    [✓] Xcode - develop for iOS and macOS (Xcode 15.3)
        • Xcode at /Applications/Xcode15.3.app/Contents/Developer
        • Build 15E204a
        • CocoaPods version 1.15.2
    
    [✓] Chrome - develop for the web
        • Chrome at /Applications/Google Chrome.app/Contents/MacOS/Google Chrome
    
    [✓] Android Studio (version 2023.2)
        • Android Studio at /Applications/Android Studio.app/Contents
        • Flutter plugin can be installed from:
          🔨 https://plugins.jetbrains.com/plugin/9212-flutter
        • Dart plugin can be installed from:
          🔨 https://plugins.jetbrains.com/plugin/6351-dart
        • android-studio-dir = /Applications/Android Studio.app/
        • Java version OpenJDK Runtime Environment (build 17.0.9+0-17.0.9b1087.7-11185874)
    
    [✓] VS Code (version 1.89.1)
        • VS Code at /Applications/Visual Studio Code.app/Contents
        • Flutter extension version 3.88.0
    
    [✓] Connected device (3 available)
        • Pixel 7 (mobile) • 2B171FDH20084L • android-arm64  • Android 14 (API 34)
        • macOS (desktop)  • macos          • darwin-x64     • macOS 14.1 23B74 darwin-x64
        • Chrome (web)     • chrome         • web-javascript • Google Chrome 125.0.6422.77
    
    [✓] Network resources
        • All expected network resources are available.
    
    ! Doctor found issues in 1 category.
  16. added
    toolAffects the "flutter" command-line tool. See also t: labels.
    t: flutter driver"flutter driver", flutter_drive, or a driver test
    platform-webWeb applications specifically
    f: integration_testThe flutter/packages/integration_test plugin
    team-webOwned by Web platform team
    has reproducible stepsThe issue has been confirmed reproducible and is ready to work on
    and removed
    in triagePresently being triaged by the triage team
    on May 27, 2024
  17. added
    P2Important issues not at the top of the work list
    triaged-webTriaged by Web platform team
    on May 30, 2024
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

    P2Important issues not at the top of the work listf: integration_testThe flutter/packages/integration_test pluginfound in release: 3.22Found to occur in 3.22found in release: 3.23Found to occur in 3.23has reproducible stepsThe issue has been confirmed reproducible and is ready to work onplatform-webWeb applications specificallyt: flutter driver"flutter driver", flutter_drive, or a driver testteam-webOwned by Web platform teamtoolAffects the "flutter" command-line tool. See also t: labels.triaged-webTriaged by Web platform team

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions