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:
21
testing_app/test_driver/e2e_test.dart
Normal file
21
testing_app/test_driver/e2e_test.dart
Normal 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',
|
||||
);
|
||||
});
|
||||
@@ -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);
|
||||
|
||||
Reference in New Issue
Block a user