Skip to content

Instantly share code, notes, and snippets.

@velotiotech
Created December 17, 2020 15:22
Show Gist options
  • Save velotiotech/aa4ff2e8ca9333d40cd529eb790d9557 to your computer and use it in GitHub Desktop.
Save velotiotech/aa4ff2e8ca9333d40cd529eb790d9557 to your computer and use it in GitHub Desktop.
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