I am using Playwright + Typescript + BDD framework where i need to attach the Json response from one of the method to the report. Not sure how i can attach the json.
When('User approves the Payment of amount {string} and validates the API response for Payment approval', async function (amount) {
let apiResp = {
apiURL: 'API URL',
apiResponse: 'Response Body'
}
apiResp = await paymentsPage.userApprovesThePayment(paymentDescription, amount)
const url: string = apiResp.apiURL
const responseBdy: string = apiResp.apiResponse
await this.log(btoa('The API response validated for URL: ' +url))
})
I am using Playwright + Typescript + BDD framework where i need to attach the Json response from one of the method to the report. Not sure how i can attach the json.
When('User approves the Payment of amount {string} and validates the API response for Payment approval', async function (amount) { let apiResp = { apiURL: 'API URL', apiResponse: 'Response Body' } apiResp = await paymentsPage.userApprovesThePayment(paymentDescription, amount) const url: string = apiResp.apiURL const responseBdy: string = apiResp.apiResponse await this.log(btoa('The API response validated for URL: ' +url)) })