1
0
mirror of https://github.com/flutter/samples.git synced 2026-03-24 21:31:47 +00:00

Add an e2e (host-independent) test demo to testing_app (#515)

This commit is contained in:
Ming Lyu (CareF)
2020-08-13 18:00:22 -04:00
committed by GitHub
parent 437d1f620b
commit 824aeb5a16
11 changed files with 371 additions and 15 deletions

View File

@@ -0,0 +1,21 @@
// Copyright 2020 The Flutter team. All rights reserved.
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.
import 'dart:async';
import 'package:e2e/e2e_driver.dart' as driver;
Future<void> main() => driver.e2eDriver(responseDataCallback: (data) async {
await driver.writeResponseData(
data['scrolling'] as Map<String, dynamic>,
// This result is saved to `build/scrolling.json`.
testOutputFilename: 'scrolling',
);
await driver.writeResponseData(
data['favorites_operations'] as Map<String, dynamic>,
// This result is saved to `build/favorites_operations.json`.
testOutputFilename: 'favorites_operations',
);
});

View File

@@ -42,12 +42,12 @@ void main() {
final scrollingSummary = TimelineSummary.summarize(scrollingTimeline);
// Then, save the summary to disk.
// Results will be stored in the file 'build/scrolling.timeline.json'.
// Results will be stored in
// the file 'build/scrolling.timeline_summary.json'.
await scrollingSummary.writeSummaryToFile('scrolling', pretty: true);
// Write the entire timeline to disk in a json format.
// Results will be stored in
// the file 'build/scrolling.timeline_summary.json'.
// Results will be stored in the file 'build/scrolling.timeline.json'.
// This file can be opened in the Chrome browser's tracing tools
// found by navigating to chrome://tracing.
await scrollingSummary.writeTimelineToFile('scrolling', pretty: true);