<h3 dir="auto">System info</h3>
<ul dir="auto">
<li>Playwright Version: 1.32</li>
<li>Operating System: macOS</li>
<li>Browser: All</li>
<li>Other info: UI mode</li>
</ul>
<p dir="auto"><strong>Steps</strong><br>
Type something in the search/filter input in UI mode and hit enter.</p>
<p dir="auto"><strong>Expected</strong><br>
Just filters the tests that matches the string.</p>
<p dir="auto"><strong>Actual</strong><br>
It filters the tests but also triggers all the tests that were matched.<br>
<a target="_blank" rel="noopener noreferrer nofollow" href="https://user-images.githubusercontent.com/22205721/227068880-d892b73f-5763-4f65-b6fa-e215913e825c.png"><img width="259" alt="Screen Shot 2023-03-22 at 5 28 13 PM" src="https://user-images.githubusercontent.com/22205721/227068880-d892b73f-5763-4f65-b6fa-e215913e825c.png" style="max-width: 100%;"></a></p>
<h3 dir="auto">System info</h3>
<ul dir="auto">
<li>Playwright Version: v1.36.0</li>
<li>Operating System: Windows 11 (WSL Ubuntu)</li>
<li>Browser: Chromium</li>
<li>Other info:</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="import { defineConfig } from '@playwright/test'
import { devices } from '@playwright/test'

/**
 * See https://playwright.dev/docs/test-configuration.
 */
export default defineConfig({
  testDir: './playwright-e2e',

  /**
   Maximum time one test can run for =&gt; 120 seconds.
   This timeout is also the reason, why the playwright generator exits after 120 seconds (120 * 1000).
   You need to temporarily adjust this value if you want to use the generator for a longer time.
   */
  // timeout: 120 * 1000 * 1000,
  timeout: 120 * 1000,

  expect: {
    /**
     * Maximum time expect() should wait for the condition to be met.
     * For example in `await expect(locator).toHaveText();`
     */
    timeout: 100000,
  },

  /* Report the slowest tests (up to `max`) slower than `threshold` (in ms) */
  reportSlowTests: { max: 5, threshold: 30 * 1000 },

  /* Fail the build on CI if you accidentally left test.only in the source code. */
  forbidOnly: !!process.env.CI,

  /* Retry on CI only */
  retries: process.env.CI ? 2 : 0,

  /*
   * Use only as many workers as there are CPUs, but at most 4.
   *
   * Ambient Gitlab-CI workers in May 2022 crashed consistently with more than 2 worker nodes.
   * On an AMD machine with 6 cores and 12 threads using more than 6 workers slowed the tests significantly
   * Because 4-cores/8-threads is the most common dev machine, using 4 workers at most seems reasonable
   */
  workers: process.env.CI ? 2 : 4,

  /*
   * Run tests inside a Testcase in parallel by default.
   * Use test.describe.configure({ mode: 'serial' }) to avoid that,
   * but at this point in time all our tests were  manually marked as parallel mode anyway.
   */
  fullyParallel: true,

  /* Reporter to use. See https://playwright.dev/docs/test-reporters */
  reporter: process.env.CI
    ? [['junit', { outputFile: 'test-results/junit.xml' }], ['list']]
    : 'list',

  /* Shared settings for all the projects below. See https://playwright.dev/docs/api/class-testoptions. */
  use: {
    /* Maximum time each action such as `click()` can take. Defaults to 0 (no limit). Limit set to 30s to stop
     infinite tests */
    actionTimeout: 30 * 1000,

    /* Base URL to use in actions like `await page.goto('/')`. */
    baseURL: 'http://localhost:3000',

    screenshot: process.env.PLAYWRIGHT_SLOW_MO ? 'on' : 'only-on-failure',
    video: process.env.PLAYWRIGHT_SLOW_MO ? 'on' : 'retry-with-video',
    trace: process.env.PLAYWRIGHT_SLOW_MO ? 'on' : 'on-all-retries',
  },

  /* Configure projects for major browsers */
  projects: [
    {
      name: 'empto',

      /*
      Project-specific settings.

      launchOptions: {slowMo: 1000,} controls how fast playwright executes the specified commands in a headed run.
      Uncomment this option, if you want to have time when watching how playwright executes tests
      */
      use: {
        ...devices['Desktop Chrome'],
        viewport: { width: 1440, height: 900 },
        launchOptions: {
          slowMo: parseInt(process.env.PLAYWRIGHT_SLOW_MO || '0'),
        },
      },
    },
  ],

  /* Folder for test artifacts such as screenshots, videos, traces, etc. */
  outputDir: 'test-results/',
  globalSetup: require.resolve('./global-setup'),
})
"><pre class="notranslate"><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-k">import</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-c">/**</span>
<span class="pl-c"> * See https://playwright.dev/docs/test-configuration.</span>
<span class="pl-c"> */</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">'./playwright-e2e'</span><span class="pl-kos">,</span>

  <span class="pl-c">/**</span>
<span class="pl-c">   Maximum time one test can run for =&gt; 120 seconds.</span>
<span class="pl-c">   This timeout is also the reason, why the playwright generator exits after 120 seconds (120 * 1000).</span>
<span class="pl-c">   You need to temporarily adjust this value if you want to use the generator for a longer time.</span>
<span class="pl-c">   */</span>
  <span class="pl-c">// timeout: 120 * 1000 * 1000,</span>
  <span class="pl-c1">timeout</span>: <span class="pl-c1">120</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-kos">{</span>
    <span class="pl-c">/**</span>
<span class="pl-c">     * Maximum time expect() should wait for the condition to be met.</span>
<span class="pl-c">     * For example in `await expect(locator).toHaveText();`</span>
<span class="pl-c">     */</span>
    <span class="pl-c1">timeout</span>: <span class="pl-c1">100000</span><span class="pl-kos">,</span>
  <span class="pl-kos">}</span><span class="pl-kos">,</span>

  <span class="pl-c">/* Report the slowest tests (up to `max`) slower than `threshold` (in ms) */</span>
  <span class="pl-c1">reportSlowTests</span>: <span class="pl-kos">{</span> <span class="pl-c1">max</span>: <span class="pl-c1">5</span><span class="pl-kos">,</span> <span class="pl-c1">threshold</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-kos">,</span>

  <span class="pl-c">/* Fail the build on CI if you accidentally left test.only in the source code. */</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-c">/* Retry on CI only */</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-c">/*</span>
<span class="pl-c">   * Use only as many workers as there are CPUs, but at most 4.</span>
<span class="pl-c">   *</span>
<span class="pl-c">   * Ambient Gitlab-CI workers in May 2022 crashed consistently with more than 2 worker nodes.</span>
<span class="pl-c">   * On an AMD machine with 6 cores and 12 threads using more than 6 workers slowed the tests significantly</span>
<span class="pl-c">   * Because 4-cores/8-threads is the most common dev machine, using 4 workers at most seems reasonable</span>
<span class="pl-c">   */</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">2</span> : <span class="pl-c1">4</span><span class="pl-kos">,</span>

  <span class="pl-c">/*</span>
<span class="pl-c">   * Run tests inside a Testcase in parallel by default.</span>
<span class="pl-c">   * Use test.describe.configure({ mode: 'serial' }) to avoid that,</span>
<span class="pl-c">   * but at this point in time all our tests were  manually marked as parallel mode anyway.</span>
<span class="pl-c">   */</span>
  <span class="pl-c1">fullyParallel</span>: <span class="pl-c1">true</span><span class="pl-kos">,</span>

  <span class="pl-c">/* Reporter to use. See https://playwright.dev/docs/test-reporters */</span>
  <span class="pl-c1">reporter</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-kos">[</span><span class="pl-s">'junit'</span><span class="pl-kos">,</span> <span class="pl-kos">{</span> <span class="pl-c1">outputFile</span>: <span class="pl-s">'test-results/junit.xml'</span> <span class="pl-kos">}</span><span class="pl-kos">]</span><span class="pl-kos">,</span> <span class="pl-kos">[</span><span class="pl-s">'list'</span><span class="pl-kos">]</span><span class="pl-kos">]</span>
    : <span class="pl-s">'list'</span><span class="pl-kos">,</span>

  <span class="pl-c">/* Shared settings for all the projects below. See https://playwright.dev/docs/api/class-testoptions. */</span>
  <span class="pl-c1">use</span>: <span class="pl-kos">{</span>
    <span class="pl-c">/* Maximum time each action such as `click()` can take. Defaults to 0 (no limit). Limit set to 30s to stop</span>
<span class="pl-c">     infinite tests */</span>
    <span class="pl-c1">actionTimeout</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-c">/* Base URL to use in actions like `await page.goto('/')`. */</span>
    <span class="pl-c1">baseURL</span>: <span class="pl-s">'http://localhost:3000'</span><span class="pl-kos">,</span>

    <span class="pl-c1">screenshot</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">PLAYWRIGHT_SLOW_MO</span> ? <span class="pl-s">'on'</span> : <span class="pl-s">'only-on-failure'</span><span class="pl-kos">,</span>
    <span class="pl-c1">video</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">PLAYWRIGHT_SLOW_MO</span> ? <span class="pl-s">'on'</span> : <span class="pl-s">'retry-with-video'</span><span class="pl-kos">,</span>
    <span class="pl-c1">trace</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">PLAYWRIGHT_SLOW_MO</span> ? <span class="pl-s">'on'</span> : <span class="pl-s">'on-all-retries'</span><span class="pl-kos">,</span>
  <span class="pl-kos">}</span><span class="pl-kos">,</span>

  <span class="pl-c">/* Configure projects for major browsers */</span>
  <span class="pl-c1">projects</span>: <span class="pl-kos">[</span>
    <span class="pl-kos">{</span>
      <span class="pl-c1">name</span>: <span class="pl-s">'empto'</span><span class="pl-kos">,</span>

      <span class="pl-c">/*</span>
<span class="pl-c">      Project-specific settings.</span>
<span class="pl-c"></span>
<span class="pl-c">      launchOptions: {slowMo: 1000,} controls how fast playwright executes the specified commands in a headed run.</span>
<span class="pl-c">      Uncomment this option, if you want to have time when watching how playwright executes tests</span>
<span class="pl-c">      */</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-c1">viewport</span>: <span class="pl-kos">{</span> <span class="pl-c1">width</span>: <span class="pl-c1">1440</span><span class="pl-kos">,</span> <span class="pl-c1">height</span>: <span class="pl-c1">900</span> <span class="pl-kos">}</span><span class="pl-kos">,</span>
        <span class="pl-c1">launchOptions</span>: <span class="pl-kos">{</span>
          <span class="pl-c1">slowMo</span>: <span class="pl-en">parseInt</span><span class="pl-kos">(</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">PLAYWRIGHT_SLOW_MO</span> <span class="pl-c1">||</span> <span class="pl-s">'0'</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>

  <span class="pl-c">/* Folder for test artifacts such as screenshots, videos, traces, etc. */</span>
  <span class="pl-c1">outputDir</span>: <span class="pl-s">'test-results/'</span><span class="pl-kos">,</span>
  <span class="pl-c1">globalSetup</span>: <span class="pl-en">require</span><span class="pl-kos">.</span><span class="pl-en">resolve</span><span class="pl-kos">(</span><span class="pl-s">'./global-setup'</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="test.describe('Try valid users', () =&gt; {
    test.use({
      storageState: `loginContexts/loggedin.json`,
    })
    test(`are the internal downloads visible for loggedin`, async ({
      page,
      headless,
    }) =&gt; {
      await page.goto('http://localhost:3000/')
      await page.locator('.dropdown-toggle-icon &gt;&gt; nth=-1').click()
      await page.getByRole('link', { name: 'Interne Downloads' }).click()
      await page.getByRole('link', { name: 'Testseite' })

      if (headless) {
        // PDF Files are downloaded in headless mode
        const downloadPromise = page.waitForEvent('download')
        await page
          .locator('a:text(&quot;Testseite&quot;):above(a:text(&quot;epd Logo vertical&quot;))')
          .click()
        const download = await downloadPromise
        const filename = download.suggestedFilename()
        await expect(filename).toBe('testseite.pdf')
      } else {
        // PDF files are shown in a new browser tab using the built-in PDF viewer in headed mode
        const popupPromise = page.waitForEvent('popup')
        await page
          .locator('a:text(&quot;Testseite&quot;):above(a:text(&quot;epd Logo vertical&quot;))')
          .click()
        const popup = await popupPromise
        // Wait for the popup to load.
        await popup.waitForLoadState()
        const url = popup.url()
        await expect(url).toContain('testseite.pdf')
      }
    })
  })"><pre class="notranslate"><span class="pl-s1">test</span><span class="pl-kos">.</span><span class="pl-en">describe</span><span class="pl-kos">(</span><span class="pl-s">'Try valid users'</span><span class="pl-kos">,</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-s1">test</span><span class="pl-kos">.</span><span class="pl-en">use</span><span class="pl-kos">(</span><span class="pl-kos">{</span>
      <span class="pl-c1">storageState</span>: <span class="pl-s">`loginContexts/loggedin.json`</span><span class="pl-kos">,</span>
    <span class="pl-kos">}</span><span class="pl-kos">)</span>
    <span class="pl-en">test</span><span class="pl-kos">(</span><span class="pl-s">`are the internal downloads visible for loggedin`</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>
      headless<span class="pl-kos">,</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-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-s">'http://localhost:3000/'</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">locator</span><span class="pl-kos">(</span><span class="pl-s">'.dropdown-toggle-icon &gt;&gt; nth=-1'</span><span class="pl-kos">)</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-k">await</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">'link'</span><span class="pl-kos">,</span> <span class="pl-kos">{</span> <span class="pl-c1">name</span>: <span class="pl-s">'Interne Downloads'</span> <span class="pl-kos">}</span><span class="pl-kos">)</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-k">await</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">'link'</span><span class="pl-kos">,</span> <span class="pl-kos">{</span> <span class="pl-c1">name</span>: <span class="pl-s">'Testseite'</span> <span class="pl-kos">}</span><span class="pl-kos">)</span>

      <span class="pl-k">if</span> <span class="pl-kos">(</span><span class="pl-s1">headless</span><span class="pl-kos">)</span> <span class="pl-kos">{</span>
        <span class="pl-c">// PDF Files are downloaded in headless mode</span>
        <span class="pl-k">const</span> <span class="pl-s1">downloadPromise</span> <span class="pl-c1">=</span> <span class="pl-s1">page</span><span class="pl-kos">.</span><span class="pl-en">waitForEvent</span><span class="pl-kos">(</span><span class="pl-s">'download'</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">locator</span><span class="pl-kos">(</span><span class="pl-s">'a:text("Testseite"):above(a:text("epd Logo vertical"))'</span><span class="pl-kos">)</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-k">const</span> <span class="pl-s1">download</span> <span class="pl-c1">=</span> <span class="pl-k">await</span> <span class="pl-s1">downloadPromise</span>
        <span class="pl-k">const</span> <span class="pl-s1">filename</span> <span class="pl-c1">=</span> <span class="pl-s1">download</span><span class="pl-kos">.</span><span class="pl-en">suggestedFilename</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">filename</span><span class="pl-kos">)</span><span class="pl-kos">.</span><span class="pl-en">toBe</span><span class="pl-kos">(</span><span class="pl-s">'testseite.pdf'</span><span class="pl-kos">)</span>
      <span class="pl-kos">}</span> <span class="pl-k">else</span> <span class="pl-kos">{</span>
        <span class="pl-c">// PDF files are shown in a new browser tab using the built-in PDF viewer in headed mode</span>
        <span class="pl-k">const</span> <span class="pl-s1">popupPromise</span> <span class="pl-c1">=</span> <span class="pl-s1">page</span><span class="pl-kos">.</span><span class="pl-en">waitForEvent</span><span class="pl-kos">(</span><span class="pl-s">'popup'</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">locator</span><span class="pl-kos">(</span><span class="pl-s">'a:text("Testseite"):above(a:text("epd Logo vertical"))'</span><span class="pl-kos">)</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-k">const</span> <span class="pl-s1">popup</span> <span class="pl-c1">=</span> <span class="pl-k">await</span> <span class="pl-s1">popupPromise</span>
        <span class="pl-c">// Wait for the popup to load.</span>
        <span class="pl-k">await</span> <span class="pl-s1">popup</span><span class="pl-kos">.</span><span class="pl-en">waitForLoadState</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-s1">popup</span><span class="pl-kos">.</span><span class="pl-en">url</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">url</span><span class="pl-kos">)</span><span class="pl-kos">.</span><span class="pl-en">toContain</span><span class="pl-kos">(</span><span class="pl-s">'testseite.pdf'</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>Steps</strong></p>
<ul dir="auto">
<li>Run the test with traces set to always record (<code class="notranslate">on</code>)</li>
</ul>
<p dir="auto"><strong>Expected</strong></p>
<ul dir="auto">
<li>The test should work just fine even if I tell it to record traces on successful runs</li>
</ul>
<p dir="auto"><strong>Actual</strong></p>
<ul dir="auto">
<li>
<p dir="auto">The test fails, complaining it can't find screenshot <a class="issue-link js-issue-link" data-error-text="Failed to load title" data-id="524784715" data-permission-text="Title is private" data-url="https://github.com/microsoft/playwright/issues/2" data-hovercard-type="pull_request" data-hovercard-url="/microsoft/playwright/pull/2/hovercard" href="https://github.com/microsoft/playwright/pull/2">#2</a> <code class="notranslate">Error: ENOENT: no such file or directory, open '/home/benedikt/develop/empto/test-results/general-emptoInternalDownloads-Try-valid-users-6acb2-ads-visible-for-mp-makler-premium-dashboard-epd-empto/test-finished-2.png'</code></p>
</li>
<li>
<p dir="auto">If I turn off the trace-recording and only save a video and screenshots the test runs fine</p>
</li>
<li>
<p dir="auto">If I run the test in headed mode trace-recording works just fine as well. This leads me to believe the problem is with taking a screenshot of a Download (headless mode) vs taking a screenshot of the PDF-Viewer Tab that chrome opens in headed mode instead.</p>
</li>
</ul>
<p dir="auto">I can't share the site the test is running against (proprietary code, not hosted on GitHub) - If absolutely necessary to reproduce, I can try and whip up a minimal sample site.<br>
The testcase explicitly has separate paths for headless and headed mode because Playwright has no way to turn on/off browser features (here: the PDF-Viewer) in either headless or headed mode. (AFAIK there is no way to enable the PDF viewer in chromium headless)<br>
I'm aware this isn't a great solution, but it's one that works (well, except for the trace-recorder, which seems to have problems here)</p>