bdd_widget_test 3.0.4
bdd_widget_test: ^3.0.4 copied to clipboard
A BDD-style widget testing library. Generates Flutter widget tests from *.feature files.
3.0.4 material_ui imports #
- Generated tests and predefined steps now import
package:material_ui/material_ui.dartinstead ofpackage:flutter/material.dart, which is deprecated since Flutter 3.47. Addmaterial_uito your app's dependencies (flutter pub add material_ui). Projects that setcustomHeaderskeep their own imports.
3.0.3 Flutter stable compatibility #
- Widen the
package_configconstraint to>=2.1.0 <4.0.0. Flutter stable pinstest_api, which holdstestto versions that needpackage_config2.x, so apps depending on bothtestand this package could not resolve dependencies.
3.0.2 Golden step #
- Replace the discontinued
golden_toolkitrecipe in the README and the agent skill with the new step (thanks @Fried-man). - Add the predefined
Then the screen matches golden {'name'}step. It compares the whole app withgoldens/<name>.pngusing Flutter's ownmatchesGoldenFile, so golden scenarios stay ordinarytestWidgetstests and need no extra package ortestMethodNameoverride. - Document loading real fonts for goldens and keeping one golden set per OS. The example does both.
3.0.1 Agent skill #
- Ship an agent skill for writing feature files and implementing
steps. Install it with
dart run skills@ get -p bdd_widget_test. - Fix
includeIntegrationTestBinding: falsebeing ignored when set inbdd_options.yaml(or a file it includes). It was only honoured inbuild.yaml.
3.0.0 Official Gherkin parser #
Feature files are now parsed by cucumber_gherkin, the
official Dart Gherkin parser, instead of the hand-written line scanner. All non-standard syntax this
package supports keeps working unchanged: After: sections, raw Dart lines above Feature:,
@testMethodName: value style tags, and several features in one file.
- BREAKING CHANGE: Malformed feature files now fail the build instead of being silently accepted.
Previously the unrecognised lines were dropped and a test file was generated anyway — usually one
that quietly tested less than it looked like it did. The build now stops on stray text inside a
feature, a mistyped scenario (
Scenrio:) or step keyword, a secondBackground:in the same feature, and a file holding no feature keyword at all — a missing, mistyped (Featur:) or commented-outFeature:line used to generate a test file with an emptymain(). Errors name the feature file, the line and the column. Description blocks are the exception, and it is one Gherkin itself defines: the lines between a keyword and the first step under it are description text, where any non-keyword line is legal. So prose is still prose — a description line that merely looks like a step, a*bullet or a sentence opening withAnd, is kept as documentation. The cost is that a keyword mistyped in that same position — a scenario's first step, or aScenrio:written directly underFeature:— is read as description too, and the steps under it are dropped without an error, unless the block ends up with no steps at all, in which case it is reported. Written anywhere below a block's first step, a mistyped keyword is always reported. A step keyword written with a colon (Given: the app is running) is no step in Gherkin either, and is reported the same way with the spelling to use; such steps used to run. - BREAKING CHANGE:
Scenario Outlinetest names no longer carry a fragment of the keyword.Scenario Outline: eatingnow generatestestWidgets('''eating (12, 5, 7)''')rather thantestWidgets('''Outline: eating (12, 5, 7)'''). Update any--plain-namefilters, IDE run configurations, or hooks that match on the scenario title —Hooks.beforeEachandHooks.afterEachreceive the new value. - BREAKING CHANGE: Steps written with the
*keyword now generate step calls. The line was previously unrecognised and dropped, so such scenarios produced an empty test body. Those tests now run their steps and may fail. - BREAKING CHANGE: Minimum Dart SDK is now 3.8.0.
- Add support for
Rule:. Each rule becomes a nestedgroup(), and a rule'sBackground:applies only to the scenarios inside it, running after the feature's own background. Tags on a rule are inherited by the scenarios it contains. Previously theRule:line was ignored and its background leaked onto unrelated scenarios. - Add support for localised feature files. All 80 Gherkin dialects work via the
# language: frheader, including localised keywords for features, backgrounds, scenario outlines and examples. As in Gherkin, the header counts only above the first feature keyword; written below one it is an ordinary comment and the file is read in English. An unsupported language code is reported.After:sections work in them too, and are rewritten into the keyword the file titles its scenarios with. - Fix a scenario outline with more than one
Examples:block generating a spurious test case from the second block's header row. - Fix
\|in a data table orExamples:cell generating\,. It is now a pipe inside the cell. Every other backslash in a cell is generated as written, so\nand\\stay the Dart escapes they were. - Fix lines above
Feature:being dropped when the feature file starts with a blank line, which silently removed custom imports from the generated file. - Fix several tags written on one line (
@integration @slow) becoming a single tag namedintegration @slow, which no--tagsfilter can ever match. Each tag on the line is now emitted separately, and a tag aRule:shares with a scenario inside it is emitted once instead of twice. - Fix titles that contain
$or'''generating a file that fails to compile.Feature: Price is $100producedgroup('''Price is $100'''), which Dart reads as an interpolation, and the build died with aFormatterExceptionquoting lines of a generated file rather than the.featurefile behind it. The same applied to rule titles, to the title a scenario outline builds from itsExamples:cells, to the title passed toHooks.beforeEachandHooks.afterEach, and to tag names. Apostrophes that cannot reach a delimiter — an ordinaryTest's scenario— are left as they were. - Fix step text that names nothing failing the build with a
FormatterExceptionabout generated code. A step's Dart file and function are named after the ASCII letters and digits in its text, and where there are none the generators wrote a step file called.dartholdingFuture<void> (WidgetTester tester) async, plus anawait (tester);call to go with it — neither of which compiles. That covers step text in a non-Latin script (Given アプリが起動している), a step named entirely by a parameter or an<outline placeholder>, one opening with a digit (Given 2FA is onbecame2faisOn), and one opening with an underscore (Given _debug mode is onbecame a_debugModeIsOnprivate to the step file, which the generated test imported and could not call). These now fail the build with the feature file, the line and the column instead. Step text in another script keeps working wherever the step also holds ASCII text to name it after, and accents are folded onto ASCII, solos diacríticos son útilis unaffected. - Add
cucumber_gherkinandcucumber_messagesdependencies; drop the unusedbuild_config.
2.1.4 Dart Workspace fix #
- Add package root resolution and update step folder handling for workspace builds
2.1.3 Data table special characters fix #
- Make placeholder replacement function more context-aware to avoid replacing special characters inside data table cells
2.1.2 Gherkin comments support #
- Add support for Gherkin comments (lines starting with
#)
2.1.1 Improve data table step detection #
- Fix data table step detection when combined with scenario outline
2.1.0 Update dependencies #
- Update min SDK to 3.7.0
- Update build_runner and dependencies (by @lsaudon)
- Remove Extra Curly Braces from Data Table Variables in Scenario Outlines (by @tide-khushal)
2.0.1 Custom headers support #
- Add
customHeadersconfiguration option to include custom header lines (imports, comments, etc.) in all generated step files and feature files
2.0.0 Upgrade dependencies #
- BREAKING CHANGE: The package doesn't provide pre-built steps anymore. Steps will appear in the
stepfolder. - Drop unused dependencies
- Upgrade
builddependency - Fix exceptions processing in hooks
1.8.2 Ignore linter warnings #
- Ignore all lint or warning rules in generated code by (@lsaudon)
1.8.1 Fix hook path on windows #
- Fix hook path on windows
- Update README - Replace Ruby syntax with Gherkin syntax (by @lsaudon)
1.8.0 Dependency updates #
- Update
dart_styleconstraint to^3.0.0
1.7.6 Add relativeToTestFolder #
- Add
relativeToTestFolderoption to control the generated step file location
1.7.5 Generic step generation fix #
- Fix generic step generation when parameters combined with data tables
1.7.4 Code formatting #
- Generated code is now properly formatted
1.7.3 Integration test improvements #
- Integration test imports will not be added if
integration_testpackage is not added todev_dependencies IntegrationTestWidgetsFlutterBinding.ensureInitialized();will not be added ifintegration_testpackage is not added todev_dependencies
1.7.2 Hotfix release for broken comments #
- In the previous release, comments were broken. This release fixes the issue.
1.7.1 Fix tags #
- Fix tags when specified in the header
- Skip duplicated empty lines in the header
1.7.0 Option to disable IntegrationTestBinding inclusion #
- Update dependencies (by @lsaudon)
- Add includeIntegrationTestBinding option to control
IntegrationTestWidgetsFlutterBinding.ensureInitialized();(by @eikebartels) - Fix data tables in background/after
1.6.4 Gherkin compliance #
- Add hooks (by @daniel-deboeverie-lemon)
- Add Cucumber data table support (by @ron-brosh)
1.6.3 Generic step usage comment (by @lsaudon) #
- Add a comment to the generated step implementation to show how to use the generated step
1.6.2 Generic step generation improvement (by @lsaudon) #
- Automatically detect parameter names in scenario outlines
- Audomatically detect parameter types in regular scenarios
1.6.1 Allow custom tester type, name and scenario parameters (by @mkhtradm01) #
- Allow addition of custom tester type from other test packages using
@testerType:tag the value can be likePatrolIntegrationTesterinstead ofWidgetTester(default) - Allow addition of custom tester name using
@testerName:tag, the value can be like$,integrationTestinstead oftesterleavingtester(default) - Allow passing scenario parameters using
@scenarioParams:tag, for example:@scenarioParams: skip: false, timeout: Timeout(Duration(seconds: 1))and many more. - Though these additions do not affect predefined steps.
1.6.0 Change step folder destination #
- BREAKING CHANGE - Introduce relative and absolute paths for step folder destination
If you didn't change the step folder name, you should not notice this change. However, if you changed it to a non-relative path (like
my_steps), from now, the plugin will create atest/my_stepsfolder. To prevent this behavior - make the step folder name relative, i.e. to./my_steps.
1.5.1 Bugfix #
- Fix Background/After sections for files with multiple features defined
1.5.0 Bugfix and new SDK constraints #
- Fix bug for feature tags (by @GuillaumeMorinQc)
- Apply stricter linter
- Update Dart SDK constraints
1.4.3 Multiple includes #
- Add multiple includes to the config file
1.4.2 Nested brackets #
- Fix nested brackets bug
1.4.1 Code coverage #
- 100% code coverage
1.4.0 'After' block improvement #
- BREAKING CHANGE - Make 'After' block execute even when the test fails (by @jamontes79)
1.3.2 Add diacritics support #
- Add diacritics support (thanks @vidibu)
1.3.1 Add tags #
- Add tags
1.3.0 Add bdd_options.yaml #
- Add possibility to store config outside of
build.yaml. Now we may re-use the same config (for exampleexternal_steps) across different packages.
1.2.1 Data Tables #
- Add data tables support
1.2.0 Scenario Outline #
- Add scenario outline support
1.1.0 Integration tests #
- Add support for integration tests
1.0.3+1 Custom step folder name hotix #
- Hotfix for ".." in custom step names
1.0.3 Custom step folder name #
- Add
stepFolderNameparameter that changes the step folder name
1.0.2 Update dependencies #
- Update plugin's dependencies
- Fix the "I dismiss the page" step
1.0.1 Tags #
- Add
testMethodNametag
1.0.0 Null safety #
- Migrate to null safety
0.7.1 Hotfix #
- External steps should have lower priority than local steps
0.7.0 External steps and build.yaml settings #
- Implement external steps
- Add a bunch of predefined external steps
- Add possibility to change
testMethodNameinbuild.yaml
0.6.1 Background/After fix #
- Fix paramteres in Background/After sections
0.6.0 Background/After refactoring #
- Before and After sections do not rely on default
setUp()andtearDown()methods - Add a
testerparameter to Before and After sections
0.5.0 Subfolders #
- Now it's possible to have subfolders in the
stepfolder
0.1.7 Internal release #
- Use
extra_pedantic - Update dependencies
0.1.6 'After' keyword #
- Add
Afterkeyword - avoid avoid_types_on_closure_parameters (by @kentcb)
0.1.5 Windows-friendly build #
- Fix code generation on Windows (by @kentcb)
0.1.4 More Gherkin keywords #
- Minor bug fixes
- Add more Tap events
- Add 'I Wait' step
0.1.3 More Gherkin keywords #
- Add
Backgroundkeyword - Add
directives_orderinglinter exception
0.1.2 More Gherkin keywords #
- Add
ExampleandButkeywords
0.1.1 Hotfix #
- Fix regular expressions for parameters parsing
0.1.0 First release #
- Basic feature and steps generation
- A few most common pre-built steps added