docs: http auth via config (#19643)
Fixes https://github.com/microsoft/playwright/issues/19630
This commit is contained in:
parent
2922eec8e9
commit
a248be86ce
|
|
@ -8,9 +8,20 @@ Playwright provides APIs to **monitor** and **modify** network traffic, both HTT
|
||||||
|
|
||||||
## HTTP Authentication
|
## 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({
|
const context = await browser.newContext({
|
||||||
httpCredentials: {
|
httpCredentials: {
|
||||||
username: 'bill',
|
username: 'bill',
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue