You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
- Introduced `customHeaders` option in `GeneratorOptions` to allow custom imports and comments in generated step and feature files.
- Updated relevant files to utilize the new `customHeaders` feature, replacing default imports when specified.
- Enhanced documentation and examples to guide users on how to implement custom headers.
- Bumped version to 2.0.1.
Copy file name to clipboardExpand all lines: README.md
+28Lines changed: 28 additions & 0 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -315,6 +315,34 @@ targets:
315
315
include: package:<your_package>/bdd_options.yaml
316
316
```
317
317
318
+
### How to add custom headers to generated files?
319
+
320
+
You can add custom header lines (imports, comments, etc.) to all generated step files **and feature files** using the `customHeaders` option in the `build.yaml` file:
- Use custom test frameworks (like Patrol) instead of the default flutter_test
335
+
- Import custom helper classes or utilities in all your generated files
336
+
- Add specific packages that your tests will commonly use
337
+
- Include custom test utilities, mocks, or constants
338
+
- Add custom comments or documentation to generated files
339
+
340
+
**Important**: When `customHeaders` are provided, the default imports (`import 'package:flutter/material.dart';` and `import 'package:flutter_test/flutter_test.dart';`) are **not** automatically included in feature files, and the default `import 'package:flutter_test/flutter_test.dart';` is not included in step files. You have full control over what imports and content are added to your generated files.
341
+
342
+
The custom headers will be added to:
343
+
- **Feature files**: After any data table imports, replacing the default flutter/material and flutter_test imports
344
+
- **Step files**: After any data table imports, replacing the default flutter_test import
345
+
318
346
### How to group steps in a single project?
319
347
320
348
You may create sub-folders (like `common`, `login`, `home`, etc.) in the `step` folder and move generated steps there. The plugin is smart enough to find them (see the `example` folder).
0 commit comments