From a248be86ce556078478f59a3fcd7e8c09ec0750c Mon Sep 17 00:00:00 2001 From: Pavel Feldman Date: Wed, 21 Dec 2022 18:19:02 -0800 Subject: [PATCH] docs: http auth via config (#19643) Fixes https://github.com/microsoft/playwright/issues/19630 --- docs/src/network.md | 15 +++++++++++++-- 1 file changed, 13 insertions(+), 2 deletions(-) diff --git a/docs/src/network.md b/docs/src/network.md index a704fa49d4..a08cb5a437 100644 --- a/docs/src/network.md +++ b/docs/src/network.md @@ -8,9 +8,20 @@ Playwright provides APIs to **monitor** and **modify** network traffic, both HTT ## HTTP Authentication -Perform HTTP Authentication with [`method: Browser.newContext`]. +Perform HTTP Authentication. -```js +```js tab=js-ts +const config: PlaywrightTestConfig = { + use: { + httpCredentials: { + username: 'bill', + password: 'pa55w0rd', + } + } +} +``` + +```js tab=js-library const context = await browser.newContext({ httpCredentials: { username: 'bill',