<h3 dir="auto">System info</h3>
<ul dir="auto">
<li>Playwright Version: 1.35.0</li>
<li>Operating System: [Ubuntu 22.04 amd64]</li>
<li>Browser: [Chromium, Firefox]</li>
<li>Other info:</li>
</ul>
<h3 dir="auto">Source code</h3>
<div class="highlight highlight-source-js notranslate position-relative overflow-auto" dir="auto" data-snippet-clipboard-copy-content="const { firefox,chromium } = require('playwright');
(async () =&gt; {
  const browser = await chromium.launch(
          {
                  headless:true,
                  args: ['--no-sandbox']
          }
  );
  const context = await browser.newContext();
  const page = await context.newPage();
  await page.goto('https://www.baidu.com');
  await page.screenshot({ path: 'example.png' });
  await browser.close();
  console.log('success');
})();"><pre class="notranslate"><span class="pl-k">const</span> <span class="pl-kos">{</span> firefox<span class="pl-kos">,</span>chromium <span class="pl-kos">}</span> <span class="pl-c1">=</span> <span class="pl-en">require</span><span class="pl-kos">(</span><span class="pl-s">'playwright'</span><span class="pl-kos">)</span><span class="pl-kos">;</span>
<span class="pl-kos">(</span><span class="pl-k">async</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">const</span> <span class="pl-s1">browser</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">launch</span><span class="pl-kos">(</span>
          <span class="pl-kos">{</span>
                  <span class="pl-c1">headless</span>:<span class="pl-c1">true</span><span class="pl-kos">,</span>
                  <span class="pl-c1">args</span>: <span class="pl-kos">[</span><span class="pl-s">'--no-sandbox'</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">const</span> <span class="pl-s1">context</span> <span class="pl-c1">=</span> <span class="pl-k">await</span> <span class="pl-s1">browser</span><span class="pl-kos">.</span><span class="pl-en">newContext</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">page</span> <span class="pl-c1">=</span> <span class="pl-k">await</span> <span class="pl-s1">context</span><span class="pl-kos">.</span><span class="pl-en">newPage</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">page</span><span class="pl-kos">.</span><span class="pl-en">goto</span><span class="pl-kos">(</span><span class="pl-s">'https://www.baidu.com'</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">screenshot</span><span class="pl-kos">(</span><span class="pl-kos">{</span> <span class="pl-c1">path</span>: <span class="pl-s">'example.png'</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">browser</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-smi">console</span><span class="pl-kos">.</span><span class="pl-en">log</span><span class="pl-kos">(</span><span class="pl-s">'success'</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">logs:</p>
<div class="snippet-clipboard-content notranslate position-relative overflow-auto" data-snippet-clipboard-copy-content="node:internal/process/promises:288
            triggerUncaughtException(err, true /* fromPromise */);
            ^

browserType.launch: Browser closed.
==================== Browser output: ====================
&lt;launching&gt; /root/.cache/ms-playwright/chromium-1067/chrome-linux/chrome --disable-field-trial-config --disable-background-networking --enable-features=NetworkService,NetworkServiceInProcess --disable-background-timer-throttling --disable-backgrounding-occluded-windows --disable-back-forward-cache --disable-breakpad --disable-client-side-phishing-detection --disable-component-extensions-with-background-pages --disable-component-update --no-default-browser-check --disable-default-apps --disable-dev-shm-usage --disable-extensions --disable-features=ImprovedCookieControls,LazyFrameLoading,GlobalMediaControls,DestroyProfileOnBrowserClose,MediaRouter,DialMediaRouteProvider,AcceptCHFrame,AutoExpandDetailsElement,CertificateTransparencyComponentUpdater,AvoidUnnecessaryBeforeUnloadCheckSync,Translate --allow-pre-commit-input --disable-hang-monitor --disable-ipc-flooding-protection --disable-popup-blocking --disable-prompt-on-repost --disable-renderer-backgrounding --force-color-profile=srgb --metrics-recording-only --no-first-run --enable-automation --password-store=basic --use-mock-keychain --no-service-autorun --export-tagged-pdf --headless --hide-scrollbars --mute-audio --blink-settings=primaryHoverType=2,availableHoverTypes=2,primaryPointerType=4,availablePointerTypes=4 --no-sandbox --no-sandbox --user-data-dir=/tmp/playwright_chromiumdev_profile-xhQibb --remote-debugging-pipe --no-startup-window
&lt;launched&gt; pid=39161
[pid=39161][err] [0611/044944.462754:ERROR:stack_trace_posix.cc(810)] Failed to parse the contents of /proc/self/maps
[pid=39161][err] [0611/044945.031667:ERROR:stack_trace_posix.cc(810)] Failed to parse the contents of /proc/self/maps
[pid=39161][err] [0611/044945.031834:ERROR:stack_trace_posix.cc(810)] Failed to parse the contents of /proc/self/maps
[pid=39161][err] [0611/044945.059913:FATAL:zygote_main_linux.cc(145)] Check failed: sandbox::ThreadHelpers::IsSingleThreaded().
[pid=39161][err] #0 0x004007dcfef2 base::debug::CollectStackTrace()
[pid=39161][err] #1 0x004007dbd263 base::debug::StackTrace::StackTrace()
[pid=39161][err] #2 0x004007d11504 logging::LogMessage::~LogMessage()
[pid=39161][err] #3 0x004007d11fbe logging::LogMessage::~LogMessage()
[pid=39161][err] #4 0x004007cfbd47 logging::CheckError::~CheckError()
[pid=39161][err] #5 0x0040071cb6b8 content::ZygoteMain()
[pid=39161][err] #6 0x0040071c46c6 content::RunZygote()
[pid=39161][err] #7 0x0040071c5592 content::RunOtherNamedProcessTypeMain()
[pid=39161][err] #8 0x0040071c6952 content::ContentMainRunnerImpl::Run()
[pid=39161][err] #9 0x0040071c3f30 content::RunContentProcess()
[pid=39161][err] #10 0x0040071c415d content::ContentMain()
[pid=39161][err] #11 0x004007835331 headless::HeadlessShellMain()
[pid=39161][err] #12 0x00400398f265 ChromeMain
[pid=39161][err] #13 0x004010ee9d90 &lt;unknown&gt;
[pid=39161][err] #14 0x004010ee9e40 __libc_start_main
[pid=39161][err] #15 0x00400398f02a _start
[pid=39161][err]
[pid=39161][err] [0611/044945.059918:FATAL:zygote_main_linux.cc(145)] Check failed: sandbox::ThreadHelpers::IsSingleThreaded().
[pid=39161][err] #0 0x004007dcfef2 base::debug::CollectStackTrace()
[pid=39161][err] #1 0x004007dbd263 base::debug::StackTrace::StackTrace()
[pid=39161][err] #2 0x004007d11504 logging::LogMessage::~LogMessage()
[pid=39161][err] #3 0x004007d11fbe logging::LogMessage::~LogMessage()
[pid=39161][err] #4 0x004007cfbd47 logging::CheckError::~CheckError()
[pid=39161][err] #5 0x0040071cb6b8 content::ZygoteMain()
[pid=39161][err] #6 0x0040071c46c6 content::RunZygote()
[pid=39161][err] #7 0x0040071c5592 content::RunOtherNamedProcessTypeMain()
[pid=39161][err] #8 0x0040071c6952 content::ContentMainRunnerImpl::Run()
[pid=39161][err] #9 0x0040071c3f30 content::RunContentProcess()
[pid=39161][err] #10 0x0040071c415d content::ContentMain()
[pid=39161][err] #11 0x004007835331 headless::HeadlessShellMain()
[pid=39161][err] #12 0x00400398f265 ChromeMain
[pid=39161][err] #13 0x004010ee9d90 &lt;unknown&gt;
[pid=39161][err] #14 0x004010ee9e40 __libc_start_main
[pid=39161][err] #15 0x00400398f02a _start
[pid=39161][err]
[pid=39161][err] qemu: uncaught target signal 5 (Trace/breakpoint trap) - core dumped
[pid=39161][err] qemu: uncaught target signal 5 (Trace/breakpoint trap) - core dumped
[pid=39161][err] [0611/044945.734913:ERROR:bus.cc(399)] Failed to connect to the bus: Failed to connect to socket /run/dbus/system_bus_socket: No such file or directory
[pid=39161][err] Received signal 11 SEGV_MAPERR 74652f202d2d29
[pid=39161][err] #0 0x004007dcfef2 base::debug::CollectStackTrace()
[pid=39161][err] #1 0x004007dbd263 base::debug::StackTrace::StackTrace()
[pid=39161][err] #2 0x004007dcf981 base::debug::(anonymous namespace)::StackDumpSignalHandler()
[pid=39161][err] #3 0x004010f02520 &lt;unknown&gt;
[pid=39161][err] #4 0x004008783009 FcCharSetFreeze
[pid=39161][err] #5 0x004008783837 FcCharSetSerializeAlloc
[pid=39161][err] #6 0x0040087923dc FcValueListSerializeAlloc
[pid=39161][err] #7 0x004008792331 FcPatternSerializeAlloc
[pid=39161][err] #8 0x00400878a110 FcFontSetSerializeAlloc
[pid=39161][err] #9 0x004008780500 FcDirCacheBuild
[pid=39161][err] #10 0x004008786223 FcDirCacheScan
[pid=39161][err] #11 0x0040087862c0 IA__FcDirCacheRead
[pid=39161][err] #12 0x00400877ac67 FcConfigAddDirList
[pid=39161][err] #13 0x00400877abb2 IA__FcConfigBuildFonts
[pid=39161][err] #14 0x00400878a8d1 IA__FcInitLoadConfigAndFonts
[pid=39161][err] #15 0x00400877a0c1 FcConfigInit
[pid=39161][err] #16 0x00400848e9c4 base::NoDestructor&lt;&gt;::NoDestructor&lt;&gt;()
[pid=39161][err] #17 0x00400848e2ad gfx::GetGlobalFontConfig()
[pid=39161][err] #18 0x004005d268be content::BrowserMainRunnerImpl::Initialize()
[pid=39161][err] #19 0x00400dee16eb headless::HeadlessContentMainDelegate::RunProcess()
[pid=39161][err] #20 0x0040071c51e2 content::RunBrowserProcessMain()
[pid=39161][err] #21 0x0040071c6b84 content::ContentMainRunnerImpl::RunBrowser()
[pid=39161][err] #22 0x0040071c6976 content::ContentMainRunnerImpl::Run()
[pid=39161][err] #23 0x0040071c3f30 content::RunContentProcess()
[pid=39161][err] #24 0x0040071c415d content::ContentMain()
[pid=39161][err] #25 0x00400783521e headless::HeadlessShellMain()
[pid=39161][err] #26 0x00400398f265 ChromeMain
[pid=39161][err] #27 0x004010ee9d90 &lt;unknown&gt;
[pid=39161][err] #28 0x004010ee9e40 __libc_start_main
[pid=39161][err] #29 0x00400398f02a _start
[pid=39161][err]   r8: 000036480006ce00  r9: 0000364800114340 r10: 000036480006c000 r11: 0000000000000000
[pid=39161][err]  r12: 0000364800114480 r13: 6374652f202d2d21 r14: 0000000000000008 r15: 00003648000264c0
[pid=39161][err]   di: 000000400e12b978  si: 0000000000000006  bp: 00000040101c9110  bx: 0000000000000008
[pid=39161][err]   dx: 0000000000000001  ax: 0000000000000000  cx: 0000000000000000  sp: 00000040101c9090
[pid=39161][err]   ip: 0000004008783009 efl: 0000000000000206 cgf: 002b000000000033 erf: 0000000000000004
[pid=39161][err]  trp: ffffffffffffffff msk: 0000000000000000 cr2: 0074652f202d2d29
[pid=39161][err] [end of stack trace]
[pid=39161][err] qemu: uncaught target signal 11 (Segmentation fault) - core dumped"><pre class="notranslate"><code class="notranslate">node:internal/process/promises:288
            triggerUncaughtException(err, true /* fromPromise */);
            ^

browserType.launch: Browser closed.
==================== Browser output: ====================
&lt;launching&gt; /root/.cache/ms-playwright/chromium-1067/chrome-linux/chrome --disable-field-trial-config --disable-background-networking --enable-features=NetworkService,NetworkServiceInProcess --disable-background-timer-throttling --disable-backgrounding-occluded-windows --disable-back-forward-cache --disable-breakpad --disable-client-side-phishing-detection --disable-component-extensions-with-background-pages --disable-component-update --no-default-browser-check --disable-default-apps --disable-dev-shm-usage --disable-extensions --disable-features=ImprovedCookieControls,LazyFrameLoading,GlobalMediaControls,DestroyProfileOnBrowserClose,MediaRouter,DialMediaRouteProvider,AcceptCHFrame,AutoExpandDetailsElement,CertificateTransparencyComponentUpdater,AvoidUnnecessaryBeforeUnloadCheckSync,Translate --allow-pre-commit-input --disable-hang-monitor --disable-ipc-flooding-protection --disable-popup-blocking --disable-prompt-on-repost --disable-renderer-backgrounding --force-color-profile=srgb --metrics-recording-only --no-first-run --enable-automation --password-store=basic --use-mock-keychain --no-service-autorun --export-tagged-pdf --headless --hide-scrollbars --mute-audio --blink-settings=primaryHoverType=2,availableHoverTypes=2,primaryPointerType=4,availablePointerTypes=4 --no-sandbox --no-sandbox --user-data-dir=/tmp/playwright_chromiumdev_profile-xhQibb --remote-debugging-pipe --no-startup-window
&lt;launched&gt; pid=39161
[pid=39161][err] [0611/044944.462754:ERROR:stack_trace_posix.cc(810)] Failed to parse the contents of /proc/self/maps
[pid=39161][err] [0611/044945.031667:ERROR:stack_trace_posix.cc(810)] Failed to parse the contents of /proc/self/maps
[pid=39161][err] [0611/044945.031834:ERROR:stack_trace_posix.cc(810)] Failed to parse the contents of /proc/self/maps
[pid=39161][err] [0611/044945.059913:FATAL:zygote_main_linux.cc(145)] Check failed: sandbox::ThreadHelpers::IsSingleThreaded().
[pid=39161][err] #0 0x004007dcfef2 base::debug::CollectStackTrace()
[pid=39161][err] #1 0x004007dbd263 base::debug::StackTrace::StackTrace()
[pid=39161][err] #2 0x004007d11504 logging::LogMessage::~LogMessage()
[pid=39161][err] #3 0x004007d11fbe logging::LogMessage::~LogMessage()
[pid=39161][err] #4 0x004007cfbd47 logging::CheckError::~CheckError()
[pid=39161][err] #5 0x0040071cb6b8 content::ZygoteMain()
[pid=39161][err] #6 0x0040071c46c6 content::RunZygote()
[pid=39161][err] #7 0x0040071c5592 content::RunOtherNamedProcessTypeMain()
[pid=39161][err] #8 0x0040071c6952 content::ContentMainRunnerImpl::Run()
[pid=39161][err] #9 0x0040071c3f30 content::RunContentProcess()
[pid=39161][err] #10 0x0040071c415d content::ContentMain()
[pid=39161][err] #11 0x004007835331 headless::HeadlessShellMain()
[pid=39161][err] #12 0x00400398f265 ChromeMain
[pid=39161][err] #13 0x004010ee9d90 &lt;unknown&gt;
[pid=39161][err] #14 0x004010ee9e40 __libc_start_main
[pid=39161][err] #15 0x00400398f02a _start
[pid=39161][err]
[pid=39161][err] [0611/044945.059918:FATAL:zygote_main_linux.cc(145)] Check failed: sandbox::ThreadHelpers::IsSingleThreaded().
[pid=39161][err] #0 0x004007dcfef2 base::debug::CollectStackTrace()
[pid=39161][err] #1 0x004007dbd263 base::debug::StackTrace::StackTrace()
[pid=39161][err] #2 0x004007d11504 logging::LogMessage::~LogMessage()
[pid=39161][err] #3 0x004007d11fbe logging::LogMessage::~LogMessage()
[pid=39161][err] #4 0x004007cfbd47 logging::CheckError::~CheckError()
[pid=39161][err] #5 0x0040071cb6b8 content::ZygoteMain()
[pid=39161][err] #6 0x0040071c46c6 content::RunZygote()
[pid=39161][err] #7 0x0040071c5592 content::RunOtherNamedProcessTypeMain()
[pid=39161][err] #8 0x0040071c6952 content::ContentMainRunnerImpl::Run()
[pid=39161][err] #9 0x0040071c3f30 content::RunContentProcess()
[pid=39161][err] #10 0x0040071c415d content::ContentMain()
[pid=39161][err] #11 0x004007835331 headless::HeadlessShellMain()
[pid=39161][err] #12 0x00400398f265 ChromeMain
[pid=39161][err] #13 0x004010ee9d90 &lt;unknown&gt;
[pid=39161][err] #14 0x004010ee9e40 __libc_start_main
[pid=39161][err] #15 0x00400398f02a _start
[pid=39161][err]
[pid=39161][err] qemu: uncaught target signal 5 (Trace/breakpoint trap) - core dumped
[pid=39161][err] qemu: uncaught target signal 5 (Trace/breakpoint trap) - core dumped
[pid=39161][err] [0611/044945.734913:ERROR:bus.cc(399)] Failed to connect to the bus: Failed to connect to socket /run/dbus/system_bus_socket: No such file or directory
[pid=39161][err] Received signal 11 SEGV_MAPERR 74652f202d2d29
[pid=39161][err] #0 0x004007dcfef2 base::debug::CollectStackTrace()
[pid=39161][err] #1 0x004007dbd263 base::debug::StackTrace::StackTrace()
[pid=39161][err] #2 0x004007dcf981 base::debug::(anonymous namespace)::StackDumpSignalHandler()
[pid=39161][err] #3 0x004010f02520 &lt;unknown&gt;
[pid=39161][err] #4 0x004008783009 FcCharSetFreeze
[pid=39161][err] #5 0x004008783837 FcCharSetSerializeAlloc
[pid=39161][err] #6 0x0040087923dc FcValueListSerializeAlloc
[pid=39161][err] #7 0x004008792331 FcPatternSerializeAlloc
[pid=39161][err] #8 0x00400878a110 FcFontSetSerializeAlloc
[pid=39161][err] #9 0x004008780500 FcDirCacheBuild
[pid=39161][err] #10 0x004008786223 FcDirCacheScan
[pid=39161][err] #11 0x0040087862c0 IA__FcDirCacheRead
[pid=39161][err] #12 0x00400877ac67 FcConfigAddDirList
[pid=39161][err] #13 0x00400877abb2 IA__FcConfigBuildFonts
[pid=39161][err] #14 0x00400878a8d1 IA__FcInitLoadConfigAndFonts
[pid=39161][err] #15 0x00400877a0c1 FcConfigInit
[pid=39161][err] #16 0x00400848e9c4 base::NoDestructor&lt;&gt;::NoDestructor&lt;&gt;()
[pid=39161][err] #17 0x00400848e2ad gfx::GetGlobalFontConfig()
[pid=39161][err] #18 0x004005d268be content::BrowserMainRunnerImpl::Initialize()
[pid=39161][err] #19 0x00400dee16eb headless::HeadlessContentMainDelegate::RunProcess()
[pid=39161][err] #20 0x0040071c51e2 content::RunBrowserProcessMain()
[pid=39161][err] #21 0x0040071c6b84 content::ContentMainRunnerImpl::RunBrowser()
[pid=39161][err] #22 0x0040071c6976 content::ContentMainRunnerImpl::Run()
[pid=39161][err] #23 0x0040071c3f30 content::RunContentProcess()
[pid=39161][err] #24 0x0040071c415d content::ContentMain()
[pid=39161][err] #25 0x00400783521e headless::HeadlessShellMain()
[pid=39161][err] #26 0x00400398f265 ChromeMain
[pid=39161][err] #27 0x004010ee9d90 &lt;unknown&gt;
[pid=39161][err] #28 0x004010ee9e40 __libc_start_main
[pid=39161][err] #29 0x00400398f02a _start
[pid=39161][err]   r8: 000036480006ce00  r9: 0000364800114340 r10: 000036480006c000 r11: 0000000000000000
[pid=39161][err]  r12: 0000364800114480 r13: 6374652f202d2d21 r14: 0000000000000008 r15: 00003648000264c0
[pid=39161][err]   di: 000000400e12b978  si: 0000000000000006  bp: 00000040101c9110  bx: 0000000000000008
[pid=39161][err]   dx: 0000000000000001  ax: 0000000000000000  cx: 0000000000000000  sp: 00000040101c9090
[pid=39161][err]   ip: 0000004008783009 efl: 0000000000000206 cgf: 002b000000000033 erf: 0000000000000004
[pid=39161][err]  trp: ffffffffffffffff msk: 0000000000000000 cr2: 0074652f202d2d29
[pid=39161][err] [end of stack trace]
[pid=39161][err] qemu: uncaught target signal 11 (Segmentation fault) - core dumped
</code></pre></div>
<h3 dir="auto">System info</h3>
<ul dir="auto">
<li>Playwright Version: [v1.33.0]</li>
<li>Operating System: [All, Windows 11, Ubuntu 20, macOS 13.2, etc.]</li>
<li>Browser: [All, Chromium, Firefox, WebKit]</li>
<li>Other info:</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"><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 type { PlaywrightTestConfig } from '@playwright/test';
import { LaunchOptions, devices } from '@playwright/test';

/**
 * Read environment variables from file.
 * https://github.com/motdotla/dotenv
 */
require('dotenv').config();

const browserOptions: LaunchOptions = {
  slowMo: 0,
  args: [
    '--use-fake-ui-for-media-stream',
    '--use-fake-device-for-media-stream',
  ],
  firefoxUserPrefs: {
    'media.navigator.streams.fake': true,
    'media.navigator.permission.disabled': true,
  },
};

/**
 * See https://playwright.dev/docs/test-configuration.
 */
const config: PlaywrightTestConfig = {
  testDir: './tests',
  /* Maximum time one test can run for. */
  timeout: 500 * 1000,
  expect: {
    /**
     * Maximum time expect() should wait for the condition to be met.
     * For example in `await expect(locator).toHaveText();`
     */
    timeout: 50000,
  },
  /* Run tests in files in parallel */
  fullyParallel: process.env.PARALLEL == 'true',
  /* Fail the build on CI if you accidentally left test.only in the source code. */
  forbidOnly: !!process.env.CI,
  /* Retry on CI only */
  retries: parseInt(process.env.RETRIES || '1'),
  /* Opt out of parallel tests on CI. */
  workers: parseInt(process.env.WORKERS || '20'),
  /* Reporter to use. See https://playwright.dev/docs/test-reporters */
  reporter: [['html', { outputFolder: 'playwright-report' }]],
  /* Shared settings for all the projects below. See https://playwright.dev/docs/api/class-testoptions. */
  use: {
    baseURL: process.env.FRONT,
    headless: process.env.HEADLESS == 'true',
    launchOptions: browserOptions,
    trace: 'on',
    // browserName: process.env.BROWSER,
    channel: process.env.CHANNEL,
  },
  /* Configure projects for major browsers */
  projects: [
    {
      name: 'Chrome Desktop',
      use: {
        headless: true,
        ...devices['Desktop Chrome'],
        channel: 'chrome',
      },
    },
  ],

  /* Folder for test artifacts such as screenshots, videos, traces, etc. */
  // outputDir: 'test-results/',

  /* Run your local dev server before starting the tests */
  // webServer: {
  //   command: 'npm run start',
  //   port: 3000,
  // },
};

export default config;"><pre class="notranslate"><span class="pl-c">// playwright.config.ts</span>
<span class="pl-k">import</span> <span class="pl-s1">type</span> <span class="pl-kos">{</span> <span class="pl-v">PlaywrightTestConfig</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">import</span> <span class="pl-kos">{</span> <span class="pl-v">LaunchOptions</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-c">/**</span>
<span class="pl-c"> * Read environment variables from file.</span>
<span class="pl-c"> * https://github.com/motdotla/dotenv</span>
<span class="pl-c"> */</span>
<span class="pl-en">require</span><span class="pl-kos">(</span><span class="pl-s">'dotenv'</span><span class="pl-kos">)</span><span class="pl-kos">.</span><span class="pl-en">config</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">browserOptions</span>: <span class="pl-v">LaunchOptions</span> <span class="pl-c1">=</span> <span class="pl-kos">{</span>
  <span class="pl-c1">slowMo</span>: <span class="pl-c1">0</span><span class="pl-kos">,</span>
  <span class="pl-c1">args</span>: <span class="pl-kos">[</span>
    <span class="pl-s">'--use-fake-ui-for-media-stream'</span><span class="pl-kos">,</span>
    <span class="pl-s">'--use-fake-device-for-media-stream'</span><span class="pl-kos">,</span>
  <span class="pl-kos">]</span><span class="pl-kos">,</span>
  <span class="pl-c1">firefoxUserPrefs</span>: <span class="pl-kos">{</span>
    <span class="pl-s">'media.navigator.streams.fake'</span>: <span class="pl-c1">true</span><span class="pl-kos">,</span>
    <span class="pl-s">'media.navigator.permission.disabled'</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-kos">}</span><span class="pl-kos">;</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">const</span> <span class="pl-s1">config</span>: <span class="pl-v">PlaywrightTestConfig</span> <span class="pl-c1">=</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-c">/* Maximum time one test can run for. */</span>
  <span class="pl-c1">timeout</span>: <span class="pl-c1">500</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">50000</span><span class="pl-kos">,</span>
  <span class="pl-kos">}</span><span class="pl-kos">,</span>
  <span class="pl-c">/* Run tests in files in parallel */</span>
  <span class="pl-c1">fullyParallel</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">PARALLEL</span> <span class="pl-c1">==</span> <span class="pl-s">'true'</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-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">RETRIES</span> <span class="pl-c1">||</span> <span class="pl-s">'1'</span><span class="pl-kos">)</span><span class="pl-kos">,</span>
  <span class="pl-c">/* Opt out of parallel tests on CI. */</span>
  <span class="pl-c1">workers</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">WORKERS</span> <span class="pl-c1">||</span> <span class="pl-s">'20'</span><span class="pl-kos">)</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-kos">[</span><span class="pl-kos">[</span><span class="pl-s">'html'</span><span class="pl-kos">,</span> <span class="pl-kos">{</span> <span class="pl-c1">outputFolder</span>: <span class="pl-s">'playwright-report'</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">/* 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-c1">baseURL</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">FRONT</span><span class="pl-kos">,</span>
    <span class="pl-c1">headless</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">HEADLESS</span> <span class="pl-c1">==</span> <span class="pl-s">'true'</span><span class="pl-kos">,</span>
    <span class="pl-c1">launchOptions</span>: <span class="pl-s1">browserOptions</span><span class="pl-kos">,</span>
    <span class="pl-c1">trace</span>: <span class="pl-s">'on'</span><span class="pl-kos">,</span>
    <span class="pl-c">// browserName: process.env.BROWSER,</span>
    <span class="pl-c1">channel</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">CHANNEL</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">'Chrome Desktop'</span><span class="pl-kos">,</span>
      <span class="pl-c1">use</span>: <span class="pl-kos">{</span>
        <span class="pl-c1">headless</span>: <span class="pl-c1">true</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">channel</span>: <span class="pl-s">'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-kos">,</span>

  <span class="pl-c">/* Folder for test artifacts such as screenshots, videos, traces, etc. */</span>
  <span class="pl-c">// outputDir: 'test-results/',</span>

  <span class="pl-c">/* Run your local dev server before starting the tests */</span>
  <span class="pl-c">// webServer: {</span>
  <span class="pl-c">//   command: 'npm run start',</span>
  <span class="pl-c">//   port: 3000,</span>
  <span class="pl-c">// },</span>
<span class="pl-kos">}</span><span class="pl-kos">;</span>

<span class="pl-k">export</span> <span class="pl-k">default</span> <span class="pl-s1">config</span><span class="pl-kos">;</span></pre></div>
<hr>
<p dir="auto"><strong>Steps</strong><br>
1- Set the config <code class="notranslate">trace: 'retain-on-failure',</code> on // playwright.config.ts<br>
2- Set the HTML report config <code class="notranslate">reporter: [['html', { outputFolder: 'playwright-report' }]],</code> on // playwright.config.ts<br>
3- Create any test that contains at least 5 steps and one of the tests is failing<br>
4- Observe the time-travel results</p>
<hr>
<p dir="auto">Use this command to run the test and check the time travel trace</p>
<p dir="auto"><code class="notranslate">npx playwright test</code></p>
<p dir="auto">or</p>
<p dir="auto"><code class="notranslate">npx playwright test --reporter=html</code></p>
<p dir="auto"><strong>Expected</strong></p>
<p dir="auto">This is the expected behaviour when enabling the config <code class="notranslate">trace: 'retain-on-failure',</code>. Using this config it should display all steps in the time-travel report if any step failed.</p>
<details open="" class="details-reset border rounded-2">
  <summary class="px-3 py-2">
    <svg aria-hidden="true" height="16" viewBox="0 0 16 16" version="1.1" width="16" data-view-component="true" class="octicon octicon-device-camera-video">
    <path d="M16 3.75v8.5a.75.75 0 0 1-1.136.643L11 10.575v.675A1.75 1.75 0 0 1 9.25 13h-7.5A1.75 1.75 0 0 1 0 11.25v-6.5C0 3.784.784 3 1.75 3h7.5c.966 0 1.75.784 1.75 1.75v.675l3.864-2.318A.75.75 0 0 1 16 3.75Zm-6.5 1a.25.25 0 0 0-.25-.25h-7.5a.25.25 0 0 0-.25.25v6.5c0 .138.112.25.25.25h7.5a.25.25 0 0 0 .25-.25v-6.5ZM11 8.825l3.5 2.1v-5.85l-3.5 2.1Z"></path>
</svg>
    <span aria-label="Video description 2023-05-11_11-24-57.mp4" class="m-1">2023-05-11_11-24-57.mp4</span>
    <span class="dropdown-caret"></span>
  </summary>

  <video src="https://user-images.githubusercontent.com/83456381/237745174-5119f13d-7d8d-4ea5-b461-4d727a4b28a1.mp4" data-canonical-src="https://user-images.githubusercontent.com/83456381/237745174-5119f13d-7d8d-4ea5-b461-4d727a4b28a1.mp4" controls="controls" muted="muted" class="d-block rounded-bottom-2 border-top width-fit" style="max-height:640px; min-height: 200px">

  </video>
</details>

<p dir="auto"><strong>Actual</strong></p>
<p dir="auto">This is the behaviour when enabling the config <code class="notranslate">trace: 'retain-on-failure',</code>. Please see attached video</p>
<details open="" class="details-reset border rounded-2">
  <summary class="px-3 py-2">
    <svg aria-hidden="true" height="16" viewBox="0 0 16 16" version="1.1" width="16" data-view-component="true" class="octicon octicon-device-camera-video">
    <path d="M16 3.75v8.5a.75.75 0 0 1-1.136.643L11 10.575v.675A1.75 1.75 0 0 1 9.25 13h-7.5A1.75 1.75 0 0 1 0 11.25v-6.5C0 3.784.784 3 1.75 3h7.5c.966 0 1.75.784 1.75 1.75v.675l3.864-2.318A.75.75 0 0 1 16 3.75Zm-6.5 1a.25.25 0 0 0-.25-.25h-7.5a.25.25 0 0 0-.25.25v6.5c0 .138.112.25.25.25h7.5a.25.25 0 0 0 .25-.25v-6.5ZM11 8.825l3.5 2.1v-5.85l-3.5 2.1Z"></path>
</svg>
    <span aria-label="Video description 2023-05-11_11-36-06.mp4" class="m-1">2023-05-11_11-36-06.mp4</span>
    <span class="dropdown-caret"></span>
  </summary>

  <video src="https://user-images.githubusercontent.com/83456381/237742419-fa90f076-e2a2-4ea2-8ddb-421154858f8c.mp4" data-canonical-src="https://user-images.githubusercontent.com/83456381/237742419-fa90f076-e2a2-4ea2-8ddb-421154858f8c.mp4" controls="controls" muted="muted" class="d-block rounded-bottom-2 border-top width-fit" style="max-height:640px; min-height: 200px">

  </video>
</details>