Skip to content

Playwright is a framework for Web Testing and Automation. It allows testing Chromium, Firefox and WebKit with a single API.

docs: add proxy example to the API testing guide (#28959)

Yury Semikhatskyb392c2d39253
diff --git a/docs/src/api-testing-js.md b/docs/src/api-testing-js.md
index 341a14e0e6..03e0e6dfcc 100644
--- a/docs/src/api-testing-js.md
+++ b/docs/src/api-testing-js.md
@@ -48,6 +48,24 @@ export default defineConfig({
});
```
+**Proxy configuration**
+
+If your tests need to run behind a proxy, you can specify this in the config and the `request` fixture
+will pick it up automatically:
+
+```js title="playwright.config.ts"
+import { defineConfig } from '@playwright/test';
+export default defineConfig({
+ use: {
+ proxy: {
+ server: 'http://my-proxy:8080',
+ username: 'user',
+ password: 'secret'
+ },
+ }
+});
+```
+
### Writing tests
Playwright Test comes with the built-in `request` fixture that respects configuration options like `baseURL` or `extraHTTPHeaders` we specified and is ready to send some requests.