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:
@@ -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 {
|
||||
|
||||
Reference in New Issue
Block a user