diff --git a/packages/e2e/CHANGELOG.md b/packages/e2e/CHANGELOG.md index 485d6c06182e..41653bb9b256 100644 --- a/packages/e2e/CHANGELOG.md +++ b/packages/e2e/CHANGELOG.md @@ -1,3 +1,8 @@ +## 0.2.2+1 + +* Fix pedantic lints. Adds a missing await in the example test and some missing + documentation. + ## 0.2.2 * Added a stub macos implementation diff --git a/packages/e2e/README.md b/packages/e2e/README.md index faeadf3b4df7..bafbff1e782d 100644 --- a/packages/e2e/README.md +++ b/packages/e2e/README.md @@ -47,7 +47,7 @@ import 'package:flutter_driver/flutter_driver.dart'; Future main() async { final FlutterDriver driver = await FlutterDriver.connect(); await driver.requestData(null, timeout: const Duration(minutes: 1)); - driver.close(); + await driver.close(); exit(result == 'pass' ? 0 : 1); } ``` @@ -118,9 +118,9 @@ To e2e test on a local Android device (emulated or physical): ## Firebase Test Lab -If this is you first time testing with Firebase Test Lab, -you'll need to follow the guides in the -[Firebase test lab documentation](https://firebase.google.com/docs/test-lab/?gclid=EAIaIQobChMIs5qVwqW25QIV8iCtBh3DrwyUEAAYASAAEgLFU_D_BwE) +If this is your first time testing with Firebase Test Lab, you'll need to follow +the guides in the [Firebase test lab +documentation](https://firebase.google.com/docs/test-lab/?gclid=EAIaIQobChMIs5qVwqW25QIV8iCtBh3DrwyUEAAYASAAEgLFU_D_BwE) to set up a project. To run an e2e test on Android devices using Firebase Test Lab, use gradle commands to build an diff --git a/packages/e2e/analysis_options.yaml b/packages/e2e/analysis_options.yaml deleted file mode 100644 index d4ccef63f1d1..000000000000 --- a/packages/e2e/analysis_options.yaml +++ /dev/null @@ -1,11 +0,0 @@ -# This is a temporary file to allow us to land a new set of linter rules in a -# series of manageable patches instead of one gigantic PR. It disables some of -# the new lints that are already failing on this plugin, for this plugin. It -# should be deleted and the failing lints addressed as soon as possible. - -include: ../../analysis_options.yaml - -analyzer: - errors: - public_member_api_docs: ignore - unawaited_futures: ignore diff --git a/packages/e2e/example/lib/main.dart b/packages/e2e/example/lib/main.dart index c1206d562f88..2509fb390ff4 100644 --- a/packages/e2e/example/lib/main.dart +++ b/packages/e2e/example/lib/main.dart @@ -1,6 +1,8 @@ import 'dart:io' show Platform; import 'package:flutter/material.dart'; +// ignore_for_file: public_member_api_docs + void main() => runApp(MyApp()); class MyApp extends StatefulWidget { diff --git a/packages/e2e/example/test_driver/example_e2e_test.dart b/packages/e2e/example/test_driver/example_e2e_test.dart index 4f38746ce76c..6147d44df2ec 100644 --- a/packages/e2e/example/test_driver/example_e2e_test.dart +++ b/packages/e2e/example/test_driver/example_e2e_test.dart @@ -7,6 +7,6 @@ Future main() async { final FlutterDriver driver = await FlutterDriver.connect(); final String result = await driver.requestData(null, timeout: const Duration(minutes: 1)); - driver.close(); + await driver.close(); exit(result == 'pass' ? 0 : 1); } diff --git a/packages/e2e/lib/e2e.dart b/packages/e2e/lib/e2e.dart index 2f8dc0ebac90..1feafc3cca34 100644 --- a/packages/e2e/lib/e2e.dart +++ b/packages/e2e/lib/e2e.dart @@ -11,6 +11,8 @@ import 'package:flutter/widgets.dart'; /// A subclass of [LiveTestWidgetsFlutterBinding] that reports tests results /// on a channel to adapt them to native instrumentation test format. class E2EWidgetsFlutterBinding extends LiveTestWidgetsFlutterBinding { + /// Sets up a listener to report that the tests are finished when everything is + /// torn down. E2EWidgetsFlutterBinding() { // TODO(jackson): Report test results as they arrive tearDownAll(() async { @@ -26,6 +28,10 @@ class E2EWidgetsFlutterBinding extends LiveTestWidgetsFlutterBinding { final Completer _allTestsPassed = Completer(); + /// Similar to [WidgetsFlutterBinding.ensureInitialized]. + /// + /// Returns an instance of the [E2EWidgetsFlutterBinding], creating and + /// initializing it if necessary. static WidgetsBinding ensureInitialized() { if (WidgetsBinding.instance == null) { E2EWidgetsFlutterBinding(); diff --git a/packages/e2e/pubspec.yaml b/packages/e2e/pubspec.yaml index cf5caf8017a9..596a2383db64 100644 --- a/packages/e2e/pubspec.yaml +++ b/packages/e2e/pubspec.yaml @@ -1,6 +1,6 @@ name: e2e description: Runs tests that use the flutter_test API as integration tests. -version: 0.2.2 +version: 0.2.2+1 author: Flutter Team homepage: https://github.com/flutter/plugins/tree/master/packages/e2e