Open BrunoCD opened 2 months ago
Give the following test:
import { test, expect } from '@playwright/test';
test('get started link', async ({ request }) => {
await request.get('https://playwright.dev/');
await request.get('https://playwright.dev/docs/intro');
});
Running with npx playwright test --debug
does not bring up the inspector. The reason is that Debugger
class is only instantiated for BrowserContext
and not for APIRequestContext
.
It would be nice indeed to pause on the API request calls, but current inspector implementation is tightly coupled with browser context. You can use regular JS debugger in VS Code to step over the API requests as a workaround for now.
so there is no update or will not be added as a milestone?
🚀 Feature Request
Is it possible to enable debugging for API testing and have the ability to step through the code, like you can when debugging web tests?
Example
using either a flag or in code. npx playwright test --debug-api in code debug=true or debugger or debugger=true
Motivation
for debugging API tests