playwright/docs
Dmitry Gozman 1558c94772 feat: APIRequestContext dispose reason
Similarly to page.close, we pass test-runner specific reason
to facilitate better error messages.

```
  1) a.test.ts:10:11 › test ────────────────────────────────────────────────────────────────────────

    Error: apiRequestContext.fetch: Fixture { request } from beforeAll cannot be reused in a test.
      - Recommended fix: use a separate { request } in the test.
      - Alternatively, manually create APIRequestContext in beforeAll and dispose it in afterAll.
    See https://playwright.dev/docs/api-testing#sending-api-requests-from-ui-tests for more details.

       9 |
      10 |       test('test', async () => {
    > 11 |         await context.fetch('http://example.com');
         |                       ^
      12 |       });
      13 |

```
2024-05-13 10:30:10 -07:00
..
src feat: APIRequestContext dispose reason 2024-05-13 10:30:10 -07:00