-
-
Notifications
You must be signed in to change notification settings - Fork 2k
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
Provide support for Data Tables with headings along the side #382
Comments
I'll accept a pull request for this. Suggestions:
|
I just needed this feature: if it's still on the radar I'll try to contribute it in, at least the |
@rlogiacco sure, go for it! Please do it on s branch. |
@aslakhellesoy sorry, what do you mean by s branch? I thought I had to fork and then submit a pull request... |
@rlogiacco sorry I meant separate branch :-) |
This is the transpose method idea, just to check if it meets general requirements public DataTable transpose() {
List<List<String>> transposed = new ArrayList<List<String>>();
for (int i = 0; i < gherkinRows.size(); i++) {
Row gherkinRow = gherkinRows.get(i);
for (int j = 0; j < gherkinRow.getCells().size(); j++) {
List<String> row = null;
if (j < transposed.size()) {
row = transposed.get(j);
}
if (row == null) {
row = new ArrayList<String>();
transposed.add(row);
}
// fixes non rectangular tables
while (i > row.size()) {
row.add(new String());
}
row.add(gherkinRow.getCells().get(j));
}
}
return DataTable.create(transposed);
} The idea here is to maintain the Please note the necessity to fix non rectangular tables by adding leading empty cells whenever necessary: I hope this is the expected behavior, but I never used the Ruby version so I need some confirmation on that. Any comment is very welcome :-D |
I had to change a few things here and there adding a private constructor to I've added some unit tests, I didn't try to cover the whole |
This thread has been automatically locked since there has not been any recent activity after it was closed. Please open a new issue for related bugs. |
Similar to classic Cucumber (Ruby version), Cucumber-JVM should support data tables with headings placed along the side. For example
The text was updated successfully, but these errors were encountered: