Add Playwright Workspaces authenticated proxy samples#63
Add Playwright Workspaces authenticated proxy samples#63dhruvaggarwal9 wants to merge 3 commits into
Conversation
@microsoft-github-policy-service agree company="Microsoft" |
| $env:PROXY_SERVER = "http://<your-proxy>:8080" | ||
| $env:PROXY_USERNAME = "<user>" | ||
| $env:PROXY_PASSWORD = "<password>" | ||
| $env:PROXY_ONLY_URL = "http://intranet.example/healthcheck" |
There was a problem hiding this comment.
What's the context of this url here?
There was a problem hiding this comment.
Its the URL the proxy.spec.ts navigates to so traffic actually traverses the proxy. It is meant to be a private origin reachable only through the proxy.
| @@ -0,0 +1,19 @@ | |||
| import { test, expect } from '@playwright/test'; | |||
There was a problem hiding this comment.
nit: should we have tests-proxy or proxy-tests subfolder in all the folders above for proper isolation and visibility of proxy tests?
@Abhinav-Premsekhar thoughts?
There was a problem hiding this comment.
having folder would be overkill, as long as examples provide clear way for customer to try out proxy, should be good.
| @@ -0,0 +1,39 @@ | |||
| import { defineConfig } from '@playwright/test'; | |||
There was a problem hiding this comment.
can we not have seperate config and just have project for config and accordingly update readme to invoke proxy project when customer wants to try out proxy sample.
There was a problem hiding this comment.
I wasn't aware of the project-based approach earlier. This looks cleaner than having a separate config.
I'll move it into playwright.config.ts as a proxy project and update the README so users can run the proxy samples using --project=proxy.
| { | ||
| testDir: './tests-proxy', | ||
| use: { | ||
| proxy: { |
There was a problem hiding this comment.
this can go into playwright.config under new project
Add authenticated proxy samples for Playwright Workspaces
Adds a self-contained sample project under
samples/playwright-proxy-tests/demonstrating how to route remote Chromium sessions in Playwright Workspaces through an authenticated HTTP proxy.Included
connectOverCdp.mjs— Playwright over CDP usingchromium.connectOverCDP()andnewContext({ proxy })rawCdp.mjs— raw CDP WebSocket example with explicitFetch.authRequiredhandlingplaywrightConnect.mjs— Playwright native protocol usingchromium.connect()Scenarios Covered
407 Proxy Authentication Required)Testing
Validated all samples end-to-end against Playwright Workspaces and a deployed proxy:
Notes
.envis gitignored)