1

Below id my scenario that I am trying to automate:

Scenario Outline: create an invoice selecting

Given   following <payment_term> is selected
And     following <delivery_terms> is selected
And     following <verzenderijnr> is selected
        Examples:
          | payment_term | delivery_terms | verzenderijnr |
          |    1         |     1          |   1           |
          |    2         |     2          |   2           |
When   i transition the document to "final_invoice"
Then   i expect the following transaction in my administration:
Examples:
         | journal.id | account.id | document_date | due_date   |
         | VRK1       | 10016      | "2018-12-17"  | 2019-01-24 |
vm31
  • 169
  • 1
  • 4
  • 15

2 Answers2

1

You should use example with "scenario outline" and not only with scenario. also, Example table should come at end after all "Given When Then" statement.

1

I'm not 100% sure what you're trying to accomplish exactly, but wouldn't your scenario be more easier to read if done like this?

Scenario Outline: Determine due date for sales invoices
Given I am creating a sales invoice on <Invoice date>
When I should <Pay within days>
Then the <Due date> should be correct

Examples:
| Invoice date | Pay within days | Due date   |
| 2018-12-18   | 5               | 2018-12-23 |
| 2018-12-29   | 5               | 2019-01-02 |