review feedback
This commit is contained in:
parent
a34a810b59
commit
63e70c3149
|
|
@ -181,14 +181,18 @@ await using var browser = await BrowserType.LaunchAsync(new()
|
||||||
|
|
||||||
Its also possible to specify it per context:
|
Its also possible to specify it per context:
|
||||||
|
|
||||||
```js tab=js-test title="playwright.config.ts"
|
```js tab=js-test title="example.spec.ts"
|
||||||
import { defineConfig } from '@playwright/test';
|
import { test, expect } from '@playwright/test';
|
||||||
export default defineConfig({
|
|
||||||
use: {
|
test('should do ...', async ({ browser }) => {
|
||||||
|
const context = await browser.newContext({
|
||||||
proxy: {
|
proxy: {
|
||||||
server: 'http://myproxy.com:3128',
|
server: 'http://myproxy.com:3128',
|
||||||
}
|
}
|
||||||
}
|
});
|
||||||
|
const page = await context.newPage();
|
||||||
|
|
||||||
|
await context.close();
|
||||||
});
|
});
|
||||||
```
|
```
|
||||||
|
|
||||||
|
|
@ -201,7 +205,7 @@ const context = await browser.newContext({
|
||||||
|
|
||||||
```java
|
```java
|
||||||
Browser browser = chromium.launch();
|
Browser browser = chromium.launch();
|
||||||
BrowserContext context = chromium.launch(new Browser.NewContextOptions()
|
BrowserContext context = browser.newContext(new Browser.NewContextOptions()
|
||||||
.setProxy(new Proxy("http://myproxy.com:3128")));
|
.setProxy(new Proxy("http://myproxy.com:3128")));
|
||||||
```
|
```
|
||||||
|
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue