Closed fwpascual closed 1 year ago
Thanks for calling this out! I need to take a closer look at the cucumber spec for expected behavior and try to wrap my head around your example. It's been a while since I touched the datatable code.
Can you explain why you expected the output to be:
Row[0][0] = a
Row[0][1] = b
Row[1][0] = 5
Row[1][1] = 10
Instead of:
Row[0][0] = a
Row[0][1] = b
Row[1][0] = 0
Row[1][1] = 1
Is it that you expect the datatable attached to the then
step to line up with the row in examples
? So given that you have <paramA> | <paramB>
on row 2, it'll read from row 2 in examples
?
For what it's worth, in my experience using the cucumber-jvm library, I've been able to use Example parameters in Data Table entries. However, I can't speak towards what the spec says.
Sorry for the confusion, I probably should have included the full output. The one I provided was only for the second example index. It's probably more accurate if Row
was DataTable
in the output too, but I'll leave it for now.
// First Example (where paramA=0, paramB=1 in the Examples table)
Match A = 0
Match B = 1
Row[0][0] = a
Row[0][1] = b
Row[1][0] = 0
Row[1][1] = 1
// Second Example (where paramA=5, paramB=10 in the Examples table)
Match A = 5
Match B = 10
Row[0][0] = a
Row[0][1] = b
Row[1][0] = 5
Row[1][1] = 10
My expectation is that for every scenario run, for steps with a DataTable, if there are cells in the DataTable that reference a param, they get string replaced with the matching entry from the currently executing Examples table row.
Ahha! I'm totally tracking now. The params were being replaced in the step, but not in the datatable. Seems like the library is only partially meeting expectations. Okay great! I'll get a test case in place and work on this as I have time (with a little luck, I can work on it this weekend)
This is fixed but for some reason I'm having deployment issues. If you need an immediate workaround point your package manager to the main branch, rather than a specific version.
I'll try and get the deployment issues fixed up ASAP
Alright, this is good to go in CucumberSwift v3.3.22
Awesome, thanks so much for addressing this so quickly!
Describe the bug When using a Scenario Outline and a step that uses a Data Table, the parameter in the Example is not substituted for the row entry in the data table.
To Reproduce Steps to reproduce the behavior:
Add a step definition:
Add a scenario outline such as:
Expected behavior For the second example, I expected an output like:
but instead received an output like:
Screenshots N/A
Additional context Add any other context about the problem here.