Skip to content

integration_test_driver and integration_test_driver_extended #128381

Description

@linchen2chris

Is there an existing issue for this?

Steps to reproduce

  1. run integration test with integration_test_driver_extended
  2. screenshot could generated as expect.

Expected results

integration test result integration_response_data.json should be able to generated.

Actual results

integration_response_data only printed in console, no json file is generated.

Code sample

Code sample
import 'dart:io';
import 'package:flutter_driver/flutter_driver.dart';
import 'package:integration_test/integration_test_driver_extended.dart';

DriverLogCallback logDriverMessages = (String source, String message) {
  final msg = '$source: $message';
  if (message.toLowerCase().contains('error')) {
    stderr.writeln(msg);
  } else {
    stdout.writeln(msg);
  }
};

Future<void> main() async {
  driverLog = logDriverMessages;
  try {
    await integrationDriver(
      onScreenshot: (String screenshotName, List<int> screenshotBytes, [Map<String, Object?>? args]) async {
        print('screenshot: $screenshotName');
        final File image =
            await File('$screenshotName').create(recursive: true);

        image.writeAsBytesSync(screenshotBytes);
        return true;
      },
    );
    // ignore: avoid_catches_without_on_clauses
  } catch (e) {
    print('Error occurred in Driver: $e');
  }
}

Screenshots or Video

Screenshots / Video demonstration

[Upload media here]

Logs

Logs
[Paste your logs here]

Flutter Doctor output

Doctor output
Doctor summary (to see all details, run flutter doctor -v):
[!] Flutter (Channel stable, 3.10.3, on macOS 12.4 21F79 darwin-x64, locale en-CN)
    ! Warning: `dart` on your path resolves to /usr/local/Cellar/dart/2.17.6/libexec/bin/dart, which is not inside your
      current Flutter SDK checkout at /Users/clin/fvm/versions/stable. Consider adding /Users/clin/fvm/versions/stable/bin
      to the front of your path.
[!] Android toolchain - develop for Android devices (Android SDK version 33.0.1)
    ✗ cmdline-tools component is missing
      Run `path/to/sdkmanager --install "cmdline-tools;latest"`
      See https://developer.android.com/studio/command-line for more details.
    ✗ Android license status unknown.
      Run `flutter doctor --android-licenses` to accept the SDK licenses.
      See https://flutter.dev/docs/get-started/install/macos#android-setup for more details.
[✓] Xcode - develop for iOS and macOS (Xcode 13.4)
[✓] Chrome - develop for the web
[✓] Android Studio (version 2022.1)
[✓] Connected device (2 available)
[✓] Network resources

! Doctor found issues in 2 categories.

Activity

  1. added
    in triagePresently being triaged by the triage team
    on Jun 7, 2023
  2. huycozy commented on Jun 7, 2023

    @huycozy
    Member

    Hi @linchen2chris, which platform are you facing this issue on?

    And I see your sample code still has a casting error. The onScreenshot callback is different now:

    typedef ScreenshotCallback = Future<bool> Function(String name, List<int> image, [Map<String, Object?>? args]);

    Please update to make it runnable. Thank you!

  3. added
    waiting for responseThe Flutter team cannot make further progress on this issue until the original reporter responds
    on Jun 7, 2023
  4. linchen2chris commented on Jun 7, 2023

    @linchen2chris
    ContributorAuthor

    Hi @linchen2chris, which platform are you facing this issue on?

    And I see your sample code still has a casting error. The onScreenshot callback is different now:

    typedef ScreenshotCallback = Future<bool> Function(String name, List<int> image, [Map<String, Object?>? args]);

    Please update to make it runnable. Thank you!

    updated

  5. removed
    waiting for responseThe Flutter team cannot make further progress on this issue until the original reporter responds
    on Jun 7, 2023
  6. huycozy commented on Jun 7, 2023

    @huycozy
    Member

    Thanks, I check this on Android but it doesn't seem to work:

    Error occurred in Driver: DriverError: Could not determine URL to connect to application.
    Either the VM_SERVICE_URL environment variable should be set, or an explicit URL should be provided to the FlutterDriver.connect() method.
    No tests were found.

    Can you also share the detailed steps to reproduce this? And which platform are you working on this?

  7. added
    waiting for responseThe Flutter team cannot make further progress on this issue until the original reporter responds
    on Jun 7, 2023
  8. github-actions commented on Jun 28, 2023

    @github-actions

    Without additional information, we are unfortunately not sure how to resolve this issue. We are therefore reluctantly going to close this bug for now.
    If you find this problem please file a new issue with the same description, what happens, logs and the output of 'flutter doctor -v'. All system setups can be slightly different so it's always better to open new issues and reference the related ones.
    Thanks for your contribution.

  9. added
    r: timeoutIssue is closed due to author not providing the requested details in time
    on Jun 28, 2023
  10. github-actions commented on Jul 12, 2023

    @github-actions

    This thread has been automatically locked since there has not been any recent activity after it was closed. If you are still experiencing a similar issue, please open a new bug, including the output of flutter doctor -v and a minimal reproduction of the issue.

  11. locked as resolved and limited conversation to collaborators on Jul 12, 2023
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

    in triagePresently being triaged by the triage teamr: timeoutIssue is closed due to author not providing the requested details in timewaiting for responseThe Flutter team cannot make further progress on this issue until the original reporter responds

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions