text: ogurets_flutter 1.2.7
  This package extends the Ogurets package to allow to support Flutter. It brings in hooks desiged to add functionality around starting, restarting, taking screenshots, etc. You need to use Ogurets as w.
  Rather than repeat how Ogurets operates, check out its documentation.
  installing #
  in your
  dev_dependencies section in your
  pubspec.yaml include:
  ogurets_flutter: ^1.2.5
  or whichever is the higher version you see on this page.
  using Ogurets Flutter #
  When doing Gherkin steps with this plugin, you will generally want to have access to the flutter driver. As per the example, you can just inject this. Your test runner will had these additional features:
  void main(args) async { var def = OguretsOpts() ..feature("test_driver/features") ..instance(FlutterOgurets()) //..step(...) ..step(FlutterHooks) ..step(FlutterOguretsHelperStepdefs) // if you want to use the extended steps ; await def.run(); }
  If you are using the IntelliJ Plugin then this file and these additions are created for you automatically (as it detects it is a flutter project).
  When you wish access to the driver, just inject it as you would anything else.
  e.g.
  import 'package:ogurets/ogurets.dart'; import 'package:ogurets_flutter/ogurets_flutter.dart'; class CounterStepdefs { final FlutterOgurets _world; CounterStepdefs(this._world); @Then(r'the counter is {int}') void theCounterIs(int counter) async { // ... } }
  vscode #
  If you are using Visual Studio Code, you can debug the tests by adding a section like the following to your
  launch.json. This is for the example solution in the repository.
  { //Can't run this with the normal working directory because the Dart plugin helpfully tries to launch Flutter, and we //want to run it as dart. "name": "Debug E2E Tests", "request": "launch", "type": "dart", "program": "ogurets_flutter_test.dart", "cwd": "example/test_driver", "env": {"OGURETS_FLUTTER_WORKDIR":"..", "OGURETS_FLUTTER_START_TIMEOUT":"120", "OGURETS_ADDITIONAL_ARGUMENTS":""}, }
  The
  ogurets_flutter_test.dart file would have to be modified to look for features in that directory as well, since the launch configuration changes the cwd so that tests can be debugged. Otherwise, the Dart Code plugin attempts to launch as a Flutter rather than Dart debugger.
  ..feature('test_driver/features/counter.feature') ..feature('features'). Note the library it needs to know what
  the observatory port is (which is how Flutter and the Flutter Driver communicate). If you wish to include it in your test
  runs (say on CodeMagic), just use Dart itself and run your _test.dart runner, it will start your main app and control it.
  All of the normal Ogurets extensions work
  e.g.
  flutter emulators --launch apple_ios_simulator echo ios emulator launched echo running e2e tests export OGURETS_FLUTTER_FLAVOUR=dev2 export CUCUMBER_FOLDER=test_driver/features echo codemagic build servers are a wee bit slower than my laptop so... export OGURETS_FLUTTER_START_TIMEOUT=480 dart --enable-asserts --enable-vm-service:59546 test_driver/runner_test.dart
  If you wish to use the
  flutter driver command line tool, use ogurets directly and just enable the driver in
  an instance of your own to make it available to your steps.. It has been heavily modified in this version.