Skip to content

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

test: fix codegen test with proxy (#37006)

Dmitry Gozman70946bf13d8f
diff --git a/tests/library/inspector/cli-codegen-csharp.spec.ts b/tests/library/inspector/cli-codegen-csharp.spec.ts
index f430d0eb89..3bf45f3f5f 100644
--- a/tests/library/inspector/cli-codegen-csharp.spec.ts
+++ b/tests/library/inspector/cli-codegen-csharp.spec.ts
@@ -97,15 +97,16 @@ var context = await browser.NewContextAsync(playwright.Devices["Pixel 2"]);`;
await cli.waitFor(expectedResult);
});
-test('should print the correct context options when using a device and additional options', async ({ browserName, channel, runCLI, server }) => {
+test('should print the correct context options when using a device and additional options', async ({ browserName, channel, runCLI, server, proxyServer }) => {
test.skip(browserName !== 'webkit');
+ proxyServer.forwardTo(server.PORT);
const cli = runCLI([
'--device=iPhone 11',
'--color-scheme=dark',
'--geolocation=37.819722,-122.478611',
'--lang=es',
- '--proxy-server=http://myproxy:3128',
+ '--proxy-server=' + proxyServer.HOST,
'--timezone=Europe/Rome',
'--user-agent=hardkodemium',
'--viewport-size=1280,720',
@@ -118,7 +119,7 @@ await using var browser = await playwright.${capitalize(browserName)}.LaunchAsyn
${launchOptions(channel)}
Proxy = new ProxySettings
{
- Server = "http://myproxy:3128",
+ Server = "${proxyServer.HOST}",
},
});
var context = await browser.NewContextAsync(new BrowserNewContextOptions(playwright.Devices["iPhone 11"])