fix(steps): ensure app is pumped after step actions

This commit is contained in:
Jon Samwell 2021-02-10 11:35:52 +11:00
parent 1788439015
commit 5f0201101e
13 changed files with 31 additions and 29 deletions

View File

@ -1,2 +1,2 @@
# This is a generated file; do not edit or check into version control.
integration_test=C:\\Google\\flutter\\.pub-cache\\hosted\\pub.dartlang.org\\integration_test-1.0.1\\
integration_test=C:\\Google\\flutter\\.pub-cache\\hosted\\pub.dartlang.org\\integration_test-1.0.2+2\\

View File

@ -1 +1 @@
{"info":"This is a generated file; do not edit or check into version control.","plugins":{"ios":[{"name":"integration_test","path":"C:\\\\Google\\\\flutter\\\\.pub-cache\\\\hosted\\\\pub.dartlang.org\\\\integration_test-1.0.1\\\\","dependencies":[]}],"android":[{"name":"integration_test","path":"C:\\\\Google\\\\flutter\\\\.pub-cache\\\\hosted\\\\pub.dartlang.org\\\\integration_test-1.0.1\\\\","dependencies":[]}],"macos":[],"linux":[],"windows":[],"web":[]},"dependencyGraph":[{"name":"integration_test","dependencies":[]}],"date_created":"2021-02-08 13:58:53.374402","version":"1.22.6"}
{"info":"This is a generated file; do not edit or check into version control.","plugins":{"ios":[{"name":"integration_test","path":"C:\\\\Google\\\\flutter\\\\.pub-cache\\\\hosted\\\\pub.dartlang.org\\\\integration_test-1.0.2+2\\\\","dependencies":[]}],"android":[{"name":"integration_test","path":"C:\\\\Google\\\\flutter\\\\.pub-cache\\\\hosted\\\\pub.dartlang.org\\\\integration_test-1.0.2+2\\\\","dependencies":[]}],"macos":[],"linux":[],"windows":[],"web":[]},"dependencyGraph":[{"name":"integration_test","dependencies":[]}],"date_created":"2021-02-10 11:35:15.103743","version":"1.22.6"}

View File

@ -37,6 +37,8 @@ StepDefinitionGeneric GivenOpenDrawer() {
timeout: context.configuration?.timeout,
);
}
await context.world.appDriver.waitForAppToSettle();
},
);
}

View File

@ -37,10 +37,11 @@ StepDefinitionGeneric TapTextWithinWidgetStep() {
);
}
await await context.world.appDriver.tap(
await context.world.appDriver.tap(
finder,
timeout: timeout,
);
await context.world.appDriver.waitForAppToSettle();
},
);
}

View File

@ -20,6 +20,7 @@ StepDefinitionGeneric TapWidgetOfTypeStep() {
FindType.type,
),
);
await context.world.appDriver.waitForAppToSettle();
},
);
}

View File

@ -17,9 +17,8 @@ StepDefinitionGeneric TapWidgetOfTypeWithinStep() {
context.world.appDriver.findBy(widgetType, FindType.type),
firstMatchOnly: true,
);
await context.world.appDriver.tap(
finder,
);
await context.world.appDriver.tap(finder);
await context.world.appDriver.waitForAppToSettle();
},
);
}

View File

@ -16,9 +16,8 @@ StepDefinitionGeneric TapWidgetWithTextStep() {
(input1, context) async {
final finder = context.world.appDriver.findBy(input1, FindType.text);
await context.world.appDriver.scrollIntoView(finder);
await context.world.appDriver.tap(
finder,
);
await context.world.appDriver.tap(finder);
await context.world.appDriver.waitForAppToSettle();
},
);
}

View File

@ -17,6 +17,8 @@ StepDefinitionGeneric WhenFillFieldStep() {
finder,
value,
);
await context.world.appDriver.waitForAppToSettle();
},
);
}

View File

@ -23,12 +23,9 @@ StepDefinitionGeneric WhenLongPressWidget() {
(key, context) async {
final finder = context.world.appDriver.findBy(key, FindType.key);
await context.world.appDriver.scrollIntoView(
finder,
);
await context.world.appDriver.longPress(
finder,
);
await context.world.appDriver.scrollIntoView(finder);
await context.world.appDriver.longPress(finder);
await context.world.appDriver.waitForAppToSettle();
},
);
}

View File

@ -48,7 +48,7 @@ StepDefinitionGeneric WhenTapWidgetWithoutScroll() {
await context.world.appDriver.tap(
finder,
);
await context.world.appDriver.waitForAppToSettle();
},
);

View File

@ -3,9 +3,9 @@ import 'package:flutter_gherkin/flutter_gherkin.dart';
import '../runners/flutter_run_process_handler.dart';
/// Driver version of the FlutterWorld with a typed driver
class FlutterDriverWorld
extends FlutterTypedAdapterWorld<FlutterDriver, SerializableFinder, dynamic> {
/// Driver version of the FlutterWorld with a typed driver
class FlutterDriverWorld extends FlutterTypedAdapterWorld<FlutterDriver,
SerializableFinder, dynamic> {
FlutterRunProcessHandler _flutterRunProcessHandler;
void setFlutterDriver(FlutterDriver flutterDriver) {

View File

@ -38,5 +38,6 @@ class FlutterTypedAdapterWorld<TDriver, TFinder, TWidget> extends FlutterWorld {
/// The adapter that is used to agnostically drive the app under test
@override
AppDriverAdapter<TDriver, TFinder, TWidget> get appDriver => _adapter as AppDriverAdapter<TDriver, TFinder, TWidget>;
AppDriverAdapter<TDriver, TFinder, TWidget> get appDriver =>
_adapter as AppDriverAdapter<TDriver, TFinder, TWidget>;
}

View File

@ -49,7 +49,7 @@ packages:
name: build
url: "https://pub.dartlang.org"
source: hosted
version: "1.6.1"
version: "1.6.2"
build_config:
dependency: "direct main"
description:
@ -204,7 +204,7 @@ packages:
name: integration_test
url: "https://pub.dartlang.org"
source: hosted
version: "1.0.1"
version: "1.0.2+2"
io:
dependency: transitive
description:
@ -281,7 +281,7 @@ packages:
name: node_preamble
url: "https://pub.dartlang.org"
source: hosted
version: "1.4.12"
version: "1.4.13"
package_config:
dependency: transitive
description:
@ -337,7 +337,7 @@ packages:
name: pubspec_parse
url: "https://pub.dartlang.org"
source: hosted
version: "0.1.7"
version: "0.1.8"
shelf:
dependency: transitive
description:
@ -351,21 +351,21 @@ packages:
name: shelf_packages_handler
url: "https://pub.dartlang.org"
source: hosted
version: "2.0.0"
version: "2.0.1"
shelf_static:
dependency: transitive
description:
name: shelf_static
url: "https://pub.dartlang.org"
source: hosted
version: "0.2.9+1"
version: "0.2.9+2"
shelf_web_socket:
dependency: transitive
description:
name: shelf_web_socket
url: "https://pub.dartlang.org"
source: hosted
version: "0.2.3"
version: "0.2.4"
sky_engine:
dependency: transitive
description: flutter
@ -510,7 +510,7 @@ packages:
name: webkit_inspection_protocol
url: "https://pub.dartlang.org"
source: hosted
version: "0.7.4"
version: "0.7.5"
yaml:
dependency: transitive
description:
@ -520,4 +520,4 @@ packages:
version: "2.2.1"
sdks:
dart: ">=2.10.0 <2.11.0"
flutter: ">=1.17.0 <2.0.0"
flutter: ">=1.17.0"