Files
GitJournal/test_driver/git_test.dart
Vishesh Handa 4de157e6b1 Add an automated test for testing git clone in github
It currently fails :(
2019-02-06 15:06:08 +01:00

32 lines
979 B
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.tap(buttonFinder);
await driver.waitFor(find.text("Success"), timeout: Duration(seconds: 5));
});
});
}