From f1390cc269f1b6c8028680f79fcd3a197181ef55 Mon Sep 17 00:00:00 2001 From: Simon Knott Date: Tue, 17 Sep 2024 19:59:44 +0200 Subject: [PATCH] chore(har recorder): ensure we respect minimal mode (#32658) Closes https://github.com/microsoft/playwright/issues/32653. Adds some test coverage to ensure we respect minimal mode for API Requests in HAR tracing. | omit setting | result | | - | - | | `omitCookies` | added test for it | | `omitTiming` | already covered | | `omitSecurityDetails` | not recorded yet | | `omitServerIP` | we don't record it yet, so no action here. gonna open a separate issue | | `omitPages` | not relevant to API requests | | `omitSizes` | added test for it | | `omitScripts` | not relevant to API requests | --- tests/library/har.spec.ts | 2 ++ 1 file changed, 2 insertions(+) diff --git a/tests/library/har.spec.ts b/tests/library/har.spec.ts index cc65127e3fdf0..2b7dab4262d63 100644 --- a/tests/library/har.spec.ts +++ b/tests/library/har.spec.ts @@ -844,6 +844,8 @@ it('should respect minimal mode for API Requests', async ({ contextFactory, serv expect(entries).toHaveLength(1); const [entry] = entries; expect(entry.timings).toEqual({ receive: -1, send: -1, wait: -1 }); + expect(entry.request.cookies).toEqual([]); + expect(entry.request.bodySize).toBe(-1); }); it('should include redirects from API request', async ({ contextFactory, server }, testInfo) => {