diff --git a/CHANGELOG.md b/CHANGELOG.md index 01e4c8e..f3ba78d 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,3 +1,6 @@ +## [1.0.9] - 03/09/2019 +* Added ability to define the working directory for the app to run the tests against + ## [1.0.8] - 25/08/2019 * Updated to latest dart_gherkin lib which now has support for 'Scenerio Outline' and 'Example' blocks diff --git a/lib/src/flutter/flutter_run_process_handler.dart b/lib/src/flutter/flutter_run_process_handler.dart index 139a2f6..82f1f8e 100644 --- a/lib/src/flutter/flutter_run_process_handler.dart +++ b/lib/src/flutter/flutter_run_process_handler.dart @@ -23,9 +23,9 @@ class FlutterRunProcessHandler extends ProcessHandler { Process _runningProcess; Stream _processStdoutStream; List _openSubscriptions = []; + bool _buildApp = true; String _workingDirectory; String _appTarget; - bool _buildApp = true; String _buildFlavor; String _deviceTargetId; String currentObservatoryUri; diff --git a/lib/src/flutter/flutter_test_configuration.dart b/lib/src/flutter/flutter_test_configuration.dart index f3939f4..7ad6c59 100644 --- a/lib/src/flutter/flutter_test_configuration.dart +++ b/lib/src/flutter/flutter_test_configuration.dart @@ -23,7 +23,11 @@ class FlutterTestConfiguration extends TestConfiguration { /// Defaults to "lib/test_driver/app.dart" String targetAppPath = "lib/test_driver/app.dart"; - /// The build flavor to run the tests against + /// Option to define the working directory for the process that runs the app under test (optional) + /// Handy if your app is seperated from your tests as flutter needs to be able to find a pubspec file + String targetAppWorkingDirecotry; + + /// The build flavor to run the tests against (optional) /// Defaults to empty String buildFlavor = ""; diff --git a/lib/src/flutter/hooks/app_runner_hook.dart b/lib/src/flutter/hooks/app_runner_hook.dart index c9d9097..ef6778e 100644 --- a/lib/src/flutter/hooks/app_runner_hook.dart +++ b/lib/src/flutter/hooks/app_runner_hook.dart @@ -53,6 +53,8 @@ class FlutterAppRunnerHook extends Hook { Future _runApp(FlutterTestConfiguration config) async { _flutterRunProcessHandler = FlutterRunProcessHandler(); _flutterRunProcessHandler.setApplicationTargetFile(config.targetAppPath); + _flutterRunProcessHandler + .setWorkingDirectory(config.targetAppWorkingDirecotry); _flutterRunProcessHandler .setBuildRequired(haveRunFirstScenario ? false : config.build); _flutterRunProcessHandler.setBuildFlavor(config.buildFlavor); diff --git a/pubspec.yaml b/pubspec.yaml index 214eba6..aafaf45 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: 1.0.8 +version: 1.0.9 author: Jon Samwell homepage: https://github.com/jonsamwell/flutter_gherkin