I can run following code in UI mode(headed) successfully. But it is failed and stuck when running headless mode using cypress. I tried different approaches to find a solution. but unfortunately couldn’t.
function makeRequest(requestOptions) {
return new Promise((resolve, reject) => {
try {
cy.request(requestOptions.url, requestOptions).then(resolve)
} catch (error) {
reject(error)
}
})
}
//Call method
await makeRequest()