mirror of
https://github.com/GitJournal/GitJournal.git
synced 2025-07-15 07:56:11 +08:00
36 lines
1.0 KiB
Dart
36 lines
1.0 KiB
Dart
import 'package:flutter_driver/flutter_driver.dart';
|
|
import 'package:test/test.dart';
|
|
|
|
void main() {
|
|
group('Git Test', () {
|
|
// First, define the Finders. We can use these to locate Widgets from the
|
|
// test suite. Note: the Strings provided to the `byValueKey` method must
|
|
// be the same as the Strings we used for the Keys in step 1.
|
|
// final counterTextFinder = find.byValueKey('counter');
|
|
final buttonFinder = find.text('Git Clone');
|
|
|
|
FlutterDriver driver;
|
|
|
|
// Connect to the Flutter driver before running any tests
|
|
setUpAll(() async {
|
|
driver = await FlutterDriver.connect();
|
|
});
|
|
|
|
// Close the connection to the driver after the tests have completed
|
|
tearDownAll(() async {
|
|
if (driver != null) {
|
|
driver.close();
|
|
}
|
|
});
|
|
|
|
test('Anonymous GitClone works', () async {
|
|
await driver.waitFor(buttonFinder);
|
|
await driver.tap(buttonFinder);
|
|
await driver.waitFor(
|
|
find.text("Success"),
|
|
timeout: Duration(seconds: 15),
|
|
);
|
|
});
|
|
});
|
|
}
|