Skip to content

Instantly share code, notes, and snippets.

Created December 17, 2020 15:22
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
Star You must be signed in to star a gist
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) {
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