Calling other feature and reading data from csv not in examples

Viewed 89

I am usually calling other feature and reading data from csv in the examples, like below.

Scenario Outline: 
* call read('classpath:controller/Controller.feature')

Examples:
|read('classpath:com/testdata/Test.csv')|

This time I still want to read data from csv, but use Examples for other purpose, like below. Is it possible to read data from csv still? Maybe passing as parameter?

Scenario Outline: 
        * call read('classpath:controller/Controller.feature'){read('classpath:com/testdata/Test.csv')}
    
    Examples:
    |gain |spend    |
    |12000| 12008   |
    |3400 | 4655    |

I know it works this way but I have to pass index [0], and if I have more test data in csv it won't work

Scenario Outline: 
    * def testData = read('classpath:com/testdata/Test.csv')
    * call read('classpath:controller/Controller.feature'){ "name": "#(testData[0].name)", "age": "#(testData[0].age)"}

Examples:
|gain |spend    |
|12000| 12008   |
|3400 | 4655    |
1 Answers
Related