title: Can a variable be passed to Playwright JS config in global-setup.js file?
body: <p>JS newbie here so please excuse any misconceptions I may have about JS or Playwright...</p>
  <p>I have config.js file setup with projects and for each project I define custom variables (like login creds, etc.). How can I access these values in the <code>global-setup.js</code> file when I use the <code>--project=ProjectName</code> when I run the test?</p>
  <p>I can use testInfo in tests to access these values, but can I access it in <code>global-setup.js</code>, since (as I understand it) is adds to the config object?</p>
  <p>I am trying to use one global-setup file for login in with credentials from either one or another project, which are defined in the config.js file.</p>
  <p>So I would run this:
  <code>npx playwright test testFile.spec.js --project=FirstProject</code></p>
  <p>The <code>playwright.config.js</code> file would have this setup:</p>
  <pre><code>  {
      name: &quot;FirstProject&quot;,
      username: &quot;blahblah&quot;,
      password: &quot;blahblah&quot;,
    },
  
    {
      name: &quot;SecondProject&quot;,
      username: &quot;blahblah1&quot;,
      password: &quot;blahblah1&quot;,
    }
  ]
  </code></pre>
  <p>And in <code>global-setup.js</code> I would like to check which project is being used in order to provide the correct credentials -- something like this:</p>
  <pre><code>module.exports = async config =&gt; {
  const username = config.projects[${projectName}].username;
  const password = config.projects[${projectName}].password;
  
  </code></pre>
  <p>Is this possible?</p>
  <p>Thank you.</p>