Hi, I'm basically testing APIs using the
APIRequestContext. On every response I'd like to log the test name (available on
testInfo) and a correlation ID I receive as a response header. I was thinking on overriding the
request using fixtures and then listen to the response event, but there's no way to listen to when a response is received in API (like we have for
page.on('response'). Any ideas?
This thread is trying to answer question "How can I intercept API responses using APIRequestContext and log test names and correlation IDs?"
Rayrun is a community for QA engineers. I am constantly looking for new ways to add value to people learning Playwright and other browser automation frameworks. If you have feedback, email firstname.lastname@example.org.