bdd_framework 1.0.0 bdd_framework: ^1.0.0 copied to clipboard
BDD framework for Dart/Flutter. Lets you create BDD tests in code, and gives you easy to read error messages when assertions fail. Exports to Gherkin/Cucumber feature files.
BDD Framework #
This package is brought to you by Zaher Hammoud, and myself, Marcelo Glasberg.
BDD framework for Dart/Flutter:
- Lets you create BDD tests in code.
- Gives you easy to read error messages when assertions fail.
- Exports to Gherkin/Cucumber
.feature
files (optional). - Does not need generated code to work.
1. Creating your BDD tests #
You create your BDD tests in code, not in .feature
files. For example:
var feature = BddFeature('Buying amount');
Bdd(feature)
.scenario('Buying amount for share based orders, zero fees.')
//
.given('The user has 120 dollars.')
.and('IBM share has bid-price 3 dollars, ask-price 10 dollars.')
.and('Fees are zero.')
//
.when('The user opens the order-form.')
//
.then('The buying amount is 12 shares.')
.and('It costs 120 dollars.')
//
.run((ctx) async {
// Given:
setCashBalance(120);
setSnapQuote(IBM, bidPrice: 3, askPrice: 10);
setFees(0);
// When:
var result = calculateOrderForm(IBM);
// Then:
expect(result.shares, 12);
expect(result.dollars, 120);
});
THE REST OF THE DOCUMENTATION IS COMING SOON!
Copyright #
This package is copyrighted and brought to you by Parkside Technologies, a company which is simplifying global access to US stocks.
This package is published here with permission.
Please, see the license page for more information.
The Flutter packages I've authored:
- async_redux
- provider_for_redux
- i18n_extension
- align_positioned
- network_to_file_image
- image_pixels
- matrix4_transform
- back_button_interceptor
- indexed_list_view
- animated_size_and_fade
- assorted_layout_widgets
- weak_map
- themed
- bdd_framework
My Medium Articles:
- Async Redux: Flutter’s non-boilerplate version of Redux (versions: Português)
- i18n_extension (versions: Português)
- Flutter: The Advanced Layout Rule Even Beginners Must Know (versions: русский)
- The New Way to create Themes in your Flutter App
My article in the official Flutter documentation:
Marcelo Glasberg:
github.com/marcglasberg
linkedin.com/in/marcglasberg/
twitter.com/glasbergmarcelo
stackoverflow.com/users/3411681/marcg
medium.com/@marcglasberg