mirror of
https://github.com/flutter/flutter.git
synced 2025-06-03 00:51:18 +00:00

With frameSync enabled, flutter_driver actions will only be performed when there are no pending frames in the app under test. This helps with reducing flakiness.
34 lines
955 B
Dart
34 lines
955 B
Dart
import 'dart:async';
|
|
|
|
import 'package:flutter_driver/flutter_driver.dart';
|
|
import 'package:test/test.dart';
|
|
|
|
const Duration kWaitBetweenActions = const Duration(milliseconds: 250);
|
|
|
|
void main() {
|
|
group('flutter gallery transitions', () {
|
|
FlutterDriver driver;
|
|
setUpAll(() async {
|
|
driver = await FlutterDriver.connect();
|
|
});
|
|
|
|
tearDownAll(() async {
|
|
if (driver != null)
|
|
await driver.close();
|
|
});
|
|
|
|
test('navigation', () async {
|
|
SerializableFinder menuItem = find.text('Text fields');
|
|
await driver.scrollIntoView(menuItem);
|
|
await new Future<Null>.delayed(kWaitBetweenActions);
|
|
|
|
for (int i = 0; i < 15; i++) {
|
|
await driver.tap(menuItem);
|
|
await new Future<Null>.delayed(kWaitBetweenActions);
|
|
await driver.tap(find.byTooltip('Back'));
|
|
await new Future<Null>.delayed(kWaitBetweenActions);
|
|
}
|
|
}, timeout: new Timeout(new Duration(minutes: 1)));
|
|
});
|
|
}
|