Skip to content

Commit

Permalink
Merge pull request #85 from doubleo2/step-timeout-issue
Browse files Browse the repository at this point in the history
Step timeout issue
  • Loading branch information
jonsamwell authored Sep 20, 2020
2 parents ef4fd52 + 1a260bb commit d01b4d5
Show file tree
Hide file tree
Showing 3 changed files with 18 additions and 0 deletions.
10 changes: 10 additions & 0 deletions example/lib/main.dart
Original file line number Diff line number Diff line change
Expand Up @@ -85,7 +85,16 @@ class _MyHomePageState extends State<MyHomePage> {
style: Theme.of(context).textTheme.headline4,
),
FlatButton(
key: Key('openPage2'),
child: Text('Open page 2'),
onLongPress: () {
Future.delayed(
Duration(seconds: 12),
() => Navigator.push(
context,
MaterialPageRoute(builder: (context) => PageTwo()),
));
},
onPressed: () {
Navigator.push(
context,
Expand Down Expand Up @@ -129,6 +138,7 @@ class PageTwo extends StatelessWidget {
@override
Widget build(BuildContext context) {
return Scaffold(
key: Key('pageTwo'),
appBar: AppBar(
automaticallyImplyLeading: true,
title: Text('Page 2'),
Expand Down
6 changes: 6 additions & 0 deletions example/test_driver/features/counter_increases_slowly.feature
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
Feature: Delayed navigation

Scenario: User can navigate to page two. Eventually
Given I expect the "counter" to be "0"
When I long press the "openPage2" button
Then I expect the widget "pageTwo" to be present within 15 seconds
Original file line number Diff line number Diff line change
Expand Up @@ -24,5 +24,7 @@ StepDefinitionGeneric ThenExpectWidgetToBePresent() {
);
context.expect(isPresent, true);
},
configuration: StepDefinitionConfiguration()
..timeout = Duration(days: 9999)
);
}

0 comments on commit d01b4d5

Please sign in to comment.