Details
Description
I would like to reuse Step classes and its methods in both scenarios that don't use example tables and also in scenarios that I want to use it.
For example:
This scenario we don't use example table, and its very flexible and reusable: Given that user is editing Suppliers When user input 12 for rankNumber And input 3300,00 for maxValue Then system sends a email to the managers with title 'Supplier rank was changed'.
For this work today I just need to create a step method like this:
@When("user inputs $value for $field") @Alias("inputs $value for $field") public void whenUserInputsValue(@Named("field") String pField, @Named("value") String pValue) { }
That step method is very reusable indeed a lot of scenarios could use it.
But if I want to use the benefit of an Example table in this scenario (maybe I found out others businesse rules that could be treat here too), I don't have this flexibility anymore, because Example table needs the steps sentence be fixed and table column matching @Named parameters.
So I will need to construct other method for the same purpose.
Today example tables need that the column tables match the parameter names
Activity
Cristiano Gavião
made changes -
Field | Original Value | New Value |
---|---|---|
Attachment | JBEHAVE-215-patch.txt [ 46327 ] |
Mauro Talevi
made changes -
Resolution | Won't Fix [ 2 ] | |
Status | Open [ 1 ] | Resolved [ 5 ] |
Maybe a solution could be to indicate on textual sentence both tableColumn and @named parameter to use.
For example: