Skip to content

Loading…

Improve handling of multiple example blocks within a Scenario Outline #1

Closed
SimonDexter opened this Issue · 7 comments

2 participants

@SimonDexter

Implement better handling of multiple example tables within a single Scenario Outline by retaining comments where possible and filtering out repeat parameter rows in example tables (see below example):-

Scenario Outline: Password validation
Given ...
When ...
Then ...

Examples: Too short
Passwords are invalid if less than 4 characters

| Password | Valid or invalid |
| abc | invalid |
| ab1 | invalid |

Examples: Letters and Numbers
Passwords need both letters and numbers to be valid

| Password | Valid or invalid |
| abc1 | valid |
| abcd | invalid |
| abcd1 | valid |

Currently Pickles output under v0.7 is something like:-

Password validation

Examples

| Password | Valid or invalid |
| abc | invalid |
| ab1 | invalid |
| Password | Valid or invalid |
| abc1 | valid |
| abcd | invalid |
| abcd1 | valid |

@x97mdr x97mdr added a commit that referenced this issue
@x97mdr x97mdr picklesdoc/pickles#1 Added the ability to reference multiple examples…
… in a scenario outline
c2aefd7
@x97mdr x97mdr was assigned
@x97mdr
picklesdoc member

I haven't had a chance to test this out on a project locally. Simon, if you get this can you grab the latest build from teamcity (or compile this) and let me know if it worked correctly? If not, I'll try it tomorrow.

@SimonDexter

Hi Jeff, pulled the latest build from Team City and tried it out today. Huge improvement I have to see, excellent work. A point that we spotted is that the descriptive label applied immediately after the "Example:" is not being shown. So from below:-

Examples: Too short
Passwords are invalid if less than 4 characters

| Password | Valid or invalid |
| abc | invalid |
| ab1 | invalid |

What we are seeing in the latest version of Pickles is the following (note the missing "Too short" label after Examples:):-

Examples:
Passwords are invalid if less than 4 characters

| Password | Valid or invalid |
| abc | invalid |
| ab1 | invalid |

Great work. Look forward to the next version :)

@x97mdr
picklesdoc member
@SimonDexter

Yes sure, here is a specflow source for a multi-example scenario outline with both example labels and description of each example underneath. I believe both are optional according to Cucumber:
http://screencast.com/t/RnCBv3x0A

This is the output I am getting from Pickles v0.8.55.0:
http://screencast.com/t/bM22D7JPl

Upon closer inspection there is also another problem I have just spotted and that is, if you have two scenario outlines with example tables in the same feature, the last example from the previous scenario outline appears as the first example in the next scenario outline.

This is the first scenario outline occurrence:
http://screencast.com/t/3JhBxVJ7m

This is the second scenario outline occurrence with the repeated example table from the first scenario:
http://screencast.com/t/CLBaMIlZqOPo

Hope this helps
:)

@x97mdr
picklesdoc member
@x97mdr x97mdr added a commit that referenced this issue
@x97mdr x97mdr picklesdoc/pickles#1 Fixed bug
The example name should now be produced in the output
bfec9c2
@x97mdr
picklesdoc member

Sorry, I haven't had much time to work on issues lately. I think its all fixed up now though

@x97mdr x97mdr added a commit that referenced this issue
@x97mdr x97mdr picklesdoc/pickles#1 Fixed second part of bug
If multiple scenario outlines are present in a file then the examples
are rendered appropriately
6b96615
@x97mdr x97mdr closed this
@SimonDexter

Thanks Jeff - I have gotten around to looking at multiple example blocks and they are looking much better!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Something went wrong with that request. Please try again.