-
Notifications
You must be signed in to change notification settings - Fork 31
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Cucumber data table #56
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Hey @ron-brosh,
Thanks for the PR. I made a few suggestions and comments, please review.
lib/src/bdd_line.dart
Outdated
@@ -10,6 +10,10 @@ class BddLine { | |||
final LineType type; | |||
} | |||
|
|||
class DataTableBddLine extends BddLine { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Types for all other lines from features files are described in LineType
enum. Are there any reason why the data table line can not follow the same pattern?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Besides _lineTypeFromString which needs the next lines in order to determine the dataTable type, the
step enum is used in the generation logic which fails the tests when I add the new type.
It also adds a lot of boilerplate (will have to be repeated in multiple places):
if(type = LineType.step || type == LineType.dataTable)
LineType enum describes unique lines that can be map to those types.
A cucumber data table is determined by the combination of a step and examples.
I'll be happy to explore any proposal that might simplify and keep the existing convention though.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Added a new enum value dataTableStep and modified the StepFile.create to accept the domain model BDD line instead of its internal implementation details.
Co-authored-by: Oleksandr Leushchenko <[email protected]>
Co-authored-by: Oleksandr Leushchenko <[email protected]>
Co-authored-by: Oleksandr Leushchenko <[email protected]>
Co-authored-by: Oleksandr Leushchenko <[email protected]>
Co-authored-by: Oleksandr Leushchenko <[email protected]>
Based on the Cucumber documentation, there's a way to support tabular data using a class called DataTable.
That class can return the data to the consumer in three ways:
This PR adds the DataTable model with the first two use cases.