docs: http auth via config (#19643)

Fixes https://github.com/microsoft/playwright/issues/19630
This commit is contained in:
Pavel Feldman 2022-12-21 18:19:02 -08:00 committed by GitHub
parent 2922eec8e9
commit a248be86ce
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -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',