Hi Team,
I’m pretty much new to k6. Since I have a background of BDD and I cam across the K6 supports BDD format (k6chaijs). I have started using the same.
I’m stuck up in a situation where I want to pass the data between the describe blocks and want to execute the describe blocks seqentially.
How could I let the data flow between the describe blocks in sequential manner?
Example:
let userVoucherMap = {}
export function setup() --> which creates the user and returns 'data'
export default function (data) {
describe ('Load test voucher creation api', () => {
data --> The data is accessible here without any issues
Here I first load test voucher creation api by associating the users with the voucher.
The vouchers that are created here are then used in next describe for redemption.
That is: I create voucher for the users and store the user and voucher mapping in a global
variable: 'userVoucherMap '
})
describe ('Load test voucher redemption api', () => {
The userVoucherMap is available here.
But the problem is that both the describes are executed parallelly. So I do not get the entire
mapping. I want to wait until above describe is finished and then execute the current one.
})
}
How could I run the describe blocks sequentially ? Your help and inputs would be highly appreciated.
P.S. I did some research and came across material where it was illustrated/suggested to use scenarios and then use one scenarios’ startTime + gracefulStop to start the other scenario. But I do not want to use scenarios
Thanks,
Zaid