Skip to content
pubscout

flutter_gherkin

2.0.0, released 5 years ago by an unverified publisher

Gherkin parser and test runner for Dart and Flutter behavior-driven development.

Quiet but busy
$ flutter pub add flutter_gherkin
Source repository

What it does

A Gherkin parser and test runner that lets developers write behavior-driven development (BDD) feature files and test scenarios for Flutter applications. It integrates with Flutter Driver to automate user interactions and check states across various devices.

AI-written summary of version 2.0.0, based on the package's README and metadata. Report an inaccuracy

Use it when

  • You want to practice Behavior-Driven Development (BDD) using Gherkin syntax in Flutter
  • You need to run feature files and scenarios against a running Flutter application via Flutter Driver

Skip it when

  • You prefer standard unit and widget testing without BDD syntax
  • You require packages that rely on reflection for step definitions

Strengths

  • Full Gherkin syntax and Cucumber-like test runner support
  • Built-in step definitions and helper utilities for Flutter Driver
  • Supports custom step parameters, hooks, and multiple reporting formats

Weaknesses

  • Does not use reflection, so custom classes like steps, hooks, and reporters must be explicitly registered
  • Requires manual configuration and test driver setup

Setup

Kind
Flutter widgets
Effort
Medium
Code generation
No
Direct dependencies
4

Requires creating a test_driver file to enable the Flutter driver extension, configuring feature files, and manually wiring step definitions.

import 'package:flutter_gherkin/flutter_gherkin.dart';
import 'package:gherkin/gherkin.dart';

Future<void> main() {
  final config = FlutterTestConfiguration()
    ..features = [RegExp('features/*.*.feature')]
    ..reporters = [StdoutReporter()]
    ..targetAppPath = "test_driver/app.dart";
  return GherkinRunner().execute(config);
}

Alternatives

Packages that do the same job and could replace flutter_gherkin.

Works with

Packages commonly used together with flutter_gherkin: ones it builds on, ones built on it, and its own family.