In a Playwright component test, is there a way to pass flags to the browser instance that gets run? For example, for Chrome: --use-fake-ui-for-media-stream
, --use-file-for-fake-audio-capture
, and similar.
Add launchoptions to the project in playwright.config:
export default defineConfig({
// ..
projects: [
{
name: "Chrome",
use: {
browserName: "chromium",
launchOptions: {
args: [
"--use-fake-ui-for-media-stream",
"--use-file-for-fake-audio-capture",
],
},
},
},
],
});