diff --git a/.flutter-plugins-dependencies b/.flutter-plugins-dependencies index 1964b3d..767068c 100644 --- a/.flutter-plugins-dependencies +++ b/.flutter-plugins-dependencies @@ -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\\\\packages\\\\integration_test\\\\","dependencies":[]}],"android":[{"name":"integration_test","path":"C:\\\\Google\\\\flutter\\\\packages\\\\integration_test\\\\","dependencies":[]}],"macos":[],"linux":[],"windows":[],"web":[]},"dependencyGraph":[{"name":"integration_test","dependencies":[]}],"date_created":"2021-09-15 14:52:31.748089","version":"2.5.0"} \ No newline at end of file +{"info":"This is a generated file; do not edit or check into version control.","plugins":{"ios":[{"name":"integration_test","path":"C:\\\\Google\\\\flutter\\\\packages\\\\integration_test\\\\","dependencies":[]}],"android":[{"name":"integration_test","path":"C:\\\\Google\\\\flutter\\\\packages\\\\integration_test\\\\","dependencies":[]}],"macos":[],"linux":[],"windows":[],"web":[]},"dependencyGraph":[{"name":"integration_test","dependencies":[]}],"date_created":"2021-09-16 11:36:24.117283","version":"2.5.0"} \ No newline at end of file diff --git a/CHANGELOG.md b/CHANGELOG.md index c1d22a0..20a92dd 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,3 +1,7 @@ +## [3.0.0-rc.5] - 22/06/2021 + +- Ensure scenario support files (world etc) as always disposed ensure when test throws error + ## [3.0.0-rc.4] - 21/06/2021 - Removed debug code diff --git a/lib/src/flutter/runners/gherkin_integration_test_runner.dart b/lib/src/flutter/runners/gherkin_integration_test_runner.dart index 08e00b2..ce41204 100644 --- a/lib/src/flutter/runners/gherkin_integration_test_runner.dart +++ b/lib/src/flutter/runners/gherkin_integration_test_runner.dart @@ -150,52 +150,54 @@ abstract class GherkinIntegrationTestRunner { tester, ); - await hook.onBeforeScenario( - configuration, - name, - scenarioTags, - ); - - await startApp( - tester, - dependencies.world, - ); - - await hook.onAfterScenarioWorldCreated( - dependencies.world, - name, - scenarioTags, - ); - - await reporter.onScenarioStarted( - StartedMessage( - Target.scenario, + try { + await hook.onBeforeScenario( + configuration, name, - debugInformation, scenarioTags, - ), - ); + ); - await runTest(dependencies); + await startApp( + tester, + dependencies.world, + ); - await reporter.onScenarioFinished( - ScenarioFinishedMessage( + await hook.onAfterScenarioWorldCreated( + dependencies.world, name, - debugInformation, - true, - ), - ); + scenarioTags, + ); - await hook.onAfterScenario( - configuration, - name, - scenarioTags, - ); + await reporter.onScenarioStarted( + StartedMessage( + Target.scenario, + name, + debugInformation, + scenarioTags, + ), + ); - cleanupScenarioRun(dependencies); + await runTest(dependencies); + } finally { + await reporter.onScenarioFinished( + ScenarioFinishedMessage( + name, + debugInformation, + true, + ), + ); - if (onAfter != null) { - await onAfter(); + await hook.onAfterScenario( + configuration, + name, + scenarioTags, + ); + + if (onAfter != null) { + await onAfter(); + } + + cleanupScenarioRun(dependencies); } }, timeout: scenarioExecutionTimeout, diff --git a/pubspec.lock b/pubspec.lock index 2843747..6bcee36 100644 --- a/pubspec.lock +++ b/pubspec.lock @@ -7,14 +7,14 @@ packages: name: _fe_analyzer_shared url: "https://pub.dartlang.org" source: hosted - version: "25.0.0" + version: "26.0.0" analyzer: dependency: "direct main" description: name: analyzer url: "https://pub.dartlang.org" source: hosted - version: "2.2.0" + version: "2.3.0" archive: dependency: transitive description: @@ -249,7 +249,7 @@ packages: name: pubspec_parse url: "https://pub.dartlang.org" source: hosted - version: "1.0.0" + version: "1.1.0" sky_engine: dependency: transitive description: flutter diff --git a/pubspec.yaml b/pubspec.yaml index 0c4a293..702801c 100644 --- a/pubspec.yaml +++ b/pubspec.yaml @@ -1,6 +1,6 @@ name: flutter_gherkin description: A Gherkin / Cucumber parser and test runner for Dart and Flutter -version: 3.0.0-rc.4 +version: 3.0.0-rc.5 homepage: https://github.com/jonsamwell/flutter_gherkin environment: