bdd_widget_test
3.1.0, released 7 days ago by leushchenko.com
Generate Flutter widget tests from Gherkin feature files
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 fileAlternatives
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.
77Compare - coverde
A CLI tool for optimizing test execution and manipulating code coverage trace files.
71Compare - patrol_log
Log package for Patrol, a Flutter-native UI testing framework
87Compare - flame_test
Classes and helpers for testing applications built with the Flame Engine.
80Compare
Works with
Packages commonly used together with bdd_widget_test: ones it builds on, ones built on it, and its own family.
- yamlbdd_widget_test depends on itA Dart library for parsing YAML documents into Dart data structures.
- package_configbdd_widget_test depends on itRead and write Dart package configuration files.
- dart_stylebdd_widget_test depends on itProvides an API and CLI to format Dart source code automatically.
- filebdd_widget_test depends on itPluggable, mockable file system abstraction for Dart with in-memory support.
- charactersbdd_widget_test depends on itUnicode and grapheme cluster aware string manipulation operations for Dart.
- buildbdd_widget_test depends on itPackage for authoring build_runner compatible code generators.
- diacriticbdd_widget_test depends on itRemoves common accents and diacritical signs from strings.
- cucumber_messagesbdd_widget_test depends on itDart types and helpers for Cucumber message protocol (NDJSON).