Explain more specifically how to use flutter drive/what it does (#161450)

_Run integration tests for the project_ is not an accurate statement, as
there is nothing inherently about `flutter_driver` that is for
integration tests (for example, it could be just plain automation,
benchmarking, etc).

In addition, clarifies what the most common two arguments might be and
their defaults.

Co-authored-by: Andrew Kolos <andrewrkolos@gmail.com>
This commit is contained in:
Matan Lurey
2025-01-13 12:51:02 -08:00
committed by GitHub
parent 01fc23238e
commit 5f06c091b9
2 changed files with 31 additions and 1 deletions

View File

@@ -588,6 +588,32 @@ void main() {
DeviceManager: () => fakeDeviceManager,
},
);
testUsingContext('flutter drive --help explains how to use the command', () async {
final DriveCommand command = DriveCommand(
fileSystem: fileSystem,
logger: logger,
platform: platform,
signals: signals,
);
// TODO(matanlurey): https://github.com/flutter/flutter/issues/158532.
final StringBuffer printOutput = StringBuffer();
final Zone capturePrintZone = Zone.current.fork(
specification: ZoneSpecification(
print: (_, _, _, String line) {
printOutput.writeln(line);
},
),
);
await capturePrintZone.run(() async {
await createTestCommandRunner(command).run(<String>['drive', '--help']);
});
expect(
printOutput.toString(),
stringContainsInOrder(<String>['flutter drive', '--target', '--driver']),
);
});
}
class ThrowingScreenshotDevice extends ScreenshotDevice {