I had a series of scenarios that look like this:
Given these receipts:
| Amount | Date | Company |
| 1000 | 2016/10/25 | One Company |
| 1200 | 2016/10/20 | Another Company |
| 1500 | 2016/10/13 | My Company |
And delay is 15
When I calculate date of payment
Then Date of payment should be 20
Given these receipts:
| Amount | Date | Company |
| 1000 | 2016/10/25 | One Company |
| 1200 | 2016/10/20 | Another Company |
| 1500 | 2016/10/13 | My Company |
And delay is 30
When I calculate date of payment
Then Date of payment should be 15
Given these receipts:
| Amount | Date | Company |
| 1000 | 2016/10/25 | One Company |
| 1200 | 2016/10/20 | Another Company |
| 1500 | 2016/10/13 | My Company |
And delay is 45
When I calculate date of payment
Then Date of payment should be 10
So I learned about Scenario outline and I tried to make one for the above scenarios but had trouble putting in the receipts for obvious reasons:
Given these receipts: '<receipts>'
And delay is <delay>
When I calculate date of payment
Then Date of payment should be '<dateOfPayment>'
Examples:
| delay | dateOfPayment | receipts |
| 15 | 20 | | Amount | Date | Company | |
| | 1000 | 2016/10/25 | one company | |
| | .............................. | |
Given that I want the same collection of, in this case, receipts for all scenarios in my Feature how can I declare a table that will be passed at the place of '<receipts>' in the scenario outline
Maybe, should I proceed with a different approach?
---------------------------------- EDITED --------------------------------
Maybe something like this could work (but It is not implemented in Gherkin):
Given these receipts: '<receipts>'
And delay is <delay>
When I calculate date of payment
Then Date of payment should be '<dateOfPayment>'
Examples:
| delay | dateOfPayment |
| 15 | 20 |
Placeholder: '<receipts>'
| Amount | Date | Company |
| 1000 | 2016/10/25 | One Company |
| 1200 | 2016/10/20 | Another Company |
| 1500 | 2016/10/13 | My Company |
Gherkin) - sabotero