-
Notifications
You must be signed in to change notification settings - Fork 125
Make data tables taggable (and possibly example table rows) #197
Comments
Ah. I forgot to mention. The first syntactical approach could be applied to example tables, the second approach is in fact how example tables work right now. |
Yeah, I don't like the first syntax either. Half the point of the Examples/Data part is using it to describe why the following rows are different instead of having seemingly random tags thrown in. I thought that someone had already raised the possibility of having datatables be a thing that could be in an example row (and that would achieve the effect that you are going for) but I'm not finding anything in the existing Issues or the Google Group. Edit: Closest thing that I've found is #52 |
I don't want to add tags on individual table rows. I want Gherkin editors (especially web-based ones) to be able to use standard grid/table components. That becomes hard when there are tags involved. I really don't like the proposed |
This has been proposed before in #142 - and rejected |
Um, reading through that thread it sounds like you came back around and were willing... |
It's not a hell yeah from me. I'm still not sure how it would be rendered in a table widget. |
Well, the proposals are one thing, the use cases are another: I keep running into this kind of usage in practice, unfortunately, and haven't found a better way to solve it in Gherkin. |
Until something better comes along, you could always go with
and let the step definition split the group into individual button checks. |
You're using it as a mechanism to parameterise a single scenario so you can run it against different applications. Do you see the difference? |
I see the difference, sure. I've commented many times when people abused this too much; my example with button names is such a bad example, as I've commented in the very first example I've given. My point revolved much more around locale testing, hence the specific example. Particularly with unicode, testing various locales isn't about content (i.e. is this title spelled correctly in Pakistani), but about functionality (does this Korean name get processed properly, i.e. is it mangled if it gets stored in the DB and retrieved at a later date). That is IMHO an entirely valid use case of |
@enkessler that is pretty much the hackaround I'm considering. It doesn't sit too well with me predominantly because the table cell data format needs to be understood by the folk writing the feature files, who might not like anything more complex than you propose. Your proposal fails when you need the semi-colon to be part of the data, which means you need escaping and a slightly more complex parser, and sooner or later somebody's going to say "let's just use JSON" and then non-technical folk are going to be overwhelmed. Practical, yes, but IMHO not desirable. I'd like to arrive at something that's desirable :) |
Just another thought: Not everything needs to be solved in Gherkin. |
Relating to my comment on cucumber/cucumber-ruby#821 about locale testing, if you run tests across multiple locales, data and example tables lend themselves to separating functional descriptions (steps) from locale-specific data (tables):
So far, so good. I love example tables and tagging for this :)
The problem occurs when you have to repeat the same action multiple times:
The approach doesn't scale well beyond a few repetitions, and really doesn't help with the "push how down" concept. A much better approach would be to group these into a single step:
Unfortunately, you can't do this with locales:
Unfortunately, I don't like the syntax very much like this. An alternative example would be:
The
Data
keyword would then be optional if no tags are used. Though I'll admit that might make the grammar trickier :-/The text was updated successfully, but these errors were encountered: