fix(#76): fixed issue with tap back button step
This commit is contained in:
parent
465f8eb00f
commit
91a065e362
|
@ -1,3 +1,6 @@
|
|||
## [1.1.8+4] - 26/07/2020
|
||||
* Fixes #76
|
||||
|
||||
## [1.1.8+3] - 19/07/2020
|
||||
* Updated Gherkin library version to allow for function step implementations; updated docs to match.
|
||||
* Add steps `SiblingContainsText`, `SwipeOnKey`, `SwipeOnText`, `TapTextWithinWidget`, `TapWidgetOfType`, `TapWidgetOfTypeWithin`, `TapWidgetWithText`, `TextExists`, `TextExistsWithin`, `WaitUntilKeyExists`, and `WaitUntilTypeExists` . Thanks to @tshedor for the PR!
|
||||
|
|
|
@ -83,6 +83,15 @@ class _MyHomePageState extends State<MyHomePage> {
|
|||
key: const Key('counter'),
|
||||
style: Theme.of(context).textTheme.headline4,
|
||||
),
|
||||
FlatButton(
|
||||
child: Text('Open page 2'),
|
||||
onPressed: () {
|
||||
Navigator.push(
|
||||
context,
|
||||
MaterialPageRoute(builder: (context) => PageTwo()),
|
||||
);
|
||||
},
|
||||
)
|
||||
],
|
||||
),
|
||||
),
|
||||
|
@ -97,3 +106,20 @@ class _MyHomePageState extends State<MyHomePage> {
|
|||
);
|
||||
}
|
||||
}
|
||||
|
||||
class PageTwo extends StatelessWidget {
|
||||
@override
|
||||
Widget build(BuildContext context) {
|
||||
return Scaffold(
|
||||
appBar: AppBar(
|
||||
automaticallyImplyLeading: true,
|
||||
title: Text('Page 2'),
|
||||
),
|
||||
body: SafeArea(
|
||||
child: Center(
|
||||
child: Text('Contents of page 2'),
|
||||
),
|
||||
),
|
||||
);
|
||||
}
|
||||
}
|
||||
|
|
|
@ -0,0 +1,13 @@
|
|||
Feature: Navigation
|
||||
|
||||
@debug
|
||||
Scenario: User can navigate back from page two
|
||||
Given I expect the "counter" to be "0"
|
||||
When I tap the "increment" button
|
||||
Then I expect the "counter" to be "1"
|
||||
|
||||
Given I tap the label that contains the text "Open page 2"
|
||||
Then I expect the text "Contents of page 2" to be present
|
||||
|
||||
Given I tap the back button
|
||||
Then I expect the "counter" to be "1"
|
|
@ -1,5 +1,5 @@
|
|||
Feature: Drawer
|
||||
@debug
|
||||
|
||||
Scenario: should open the drawer
|
||||
Given I open the drawer
|
||||
Given I close the drawer
|
||||
|
|
File diff suppressed because one or more lines are too long
|
@ -191,9 +191,9 @@ class FlutterTestConfiguration extends TestConfiguration {
|
|||
stepDefinitions = List.from(stepDefinitions ?? [])
|
||||
..addAll([
|
||||
ThenExpectElementToHaveValue(),
|
||||
WhenTapBackButtonWidget(),
|
||||
WhenTapWidget(),
|
||||
WhenTapWidgetWithoutScroll(),
|
||||
WhenTapBackButtonWidget(),
|
||||
GivenOpenDrawer(),
|
||||
WhenPauseStep(),
|
||||
WhenFillFieldStep(),
|
||||
|
|
|
@ -30,3 +30,45 @@ StepDefinitionGeneric ThenExpectElementToHaveValue() {
|
|||
},
|
||||
);
|
||||
}
|
||||
|
||||
class AuthenticationSteps {
|
||||
static Iterable<StepDefinitionGeneric> steps = [
|
||||
StepOne(),
|
||||
StepFive(),
|
||||
];
|
||||
|
||||
static StepDefinitionGeneric StepOne() => given(
|
||||
'some step',
|
||||
(context) async {
|
||||
// do something
|
||||
},
|
||||
);
|
||||
|
||||
static StepDefinitionGeneric StepFive() => given2<String, int, FlutterWorld>(
|
||||
'step five with {string} and {int}',
|
||||
(str, value, context) async {
|
||||
// do something
|
||||
},
|
||||
);
|
||||
}
|
||||
|
||||
class AccountSteps {
|
||||
static Iterable<StepDefinitionGeneric> steps = [
|
||||
StepOne(),
|
||||
StepFive(),
|
||||
];
|
||||
|
||||
static StepDefinitionGeneric StepOne() => given(
|
||||
'some step account step',
|
||||
(context) async {
|
||||
// do something
|
||||
},
|
||||
);
|
||||
|
||||
static StepDefinitionGeneric StepFive() => given2<String, int, FlutterWorld>(
|
||||
'step five with {string} and {int}',
|
||||
(str, value, context) async {
|
||||
// do something
|
||||
},
|
||||
);
|
||||
}
|
||||
|
|
|
@ -11,9 +11,9 @@ import 'package:gherkin/gherkin.dart';
|
|||
/// `When I tap the back element"`
|
||||
/// `When I tap the back widget"`
|
||||
StepDefinitionGeneric WhenTapBackButtonWidget() {
|
||||
return when1<String, FlutterWorld>(
|
||||
return when<FlutterWorld>(
|
||||
RegExp(r'I tap the back (?:button|element|widget|icon|text)$'),
|
||||
(_, context) async {
|
||||
(context) async {
|
||||
await FlutterDriverUtils.tap(
|
||||
context.world.driver,
|
||||
find.pageBack(),
|
||||
|
|
11
pubspec.lock
11
pubspec.lock
|
@ -7,14 +7,14 @@ packages:
|
|||
name: _fe_analyzer_shared
|
||||
url: "https://pub.dartlang.org"
|
||||
source: hosted
|
||||
version: "5.0.0"
|
||||
version: "6.0.0"
|
||||
analyzer:
|
||||
dependency: transitive
|
||||
description:
|
||||
name: analyzer
|
||||
url: "https://pub.dartlang.org"
|
||||
source: hosted
|
||||
version: "0.39.13"
|
||||
version: "0.39.15"
|
||||
archive:
|
||||
dependency: transitive
|
||||
description:
|
||||
|
@ -50,6 +50,13 @@ packages:
|
|||
url: "https://pub.dartlang.org"
|
||||
source: hosted
|
||||
version: "1.1.3"
|
||||
cli_util:
|
||||
dependency: transitive
|
||||
description:
|
||||
name: cli_util
|
||||
url: "https://pub.dartlang.org"
|
||||
source: hosted
|
||||
version: "0.1.4"
|
||||
collection:
|
||||
dependency: transitive
|
||||
description:
|
||||
|
|
|
@ -1,6 +1,6 @@
|
|||
name: flutter_gherkin
|
||||
description: A Gherkin / Cucumber parser and test runner for Dart and Flutter
|
||||
version: 1.1.8+3
|
||||
version: 1.1.8+4
|
||||
homepage: https://github.com/jonsamwell/flutter_gherkin
|
||||
|
||||
environment:
|
||||
|
@ -18,7 +18,7 @@ dependencies:
|
|||
meta: ">=1.1.6 <2.0.0"
|
||||
gherkin: ^1.1.8+2
|
||||
# gherkin:
|
||||
# path: ../dart_gherkin
|
||||
# path: ../dart_gherkin
|
||||
|
||||
dev_dependencies:
|
||||
test:
|
||||
|
|
Loading…
Reference in New Issue