Skip to content
pubscout

bdd_widget_test

3.1.0, released 7 days ago by leushchenko.com

Generate Flutter widget tests from Gherkin feature files

$ flutter pub add bdd_widget_test
Source repository

What it does

bdd_widget_test parses *.feature files written in Gherkin and uses build_runner to generate plain Dart widget tests. The generated tests import material_ui and can include golden steps, making test writing natural language driven.

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

Use it when

  • BDD style widget testing
  • Team collaboration on test scenarios
  • Automated test generation from feature files
  • Feature driven development

Skip it when

  • Writing complex widget logic that requires custom test code
  • Projects that prefer hand‑written testWidgets without generation

Strengths

  • Easy to write tests in natural language
  • Integrates with build_runner for automatic code generation
  • Supports golden tests without extra packages
  • Provides an agent skill for step implementation

Weaknesses

  • Requires build_runner and material_ui dependencies
  • Only supports widget tests, not unit or integration tests
  • Relies on Gherkin syntax which may be unfamiliar to some developers

Setup

Kind
Pure Dart
Effort
Medium
Code generation
Yes (build_runner)
Direct dependencies
12

Add build_runner, bdd_widget_test, and material_ui to dev_dependencies. Run `dart run build_runner watch --delete-conflicting-outputs` to generate tests.

```dart
// feature file
Feature: Counter
  Scenario: Initial counter value is 0
    Given the app is running
    Then I see {'0'} text
```
// run build_runner to generate corresponding test file

Alternatives

Packages that do the same job and could replace bdd_widget_test.

  • bdd_framework

    Create BDD tests in Dart code with readable error messages and Gherkin feature file export.

  • coverde

    A CLI tool for optimizing test execution and manipulating code coverage trace files.

  • patrol_log

    Log package for Patrol, a Flutter-native UI testing framework

  • flame_test

    Classes and helpers for testing applications built with the Flame Engine.

Works with

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