<p dir="auto">is it possible to connect to ws and execute the test in parallel against different browsers ?</p>
<p dir="auto">I'm trying to follow up <a href="https://www.browserstack.com/docs/automate/playwright" rel="nofollow">https://www.browserstack.com/docs/automate/playwright</a>, is there a way to setup <code class="notranslate">wsEndpoint</code> as a configuration in config file or in fixtures?</p>
<hr>
<p dir="auto">Edit: from the Playwright Team:</p>
<div class="highlight highlight-source-js notranslate position-relative overflow-auto" dir="auto" data-snippet-clipboard-copy-content="import base, { chromium } from '@playwright/test';

// caps is copied from browserstack guide
const caps = {
  browser: 'chrome',
  os: 'osx',
  os_version: 'catalina',
  name: 'My first playwright test',
  build: 'playwright-build-1',
  'browserstack.username': process.env.BROWSERSTACK_USERNAME
  'browserstack.accessKey': process.env.BROWSERSTACK_ACCESS_KEY,
  'client.playwrightVersion': '1.13.1',
};

export const visitorTestFixture = base.extend&lt;{}&gt;({
  browser: async ({ browser }, use, workerInfo) =&gt; {
    const vBrowser = await chromium.connect({
      wsEndpoint:
        `wss://cdp.browserstack.com/playwright?caps=` +
        `${encodeURIComponent(JSON.stringify(caps))}`,
    });
    await use(vBrowser);
    await vBrowser.close();
  },
});
"><pre class="notranslate"><span class="pl-k">import</span> <span class="pl-s1">base</span><span class="pl-kos">,</span> <span class="pl-kos">{</span> <span class="pl-s1">chromium</span> <span class="pl-kos">}</span> <span class="pl-k">from</span> <span class="pl-s">'@playwright/test'</span><span class="pl-kos">;</span>

<span class="pl-c">// caps is copied from browserstack guide</span>
<span class="pl-k">const</span> <span class="pl-s1">caps</span> <span class="pl-c1">=</span> <span class="pl-kos">{</span>
  <span class="pl-c1">browser</span>: <span class="pl-s">'chrome'</span><span class="pl-kos">,</span>
  <span class="pl-c1">os</span>: <span class="pl-s">'osx'</span><span class="pl-kos">,</span>
  <span class="pl-c1">os_version</span>: <span class="pl-s">'catalina'</span><span class="pl-kos">,</span>
  <span class="pl-c1">name</span>: <span class="pl-s">'My first playwright test'</span><span class="pl-kos">,</span>
  <span class="pl-c1">build</span>: <span class="pl-s">'playwright-build-1'</span><span class="pl-kos">,</span>
  <span class="pl-s">'browserstack.username'</span>: <span class="pl-s1">process</span><span class="pl-kos">.</span><span class="pl-c1">env</span><span class="pl-kos">.</span><span class="pl-c1">BROWSERSTACK_USERNAME</span>
  <span class="pl-s">'browserstack.accessKey'</span>: <span class="pl-s1">process</span><span class="pl-kos">.</span><span class="pl-c1">env</span><span class="pl-kos">.</span><span class="pl-c1">BROWSERSTACK_ACCESS_KEY</span><span class="pl-kos">,</span>
  <span class="pl-s">'client.playwrightVersion'</span>: <span class="pl-s">'1.13.1'</span><span class="pl-kos">,</span>
<span class="pl-kos">}</span><span class="pl-kos">;</span>

<span class="pl-k">export</span> <span class="pl-k">const</span> <span class="pl-s1">visitorTestFixture</span> <span class="pl-c1">=</span> <span class="pl-s1">base</span><span class="pl-kos">.</span><span class="pl-c1">extend</span><span class="pl-c1">&lt;</span><span class="pl-kos">{</span><span class="pl-kos">}</span><span class="pl-c1">&gt;</span><span class="pl-kos">(</span><span class="pl-kos">{</span>
  <span class="pl-en">browser</span>: <span class="pl-k">async</span> <span class="pl-kos">(</span><span class="pl-kos">{</span> browser <span class="pl-kos">}</span><span class="pl-kos">,</span> <span class="pl-s1">use</span><span class="pl-kos">,</span> <span class="pl-s1">workerInfo</span><span class="pl-kos">)</span> <span class="pl-c1">=&gt;</span> <span class="pl-kos">{</span>
    <span class="pl-k">const</span> <span class="pl-s1">vBrowser</span> <span class="pl-c1">=</span> <span class="pl-k">await</span> <span class="pl-s1">chromium</span><span class="pl-kos">.</span><span class="pl-en">connect</span><span class="pl-kos">(</span><span class="pl-kos">{</span>
      <span class="pl-c1">wsEndpoint</span>:
        <span class="pl-s">`wss://cdp.browserstack.com/playwright?caps=`</span> <span class="pl-c1">+</span>
        <span class="pl-s">`<span class="pl-s1"><span class="pl-kos">${</span><span class="pl-en">encodeURIComponent</span><span class="pl-kos">(</span><span class="pl-c1">JSON</span><span class="pl-kos">.</span><span class="pl-en">stringify</span><span class="pl-kos">(</span><span class="pl-s1">caps</span><span class="pl-kos">)</span><span class="pl-kos">)</span><span class="pl-kos">}</span></span>`</span><span class="pl-kos">,</span>
    <span class="pl-kos">}</span><span class="pl-kos">)</span><span class="pl-kos">;</span>
    <span class="pl-k">await</span> <span class="pl-s1">use</span><span class="pl-kos">(</span><span class="pl-s1">vBrowser</span><span class="pl-kos">)</span><span class="pl-kos">;</span>
    <span class="pl-k">await</span> <span class="pl-s1">vBrowser</span><span class="pl-kos">.</span><span class="pl-en">close</span><span class="pl-kos">(</span><span class="pl-kos">)</span><span class="pl-kos">;</span>
  <span class="pl-kos">}</span><span class="pl-kos">,</span>
<span class="pl-kos">}</span><span class="pl-kos">)</span><span class="pl-kos">;</span></pre></div>