To view the response body of API calls in the trace viewer using @playwright/test in VSCode, follow these steps:
npx playwright show-reportin your terminal to display a report of your tests, including browsers, durations, and statuses.
npx playwright show-report
Find the test: Filter and search for the test you're interested in. Click the trace icon next to the test file name or open the detailed view and navigate to the 'Traces' tab.
Open the trace: Click on the trace screenshot to open the trace in Playwright's Trace Viewer tool.
Select the HTTP request: In the trace, find and click on the HTTP request you want to inspect.
View the response body: Click on "Response" under "Details" to expand the response section. You'll see information about the response body, such as size, content type, encoding, and more. If there's no response body, it will say "No Content".
By following these steps, you can easily inspect API call response bodies alongside other important information like headers and status codes in Playwright's Trace Viewer tool.
If you still have questions, please ask a question and I will try to answer it.
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 email@example.com.