I have four very similar sections on my application and am trying to group tests together that are similar enough using scenario outline to facilitate maintenance and am giving the section (page) they're to be under as a parameter. However, these tests when written individually contain a different amount of items under their datatable (but still doing the same assertions), so I was wondering if it's possible to have a different databable for each examples sections?
Something like:
Scenario Outline: Verify that the user is able to see the details recorded on the note
And I navigate to the "<page>" screen
Then the following items are displayed for their respective fields
@page1
Examples:
Then the following items are displayed for their respective fields
| field | text |
| title | My title |
| history | My history |
@page2
Then the following items are displayed for their respective fields
| field | text |
| comment | My comment |
| details | My details |
| status | My status |
Note I'm omitting the page parameter as not sure where it should go, as if doing something like the below would mean they would be run multiple times within each example
@page1
Examples:
Then the following items are displayed for their respective fields
| page | field | text |
| page1 | title | My title |
| page1 | history | My history |
I also can't have something like:
Scenario Outline: Verify that the user is able to see the details recorded on the note
Then the following items are displayed for their respective fields
@page1
Examples:
Then the following items are displayed for their respective fields
| field | text | item1 | item2 |
Because these amounts change, so I could have three items under the test for a page but two items on another one and maybe four on the other one.
I hope I'm being clear enough on what I'm trying to achieve?
Many thanks.