I would like to pass the JSON array to the another feature file as an argument and I am using the below steps: Below is the json array, I have to pass
[
{
"attr1": 14,
"attr2": 1
}
]
The Code I have written is:
* def requestPayload = read('classpath:api/data/request/deliveryrank/sample.json')
* def addProjects = call read('classpath:api/features/common/example.feature') requestPayload
I tried using the method explained in "https://stackoverflow.com/questions/68986777/passing-a-json-array-while-calling-another-feature-file" but the request is send like
* def array = [{"attr1": 14,"attr2": 1}]
* def arg = { data: '#(array)' }
* call read('classpath:com/example/Test.feature') arg
Request in call:
{"data":[{"attr1":14,"attr2":1}]}
but it should go as it is [{"attr1": 14,"attr2": 1}]