Skip to content

integration_test_driver and integration_test_driver_extended #128381

@linchen2chris

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.

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 customer 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