This commit is contained in:
Jon Samwell 2020-05-08 09:39:15 +10:00
commit 83d4491e98
4 changed files with 9 additions and 6 deletions

View File

@ -1,7 +1,9 @@
## [1.1.8] - 08/05/2020
* Updated library to work with the new way the Flutter stable branch manages logging for Flutter driver
* Fixed spelling mistake of `targetAppWorkingDirectory` & `flutterDriverMaxConnectionAttempts` in `FlutterTestConfiguration`
* Added the ability to test against an already running app; enabling you to debug a running application while it has tests executed against it. Setting the configuration property `runningAppProtocolEndpointUri` to the service protocol endpoint (found in stdout when an app has `--verbose` logging turned on) will ensure that the existing app is connected to rather than starting a new instance of the app. NOTE: ensure the app you are trying to connect to calls `enableFlutterDriverExtension()` when it starts up otherwise the Flutter Driver will not be able to connect to it.
* **BREAKING CHANGE** Fixed spelling mistake of `targetAppWorkingDirectory` & `flutterDriverMaxConnectionAttempts` in `FlutterTestConfiguration`
* **BREAKING CHANGE** reverse order of `driver` and `finder` in `FlutterDriverUtils#isPresent`. This makes this method's arguments more consistent with all other instance methods in the class by including `driver` first.
* `expect` the presence of `ThenExpectWidgetToBePresent`. If the widget was not present, the method would simply timeout and not report an error for the step.
## [1.1.7+6] - 04/03/2020
* Updated to latest Gherkin library (see https://github.com/jonsamwell/dart_gherkin/blob/master/CHANGELOG.md#117---04032020) - this includes a breaking change to the `Hook` inteface that will need to be updated if any of the `Scenerio` level methods are implemented

View File

@ -16,7 +16,7 @@ class GivenOpenDrawer extends Given1WithWorld<String, FlutterWorld> {
Future<void> executeStep(String action) async {
final drawerFinder = find.byType('Drawer');
final isOpen =
await FlutterDriverUtils.isPresent(drawerFinder, world.driver);
await FlutterDriverUtils.isPresent(world.driver, drawerFinder);
// https://github.com/flutter/flutter/issues/9002#issuecomment-293660833
if (isOpen && action == 'close') {
// Swipe to the left across the whole app to close the drawer

View File

@ -20,10 +20,11 @@ class ThenExpectWidgetToBePresent
@override
Future<void> executeStep(String key, int seconds) async {
await FlutterDriverUtils.isPresent(
find.byValueKey(key),
final isPresent = await FlutterDriverUtils.isPresent(
world.driver,
find.byValueKey(key),
timeout: Duration(seconds: seconds),
);
expect(isPresent, true);
}
}

View File

@ -4,8 +4,8 @@ import 'package:flutter_driver/flutter_driver.dart';
class FlutterDriverUtils {
static Future<bool> isPresent(
SerializableFinder finder,
FlutterDriver driver, {
FlutterDriver driver,
SerializableFinder finder, {
Duration timeout = const Duration(seconds: 1),
}) async {
try {