title: Can we configure and select Playwright launch options based on env?
body: <p>Context : I am running a bunch of Playwright e2e tests for a enterprise web application, which are run on Github actions, as a part of the CI/CD process.</p>
  <p>To launch Chromium using Playwright we have these launch options -</p>
  <pre><code>const options = {
    headless: true,
    slowMo: 100,
    ..
    // all args added to help run Chromium in headless mode
    args: [
      '--start-maximized',
      '--disable-dev-shm-usage',
      '--no-sandbox'
    ],
    
    video: &quot;true&quot;
  };
  </code></pre>
  <p>When the same tests are run on the local system during the time we add new test cases, we have to manually change the <code>headless: true</code> to <code>false</code> to have a head-ful execution.</p>
  <p>I'm wondering if we can configure this to have change based on the run - when the execution is local, it changes the headless mode to false and true when it runs on ci. Let's say for running tests on local,</p>
  <p><code>npm run test --env=local</code> gets the headless as false, and <code>npm run test --env=ci</code> gets headless true in the <code>options</code>.</p>
  <p>I've gone through Playwright's documentation but couldn't find anything concrete. Most of the answers on Playwright/Puppeteer are about how to change the URL's etc, based on the env.</p>