Skip to content

Commit

Permalink
fix(runner): Ensure scenario support files (world etc) as always disp…
Browse files Browse the repository at this point in the history
…osed ensure when test throws error
  • Loading branch information
jonsamwell committed Sep 16, 2021
1 parent ed88094 commit 3c0e1c6
Show file tree
Hide file tree
Showing 5 changed files with 50 additions and 44 deletions.
2 changes: 1 addition & 1 deletion .flutter-plugins-dependencies
Original file line number Diff line number Diff line change
@@ -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"}
{"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"}
4 changes: 4 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -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
Expand Down
80 changes: 41 additions & 39 deletions lib/src/flutter/runners/gherkin_integration_test_runner.dart
Original file line number Diff line number Diff line change
Expand Up @@ -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,
),
);

await hook.onAfterScenario(
configuration,
name,
scenarioTags,
);
scenarioTags,
);

await reporter.onScenarioStarted(
StartedMessage(
Target.scenario,
name,
debugInformation,
scenarioTags,
),
);

await runTest(dependencies);
} finally {
await reporter.onScenarioFinished(
ScenarioFinishedMessage(
name,
debugInformation,
true,
),
);

await hook.onAfterScenario(
configuration,
name,
scenarioTags,
);

cleanupScenarioRun(dependencies);
if (onAfter != null) {
await onAfter();
}

if (onAfter != null) {
await onAfter();
cleanupScenarioRun(dependencies);
}
},
timeout: scenarioExecutionTimeout,
Expand Down
6 changes: 3 additions & 3 deletions pubspec.lock
Original file line number Diff line number Diff line change
Expand Up @@ -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:
Expand Down Expand Up @@ -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
Expand Down
2 changes: 1 addition & 1 deletion pubspec.yaml
Original file line number Diff line number Diff line change
@@ -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:
Expand Down

0 comments on commit 3c0e1c6

Please sign in to comment.