Skip to content

Instantly share code, notes, and snippets.

Embed
What would you like to do?
import 'package:flutter_driver/flutter_driver.dart';
import 'package:test/test.dart';
void main() {
group('App name - home', () {
FlutterDriver driver;
setUpAll(() async {
driver = await FlutterDriver.connect();
});
tearDownAll(() async {
if (driver != null) {
driver.close();
}
});
test('list has row items', () async {
final timeline = await driver.traceAction(() async {
// wait for list items
await driver.waitFor(find.byValueKey('placesList'));
// get the first row in the list
final firstRow = find.descendant(
of: find.byValueKey('placesList'),
matching: find.byType('PlaceRow'),
firstMatchOnly: true);
// tap on the first row
await driver.tap(firstRow);
// wait for place details
await driver.waitFor(find.byValueKey("placeDetails"));
// go back to lists
await driver.tap(find.byTooltip('Back'));
});
// write summary to a file
final summary = new TimelineSummary.summarize(timeline);
await summary.writeSummaryToFile('ui_timeline', pretty: true);
await summary.writeTimelineToFile('ui_timeline', pretty: true);
});
});
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment