Skip to content

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

test(chromium): ensure that arguments can be passed with spaces (#10057)

Joel Einbinder9c1ff081861d
diff --git a/tests/chromium/chromium.spec.ts b/tests/chromium/chromium.spec.ts
index 82990bc83d..5839942bc3 100644
--- a/tests/chromium/chromium.spec.ts
+++ b/tests/chromium/chromium.spec.ts
@@ -439,4 +439,14 @@ playwrightTest('should use proxy with connectOverCDP', async ({ browserType, ser
} finally {
await browserServer.close();
}
-});
\ No newline at end of file
+});
+
+playwrightTest('should pass args with spaces', async ({ browserType, createUserDataDir }, testInfo) => {
+ const browser = await browserType.launchPersistentContext(await createUserDataDir(), {
+ args: ['--user-agent=I am Foo']
+ });
+ const page = await browser.newPage();
+ const userAgent = await page.evaluate(() => navigator.userAgent);
+ await browser.close();
+ expect(userAgent).toBe('I am Foo');
+});