<h3 dir="auto">System info</h3>
<ul dir="auto">
<li>Playwright Version: [v1.31.2]</li>
<li>Operating System: [Ubuntu 22, NixOS 22.11]</li>
<li>Browser: [All, Chromium, Firefox, WebKit]</li>
</ul>
<h3 dir="auto">Source code</h3>
<ul class="contains-task-list">
<li class="task-list-item"><input type="checkbox" id="" disabled="" class="task-list-item-checkbox" checked=""> I provided exact source code that allows reproducing the issue locally.</li>
</ul>




<p dir="auto">or</p>
<p dir="auto"><strong>Config file</strong></p>
<div class="highlight highlight-source-js notranslate position-relative overflow-auto" dir="auto" data-snippet-clipboard-copy-content="// playwright.config.ts
import { defineConfig, devices } from '@playwright/test';

export default defineConfig({
  testDir: './tests',
  timeout: 30 * 1000,
  expect:
    timeout: 5000
  },
  fullyParallel: true,
  forbidOnly: !!process.env.CI,
  retries: process.env.CI ? 2 : 0,
  workers: process.env.CI ? 1 : undefined,
  reporter: 'html',
  use: {
    actionTimeout: 0,
    trace: 'on-first-retry',
  },
  projects: [
    {
      name: 'chromium',
      use: { ...devices['Desktop Chrome'] },
    },

    {
      name: 'firefox',
      use: { ...devices['Desktop Firefox'] },
    },

    {
      name: 'webkit',
      use: { ...devices['Desktop Safari'] },
    },
  ],
});"><pre class="notranslate"><span class="pl-c">// playwright.config.ts</span>
<span class="pl-k">import</span> <span class="pl-kos">{</span> <span class="pl-s1">defineConfig</span><span class="pl-kos">,</span> <span class="pl-s1">devices</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-k">export</span> <span class="pl-k">default</span> <span class="pl-en">defineConfig</span><span class="pl-kos">(</span><span class="pl-kos">{</span>
  <span class="pl-c1">testDir</span>: <span class="pl-s">'./tests'</span><span class="pl-kos">,</span>
  <span class="pl-c1">timeout</span>: <span class="pl-c1">30</span> <span class="pl-c1">*</span> <span class="pl-c1">1000</span><span class="pl-kos">,</span>
  <span class="pl-c1">expect</span>:
    <span class="pl-s1">timeout</span>: <span class="pl-c1">5000</span>
  <span class="pl-kos">}</span><span class="pl-kos">,</span>
  <span class="pl-s1">fullyParallel</span>: <span class="pl-c1">true</span><span class="pl-kos">,</span>
  <span class="pl-s1">forbidOnly</span>: <span class="pl-c1">!</span><span class="pl-c1">!</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">CI</span><span class="pl-kos">,</span>
  <span class="pl-s1">retries</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">CI</span> ? <span class="pl-c1">2</span> : <span class="pl-c1">0</span><span class="pl-kos">,</span>
  <span class="pl-s1">workers</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">CI</span> ? <span class="pl-c1">1</span> : <span class="pl-c1">undefined</span><span class="pl-kos">,</span>
  <span class="pl-s1">reporter</span>: <span class="pl-s">'html'</span><span class="pl-kos">,</span>
  <span class="pl-s1">use</span>: <span class="pl-kos">{</span>
    <span class="pl-c1">actionTimeout</span>: <span class="pl-c1">0</span><span class="pl-kos">,</span>
    <span class="pl-c1">trace</span>: <span class="pl-s">'on-first-retry'</span><span class="pl-kos">,</span>
  <span class="pl-kos">}</span><span class="pl-kos">,</span>
  <span class="pl-s1">projects</span>: <span class="pl-kos">[</span>
    <span class="pl-kos">{</span>
      <span class="pl-c1">name</span>: <span class="pl-s">'chromium'</span><span class="pl-kos">,</span>
      <span class="pl-c1">use</span>: <span class="pl-kos">{</span> ...<span class="pl-s1">devices</span><span class="pl-kos">[</span><span class="pl-s">'Desktop Chrome'</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-c1">name</span>: <span class="pl-s">'firefox'</span><span class="pl-kos">,</span>
      <span class="pl-c1">use</span>: <span class="pl-kos">{</span> ...<span class="pl-s1">devices</span><span class="pl-kos">[</span><span class="pl-s">'Desktop Firefox'</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-c1">name</span>: <span class="pl-s">'webkit'</span><span class="pl-kos">,</span>
      <span class="pl-c1">use</span>: <span class="pl-kos">{</span> ...<span class="pl-s1">devices</span><span class="pl-kos">[</span><span class="pl-s">'Desktop Safari'</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><span class="pl-kos">)</span><span class="pl-kos">;</span></pre></div>
<p dir="auto"><strong>Test file (self-contained)</strong><br>
basic test example provided by playwright (fresh project with fresh installation).</p>
<p dir="auto"><strong>Steps</strong><br>
create a fresh new project.</p>
<div class="highlight highlight-source-json notranslate position-relative overflow-auto" dir="auto" data-snippet-clipboard-copy-content="{
  &quot;package.json&quot;:&quot;👇&quot;,
  &quot;name&quot;: &quot;pwtest&quot;,
  &quot;version&quot;: &quot;1.0.0&quot;,
  &quot;description&quot;: &quot;&quot;,
  &quot;main&quot;: &quot;index.js&quot;,
  &quot;scripts&quot;: {},
  &quot;keywords&quot;: [],
  &quot;author&quot;: &quot;&quot;,
  &quot;license&quot;: &quot;ISC&quot;,
  &quot;devDependencies&quot;: {
    &quot;@playwright/test&quot;: &quot;^1.31.2&quot;
  }
}"><pre class="notranslate">{
  <span class="pl-ent">"package.json"</span>:<span class="pl-s"><span class="pl-pds">"</span>👇<span class="pl-pds">"</span></span>,
  <span class="pl-ent">"name"</span>: <span class="pl-s"><span class="pl-pds">"</span>pwtest<span class="pl-pds">"</span></span>,
  <span class="pl-ent">"version"</span>: <span class="pl-s"><span class="pl-pds">"</span>1.0.0<span class="pl-pds">"</span></span>,
  <span class="pl-ent">"description"</span>: <span class="pl-s"><span class="pl-pds">"</span><span class="pl-pds">"</span></span>,
  <span class="pl-ent">"main"</span>: <span class="pl-s"><span class="pl-pds">"</span>index.js<span class="pl-pds">"</span></span>,
  <span class="pl-ent">"scripts"</span>: {},
  <span class="pl-ent">"keywords"</span>: [],
  <span class="pl-ent">"author"</span>: <span class="pl-s"><span class="pl-pds">"</span><span class="pl-pds">"</span></span>,
  <span class="pl-ent">"license"</span>: <span class="pl-s"><span class="pl-pds">"</span>ISC<span class="pl-pds">"</span></span>,
  <span class="pl-ent">"devDependencies"</span>: {
    <span class="pl-ent">"@playwright/test"</span>: <span class="pl-s"><span class="pl-pds">"</span>^1.31.2<span class="pl-pds">"</span></span>
  }
}</pre></div>
<div class="snippet-clipboard-content notranslate position-relative overflow-auto" data-snippet-clipboard-copy-content="pnpm exec playwright codegen --browser ff"><pre class="notranslate"><code class="notranslate">pnpm exec playwright codegen --browser ff
</code></pre></div>
<p dir="auto"><strong>Expected</strong><br>
expecting the firefox browser to open.</p>
<p dir="auto"><strong>Actual</strong></p>
<p dir="auto">[Describe actual behavior]<br>
it opens chromium.</p>
<h3 dir="auto">System info</h3>
<ul dir="auto">
<li>Playwright Version: <code class="notranslate">v1.32.0</code>
<ul dir="auto">
<li>Confirmed the issue <strong><em>does not exist</em></strong> in <code class="notranslate">v1.31.2</code></li>
<li>Confirmed the issue <strong><em>exists</em></strong> in <code class="notranslate">v1.32.0</code> thru <code class="notranslate">v1.32.3</code></li>
</ul>
</li>
<li>Operating System: Windows 10, 22H2</li>
<li>Browser: Tested with Chromium and Firefox</li>
<li>Other info:
<ul dir="auto">
<li>Node: v18.15.0</li>
<li>PowerShell: v7.3.3</li>
<li>Terminal: 1.16.10261.0</li>
</ul>
</li>
</ul>
<h3 dir="auto">Source code</h3>
<ul dir="auto">
<li>[x ] I provided exact source code that allows reproducing the issue locally.</li>
</ul>




<p dir="auto"><strong>Config file</strong></p>
<div class="highlight highlight-source-js notranslate position-relative overflow-auto" dir="auto" data-snippet-clipboard-copy-content="// playwright.config.ts
import { defineConfig } from '@playwright/test';

export default defineConfig({
  testDir: './tests',
  fullyParallel: true,
  forbidOnly: !!process.env.CI,
  retries: process.env.CI ? 2 : 0,
  workers: process.env.CI ? 1 : undefined,
  use: {
    trace: 'on-first-retry',
  },
});"><pre class="notranslate"><span class="pl-c">// playwright.config.ts</span>
<span class="pl-k">import</span> <span class="pl-kos">{</span> <span class="pl-s1">defineConfig</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-k">export</span> <span class="pl-k">default</span> <span class="pl-en">defineConfig</span><span class="pl-kos">(</span><span class="pl-kos">{</span>
  <span class="pl-c1">testDir</span>: <span class="pl-s">'./tests'</span><span class="pl-kos">,</span>
  <span class="pl-c1">fullyParallel</span>: <span class="pl-c1">true</span><span class="pl-kos">,</span>
  <span class="pl-c1">forbidOnly</span>: <span class="pl-c1">!</span><span class="pl-c1">!</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">CI</span><span class="pl-kos">,</span>
  <span class="pl-c1">retries</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">CI</span> ? <span class="pl-c1">2</span> : <span class="pl-c1">0</span><span class="pl-kos">,</span>
  <span class="pl-c1">workers</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">CI</span> ? <span class="pl-c1">1</span> : <span class="pl-c1">undefined</span><span class="pl-kos">,</span>
  <span class="pl-c1">use</span>: <span class="pl-kos">{</span>
    <span class="pl-c1">trace</span>: <span class="pl-s">'on-first-retry'</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>
<p dir="auto"><strong>Test file (self-contained)</strong></p>
<div class="highlight highlight-source-js notranslate position-relative overflow-auto" dir="auto" data-snippet-clipboard-copy-content="// memory-leak-example.spec.ts
import { test, expect, Locator, TestInfo } from '@playwright/test';
test.afterAll(async ({ page }) =&gt; await page.pause());

test('Example test showing a probable memory leak after updating from Playwright v1.31.2 to v1.32.0', async ({ page }, testInfo: TestInfo) =&gt; {
    const isPwDebug = !!process.env.PWDEBUG;
    const pwVersion = testInfo.config.version;
    const timerTotalTime = `\nTotal test time for PW v${pwVersion} (debug: ${isPwDebug})`;
    console.log(`Playwright v${pwVersion}\ndebug: ${isPwDebug}\n`);
    console.log('round #, link #, rssMB, heapTotalMB, heapUsedMB, externalKB, arrayBuffersKB');
    const bytesToKB = (bytes: number): string =&gt; (bytes / 1024).toFixed(3);
    const bytesToMB = (bytes: number): string =&gt; (bytes / 1024 / 1024).toFixed(3);

    console.time(timerTotalTime);
    const url = 'https://playwright.dev/docs/intro';
    await page.goto(url, { waitUntil: 'networkidle' });

    const links: Locator = page.getByRole('navigation', { name: 'Docs sidebar' })
        .locator('li[class^=&quot;theme-doc-sidebar-item-link theme-doc-sidebar-item-link-level-2&quot;]');
    const linksCount = await links.count(); // 55 links

    const maxRounds = 2;
    for (let i = 1; (i &lt;= maxRounds); i++) {
        const maxLinksToClick = 99;
        for (let j = 0; (j &lt; linksCount &amp;&amp; j &lt;= maxLinksToClick); j++) {
            const link = links.nth(j);
            await link.click();
            const linkText = await link.textContent() as string;
            const heading: Locator = page.getByRole('heading', { name: linkText, exact: true });
            await expect(heading).toHaveText(linkText);

            const rssMB = bytesToMB(process.memoryUsage().rss);
            const heapTotalMB = bytesToMB(process.memoryUsage().heapTotal);
            const heapUsedMB = bytesToMB(process.memoryUsage().heapUsed);
            const externalKB = bytesToKB(process.memoryUsage().external);
            const arrayBuffersKB = bytesToKB(process.memoryUsage().arrayBuffers);
            console.log(`${i}, ${j}, ${rssMB}, ${heapTotalMB}, ${heapUsedMB}, ${externalKB}, ${arrayBuffersKB}`);
        }
    }
    console.timeEnd(timerTotalTime);
});"><pre class="notranslate"><span class="pl-c">// memory-leak-example.spec.ts</span>
<span class="pl-k">import</span> <span class="pl-kos">{</span> <span class="pl-s1">test</span><span class="pl-kos">,</span> <span class="pl-s1">expect</span><span class="pl-kos">,</span> <span class="pl-v">Locator</span><span class="pl-kos">,</span> <span class="pl-v">TestInfo</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-s1">test</span><span class="pl-kos">.</span><span class="pl-en">afterAll</span><span class="pl-kos">(</span><span class="pl-k">async</span> <span class="pl-kos">(</span><span class="pl-kos">{</span> page <span class="pl-kos">}</span><span class="pl-kos">)</span> <span class="pl-c1">=&gt;</span> <span class="pl-k">await</span> <span class="pl-s1">page</span><span class="pl-kos">.</span><span class="pl-en">pause</span><span class="pl-kos">(</span><span class="pl-kos">)</span><span class="pl-kos">)</span><span class="pl-kos">;</span>

<span class="pl-s1">test</span><span class="pl-kos">(</span><span class="pl-s">'Example test showing a probable memory leak after updating from Playwright v1.31.2 to v1.32.0'</span><span class="pl-kos">,</span> <span class="pl-en">async</span> <span class="pl-kos">(</span><span class="pl-kos">{</span> page <span class="pl-kos">}</span><span class="pl-kos">,</span> <span class="pl-s1">testInfo</span>: <span class="pl-v">TestInfo</span><span class="pl-kos">)</span> <span class="pl-c1">=</span><span class="pl-c1">&gt;</span> <span class="pl-kos">{</span>
    <span class="pl-s1">const</span> <span class="pl-s1">isPwDebug</span> <span class="pl-c1">=</span> <span class="pl-c1">!</span><span class="pl-c1">!</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">PWDEBUG</span><span class="pl-kos">;</span>
    <span class="pl-k">const</span> <span class="pl-s1">pwVersion</span> <span class="pl-c1">=</span> <span class="pl-s1">testInfo</span><span class="pl-kos">.</span><span class="pl-c1">config</span><span class="pl-kos">.</span><span class="pl-c1">version</span><span class="pl-kos">;</span>
    <span class="pl-k">const</span> <span class="pl-s1">timerTotalTime</span> <span class="pl-c1">=</span> <span class="pl-s">`\nTotal test time for PW v<span class="pl-s1"><span class="pl-kos">${</span><span class="pl-s1">pwVersion</span><span class="pl-kos">}</span></span> (debug: <span class="pl-s1"><span class="pl-kos">${</span><span class="pl-s1">isPwDebug</span><span class="pl-kos">}</span></span>)`</span><span class="pl-kos">;</span>
    <span class="pl-smi">console</span><span class="pl-kos">.</span><span class="pl-en">log</span><span class="pl-kos">(</span><span class="pl-s">`Playwright v<span class="pl-s1"><span class="pl-kos">${</span><span class="pl-s1">pwVersion</span><span class="pl-kos">}</span></span>\ndebug: <span class="pl-s1"><span class="pl-kos">${</span><span class="pl-s1">isPwDebug</span><span class="pl-kos">}</span></span>\n`</span><span class="pl-kos">)</span><span class="pl-kos">;</span>
    <span class="pl-smi">console</span><span class="pl-kos">.</span><span class="pl-en">log</span><span class="pl-kos">(</span><span class="pl-s">'round #, link #, rssMB, heapTotalMB, heapUsedMB, externalKB, arrayBuffersKB'</span><span class="pl-kos">)</span><span class="pl-kos">;</span>
    <span class="pl-k">const</span> <span class="pl-s1">bytesToKB</span> <span class="pl-c1">=</span> <span class="pl-kos">(</span><span class="pl-s1">bytes</span>: <span class="pl-s1">number</span><span class="pl-kos">)</span>: <span class="pl-s1">string</span> <span class="pl-c1">=&gt;</span> <span class="pl-kos">(</span><span class="pl-s1">bytes</span> <span class="pl-c1">/</span> <span class="pl-c1">1024</span><span class="pl-kos">)</span><span class="pl-kos">.</span><span class="pl-en">toFixed</span><span class="pl-kos">(</span><span class="pl-c1">3</span><span class="pl-kos">)</span><span class="pl-kos">;</span>
    <span class="pl-k">const</span> <span class="pl-s1">bytesToMB</span> <span class="pl-c1">=</span> <span class="pl-kos">(</span><span class="pl-s1">bytes</span>: <span class="pl-s1">number</span><span class="pl-kos">)</span>: <span class="pl-s1">string</span> <span class="pl-c1">=&gt;</span> <span class="pl-kos">(</span><span class="pl-s1">bytes</span> <span class="pl-c1">/</span> <span class="pl-c1">1024</span> <span class="pl-c1">/</span> <span class="pl-c1">1024</span><span class="pl-kos">)</span><span class="pl-kos">.</span><span class="pl-en">toFixed</span><span class="pl-kos">(</span><span class="pl-c1">3</span><span class="pl-kos">)</span><span class="pl-kos">;</span>

    <span class="pl-smi">console</span><span class="pl-kos">.</span><span class="pl-en">time</span><span class="pl-kos">(</span><span class="pl-s1">timerTotalTime</span><span class="pl-kos">)</span><span class="pl-kos">;</span>
    <span class="pl-k">const</span> <span class="pl-s1">url</span> <span class="pl-c1">=</span> <span class="pl-s">'https://playwright.dev/docs/intro'</span><span class="pl-kos">;</span>
    <span class="pl-k">await</span> <span class="pl-s1">page</span><span class="pl-kos">.</span><span class="pl-en">goto</span><span class="pl-kos">(</span><span class="pl-s1">url</span><span class="pl-kos">,</span> <span class="pl-kos">{</span> <span class="pl-c1">waitUntil</span>: <span class="pl-s">'networkidle'</span> <span class="pl-kos">}</span><span class="pl-kos">)</span><span class="pl-kos">;</span>

    <span class="pl-k">const</span> <span class="pl-s1">links</span>: <span class="pl-v">Locator</span> <span class="pl-c1">=</span> <span class="pl-s1">page</span><span class="pl-kos">.</span><span class="pl-en">getByRole</span><span class="pl-kos">(</span><span class="pl-s">'navigation'</span><span class="pl-kos">,</span> <span class="pl-kos">{</span> <span class="pl-c1">name</span>: <span class="pl-s">'Docs sidebar'</span> <span class="pl-kos">}</span><span class="pl-kos">)</span>
        <span class="pl-kos">.</span><span class="pl-en">locator</span><span class="pl-kos">(</span><span class="pl-s">'li[class^="theme-doc-sidebar-item-link theme-doc-sidebar-item-link-level-2"]'</span><span class="pl-kos">)</span><span class="pl-kos">;</span>
    <span class="pl-k">const</span> <span class="pl-s1">linksCount</span> <span class="pl-c1">=</span> <span class="pl-k">await</span> <span class="pl-s1">links</span><span class="pl-kos">.</span><span class="pl-en">count</span><span class="pl-kos">(</span><span class="pl-kos">)</span><span class="pl-kos">;</span> <span class="pl-c">// 55 links</span>

    <span class="pl-k">const</span> <span class="pl-s1">maxRounds</span> <span class="pl-c1">=</span> <span class="pl-c1">2</span><span class="pl-kos">;</span>
    <span class="pl-k">for</span> <span class="pl-kos">(</span><span class="pl-s1">let</span> <span class="pl-s1">i</span> <span class="pl-c1">=</span> <span class="pl-c1">1</span><span class="pl-kos">;</span> <span class="pl-kos">(</span><span class="pl-s1">i</span> <span class="pl-c1">&lt;=</span> <span class="pl-s1">maxRounds</span><span class="pl-kos">)</span><span class="pl-kos">;</span> <span class="pl-s1">i</span><span class="pl-c1">++</span><span class="pl-kos">)</span> <span class="pl-kos">{</span>
        <span class="pl-s1">const</span> <span class="pl-s1">maxLinksToClick</span> <span class="pl-c1">=</span> <span class="pl-c1">99</span><span class="pl-kos">;</span>
        <span class="pl-k">for</span> <span class="pl-kos">(</span><span class="pl-s1">let</span> <span class="pl-s1">j</span> <span class="pl-c1">=</span> <span class="pl-c1">0</span><span class="pl-kos">;</span> <span class="pl-kos">(</span><span class="pl-s1">j</span> <span class="pl-c1">&lt;</span> <span class="pl-s1">linksCount</span> <span class="pl-c1">&amp;&amp;</span> <span class="pl-s1">j</span> <span class="pl-c1">&lt;=</span> <span class="pl-s1">maxLinksToClick</span><span class="pl-kos">)</span><span class="pl-kos">;</span> <span class="pl-s1">j</span><span class="pl-c1">++</span><span class="pl-kos">)</span> <span class="pl-kos">{</span>
            const <span class="pl-s1">link</span> <span class="pl-c1">=</span> <span class="pl-s1">links</span><span class="pl-kos">.</span><span class="pl-en">nth</span><span class="pl-kos">(</span><span class="pl-s1">j</span><span class="pl-kos">)</span><span class="pl-kos">;</span>
            <span class="pl-k">await</span> <span class="pl-s1">link</span><span class="pl-kos">.</span><span class="pl-en">click</span><span class="pl-kos">(</span><span class="pl-kos">)</span><span class="pl-kos">;</span>
            <span class="pl-k">const</span> <span class="pl-s1">linkText</span> <span class="pl-c1">=</span> <span class="pl-k">await</span> <span class="pl-s1">link</span><span class="pl-kos">.</span><span class="pl-en">textContent</span><span class="pl-kos">(</span><span class="pl-kos">)</span> <span class="pl-s1">as</span> <span class="pl-s1">string</span><span class="pl-kos">;</span>
            <span class="pl-k">const</span> <span class="pl-s1">heading</span>: <span class="pl-v">Locator</span> <span class="pl-c1">=</span> <span class="pl-s1">page</span><span class="pl-kos">.</span><span class="pl-en">getByRole</span><span class="pl-kos">(</span><span class="pl-s">'heading'</span><span class="pl-kos">,</span> <span class="pl-kos">{</span> <span class="pl-c1">name</span>: <span class="pl-s1">linkText</span><span class="pl-kos">,</span> <span class="pl-c1">exact</span>: <span class="pl-c1">true</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-en">expect</span><span class="pl-kos">(</span><span class="pl-s1">heading</span><span class="pl-kos">)</span><span class="pl-kos">.</span><span class="pl-en">toHaveText</span><span class="pl-kos">(</span><span class="pl-s1">linkText</span><span class="pl-kos">)</span><span class="pl-kos">;</span>

            <span class="pl-k">const</span> <span class="pl-s1">rssMB</span> <span class="pl-c1">=</span> <span class="pl-en">bytesToMB</span><span class="pl-kos">(</span><span class="pl-s1">process</span><span class="pl-kos">.</span><span class="pl-en">memoryUsage</span><span class="pl-kos">(</span><span class="pl-kos">)</span><span class="pl-kos">.</span><span class="pl-c1">rss</span><span class="pl-kos">)</span><span class="pl-kos">;</span>
            <span class="pl-k">const</span> <span class="pl-s1">heapTotalMB</span> <span class="pl-c1">=</span> <span class="pl-en">bytesToMB</span><span class="pl-kos">(</span><span class="pl-s1">process</span><span class="pl-kos">.</span><span class="pl-en">memoryUsage</span><span class="pl-kos">(</span><span class="pl-kos">)</span><span class="pl-kos">.</span><span class="pl-c1">heapTotal</span><span class="pl-kos">)</span><span class="pl-kos">;</span>
            <span class="pl-k">const</span> <span class="pl-s1">heapUsedMB</span> <span class="pl-c1">=</span> <span class="pl-en">bytesToMB</span><span class="pl-kos">(</span><span class="pl-s1">process</span><span class="pl-kos">.</span><span class="pl-en">memoryUsage</span><span class="pl-kos">(</span><span class="pl-kos">)</span><span class="pl-kos">.</span><span class="pl-c1">heapUsed</span><span class="pl-kos">)</span><span class="pl-kos">;</span>
            <span class="pl-k">const</span> <span class="pl-s1">externalKB</span> <span class="pl-c1">=</span> <span class="pl-en">bytesToKB</span><span class="pl-kos">(</span><span class="pl-s1">process</span><span class="pl-kos">.</span><span class="pl-en">memoryUsage</span><span class="pl-kos">(</span><span class="pl-kos">)</span><span class="pl-kos">.</span><span class="pl-c1">external</span><span class="pl-kos">)</span><span class="pl-kos">;</span>
            <span class="pl-k">const</span> <span class="pl-s1">arrayBuffersKB</span> <span class="pl-c1">=</span> <span class="pl-en">bytesToKB</span><span class="pl-kos">(</span><span class="pl-s1">process</span><span class="pl-kos">.</span><span class="pl-en">memoryUsage</span><span class="pl-kos">(</span><span class="pl-kos">)</span><span class="pl-kos">.</span><span class="pl-c1">arrayBuffers</span><span class="pl-kos">)</span><span class="pl-kos">;</span>
            <span class="pl-smi">console</span><span class="pl-kos">.</span><span class="pl-en">log</span><span class="pl-kos">(</span><span class="pl-s">`<span class="pl-s1"><span class="pl-kos">${</span><span class="pl-s1">i</span><span class="pl-kos">}</span></span>, <span class="pl-s1"><span class="pl-kos">${</span><span class="pl-s1">j</span><span class="pl-kos">}</span></span>, <span class="pl-s1"><span class="pl-kos">${</span><span class="pl-s1">rssMB</span><span class="pl-kos">}</span></span>, <span class="pl-s1"><span class="pl-kos">${</span><span class="pl-s1">heapTotalMB</span><span class="pl-kos">}</span></span>, <span class="pl-s1"><span class="pl-kos">${</span><span class="pl-s1">heapUsedMB</span><span class="pl-kos">}</span></span>, <span class="pl-s1"><span class="pl-kos">${</span><span class="pl-s1">externalKB</span><span class="pl-kos">}</span></span>, <span class="pl-s1"><span class="pl-kos">${</span><span class="pl-s1">arrayBuffersKB</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-smi">console</span><span class="pl-kos">.</span><span class="pl-s1">timeEnd</span><span class="pl-kos">(</span><span class="pl-s1">timerTotalTime</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>
<p dir="auto"><strong>Steps</strong></p>
<ul dir="auto">
<li>Run the sample test in PW <code class="notranslate">v1.32.3</code> in debug mode using the following command:<br>
<code class="notranslate">npx playwright test memory-leak-example --debug</code></li>
</ul>
<p dir="auto"><strong>Expected</strong></p>
<ul dir="auto">
<li>The sample test should take &lt; 25 seconds to complete, as it does in PW <code class="notranslate">v1.31.2</code></li>
</ul>
<p dir="auto"><strong>Actual</strong></p>
<ul dir="auto">
<li>The sample test takes &gt; 3m 30s to complete</li>
<li>In my private repo e2e tests, the test goes about 1/3 of the way, then the browser hangs and the test fails</li>
<li>I am unable to use PW <code class="notranslate">v1.32.0+</code> for my e2e tests due to performance and/or hung browser while in debug mode</li>
</ul>