Chris Young
2012-05-04 07:14:28 UTC
Hi,
A lot of the scenarios I deal with involve two dimensional data sets.
In the example below we are interested in the viewing figures for a number of TV
channels over time owned by the BBC.
Scenario: Get viewing figures owned by the BBC channels over first five days of 2012
Given I am interested in the channels for BBC
And I am interested in how viewing figures for these channels between 2012-01-01 and 2012-01-05
When I go to http://channelstats/BBC
Then I should see:
| | 2012-01-01 | 2012-01-02 | 2012-01-03 | 2012-01-04 | 2012-01-05 |
| BBC 1 | 2000 | 2002 | 2005 | 2004 | 1900 |
| BBC 2 | 1000 | 1012 | 1001 | 1004 | 900 |
| CBBC | 100 | 101 | 101 | 102 | 80 |
My question is, how do I turn it into a Scenario Outline so I can use the same Scenario
for a number of channel owners.
For the atomic elements it's straightforward enough
But how do you paramaterise the Data Table in the 'Then' step?
What I'm looking for is something like this:
Scenario Outline: Get viewing figures for an owners channels over a given period
Given I am interested in the channels for <ChannelOwner>
And I am interested in how viewing figures for these channels between <StartDate> and <EndDate>
When I go to http://channelstats/<ChannelOwner>
Then I should see:
<ViewingFigures>
Examples: UK Channel Groups
| ChannelOwner | StartDate | EndDate | ViewingFigures |
| BBC | 2012-01-01 | 2012-01-05 | <BBCViewingFigures> |
| ITV | 2012-01-01 | 2012-01-05 | <ITVViewingFigures> |
Placeholder: BBCViewingFigures
| | 2012-01-01 | 2012-01-02 | 2012-01-03 | 2012-01-04 | 2012-01-05 |
| BBC 1 | 2000 | 2002 | 2005 | 2004 | 1900 |
| BBC 2 | 1000 | 1012 | 1001 | 1004 | 900 |
| CBBC | 100 | 101 | 101 | 102 | 80 |
Placeholder: ITVViewingFigures
| | 2012-01-01 | 2012-01-02 | 2012-01-03 | 2012-01-04 | 2012-01-05 |
| ITV 1 | 2000 | 2002 | 3005 | 4004 | 5900 |
| ITV 2 | 3000 | 3012 | 3010 | 3014 | 2900 |
| ITV 3 | 1100 | 1101 | 101 | 102 | 80 |
| ITV 4 | 200 | 201 | 201 | 202 | 180 |
Is there a way of expressing this in Gherkin? I can think of ways round it but would they're all pretty ugly :-{
Thanks
Chris
-- There are two rules:
1) Please prefix the subject with [Ruby], [JVM] or [JS]. This allows people to filter messages.
2) Please use interleaved answers http://en.wikipedia.org/wiki/Posting_style#Interleaved_style
You received this message because you are subscribed to the Google Groups Cukes group. To post to this group, send email to cukes-/JYPxA39Uh5TLH3MbocFF+G/***@public.gmane.org To unsubscribe from this group, send email to cukes+***@googlegroups.com. For more options, visit this group at https://groups.google.com/d/forum/cukes?hl=en
A lot of the scenarios I deal with involve two dimensional data sets.
In the example below we are interested in the viewing figures for a number of TV
channels over time owned by the BBC.
Scenario: Get viewing figures owned by the BBC channels over first five days of 2012
Given I am interested in the channels for BBC
And I am interested in how viewing figures for these channels between 2012-01-01 and 2012-01-05
When I go to http://channelstats/BBC
Then I should see:
| | 2012-01-01 | 2012-01-02 | 2012-01-03 | 2012-01-04 | 2012-01-05 |
| BBC 1 | 2000 | 2002 | 2005 | 2004 | 1900 |
| BBC 2 | 1000 | 1012 | 1001 | 1004 | 900 |
| CBBC | 100 | 101 | 101 | 102 | 80 |
My question is, how do I turn it into a Scenario Outline so I can use the same Scenario
for a number of channel owners.
For the atomic elements it's straightforward enough
But how do you paramaterise the Data Table in the 'Then' step?
What I'm looking for is something like this:
Scenario Outline: Get viewing figures for an owners channels over a given period
Given I am interested in the channels for <ChannelOwner>
And I am interested in how viewing figures for these channels between <StartDate> and <EndDate>
When I go to http://channelstats/<ChannelOwner>
Then I should see:
<ViewingFigures>
Examples: UK Channel Groups
| ChannelOwner | StartDate | EndDate | ViewingFigures |
| BBC | 2012-01-01 | 2012-01-05 | <BBCViewingFigures> |
| ITV | 2012-01-01 | 2012-01-05 | <ITVViewingFigures> |
Placeholder: BBCViewingFigures
| | 2012-01-01 | 2012-01-02 | 2012-01-03 | 2012-01-04 | 2012-01-05 |
| BBC 1 | 2000 | 2002 | 2005 | 2004 | 1900 |
| BBC 2 | 1000 | 1012 | 1001 | 1004 | 900 |
| CBBC | 100 | 101 | 101 | 102 | 80 |
Placeholder: ITVViewingFigures
| | 2012-01-01 | 2012-01-02 | 2012-01-03 | 2012-01-04 | 2012-01-05 |
| ITV 1 | 2000 | 2002 | 3005 | 4004 | 5900 |
| ITV 2 | 3000 | 3012 | 3010 | 3014 | 2900 |
| ITV 3 | 1100 | 1101 | 101 | 102 | 80 |
| ITV 4 | 200 | 201 | 201 | 202 | 180 |
Is there a way of expressing this in Gherkin? I can think of ways round it but would they're all pretty ugly :-{
Thanks
Chris
-- There are two rules:
1) Please prefix the subject with [Ruby], [JVM] or [JS]. This allows people to filter messages.
2) Please use interleaved answers http://en.wikipedia.org/wiki/Posting_style#Interleaved_style
You received this message because you are subscribed to the Google Groups Cukes group. To post to this group, send email to cukes-/JYPxA39Uh5TLH3MbocFF+G/***@public.gmane.org To unsubscribe from this group, send email to cukes+***@googlegroups.com. For more options, visit this group at https://groups.google.com/d/forum/cukes?hl=en