<h3 dir="auto">Playwright version</h3>
<p dir="auto">1.13.0</p>
<h3 dir="auto">Operating system</h3>
<p dir="auto">MacOS, Linux</p>
<h3 dir="auto">What browsers are you seeing the problem on?</h3>
<p dir="auto">Chromium</p>
<h3 dir="auto">Other information</h3>
<p dir="auto"><em>No response</em></p>
<h3 dir="auto">What happened? / Describe the bug</h3>
<p dir="auto">When executing "sanitizeForFilePath", the return value may be the same.<br>
This has caused the screenshot to be overwritten.</p>
<p dir="auto">I want adjustment the regular expression condition or make it a unique value so that it will not be overwritten.</p>
<p dir="auto"></p><div class="Box Box--condensed my-2">
  <div class="Box-header f6">
    <p class="mb-0 text-bold">
      <a href="https://github.com/microsoft/playwright/blob/b1dc84c953ce275e9e48e30810be858ce2fd3b6d/src/test/workerRunner.ts#L566-L568">playwright/src/test/workerRunner.ts</a>
    </p>
    <p class="mb-0 color-fg-muted">
        Lines 566 to 568
      in
      <a data-pjax="true" class="commit-tease-sha" href="/microsoft/playwright/commit/b1dc84c953ce275e9e48e30810be858ce2fd3b6d">b1dc84c</a>
    </p>
  </div>
  <div itemprop="text" class="Box-body p-0 blob-wrapper blob-wrapper-embedded data">
    <table class="highlight tab-size mb-0 js-file-line-container" data-tab-size="8" data-paste-markdown-skip="">

        <tbody><tr class="border-0">
          <td id="L566" class="blob-num border-0 px-3 py-0 color-bg-default" data-line-number="566"></td>
          <td id="LC566" class="blob-code border-0 px-3 py-0 color-bg-default blob-code-inner js-file-line"> <span class="pl-k">function</span> <span class="pl-en">sanitizeForFilePath</span><span class="pl-kos">(</span><span class="pl-s1">s</span>: <span class="pl-smi">string</span><span class="pl-kos">)</span> <span class="pl-kos">{</span> </td>
        </tr>

        <tr class="border-0">
          <td id="L567" class="blob-num border-0 px-3 py-0 color-bg-default" data-line-number="567"></td>
          <td id="LC567" class="blob-code border-0 px-3 py-0 color-bg-default blob-code-inner js-file-line">   <span class="pl-k">return</span> <span class="pl-s1">s</span><span class="pl-kos">.</span><span class="pl-en">replace</span><span class="pl-kos">(</span><span class="pl-pds"><span class="pl-c1">/</span><span class="pl-kos">[</span>^<span class="pl-cce">\w</span><span class="pl-cce">\d</span><span class="pl-kos">]</span><span class="pl-c1">+</span><span class="pl-c1">/</span>g</span><span class="pl-kos">,</span> <span class="pl-s">'-'</span><span class="pl-kos">)</span><span class="pl-kos">;</span> </td>
        </tr>

        <tr class="border-0">
          <td id="L568" class="blob-num border-0 px-3 py-0 color-bg-default" data-line-number="568"></td>
          <td id="LC568" class="blob-code border-0 px-3 py-0 color-bg-default blob-code-inner js-file-line"> <span class="pl-kos">}</span> </td>
        </tr>
    </tbody></table>
  </div>
</div>
<p></p>
<h3 dir="auto">Code snippet to reproduce your bug</h3>
<div class="highlight highlight-source-shell notranslate position-relative overflow-auto" dir="auto" data-snippet-clipboard-copy-content="// failtest.spec.ts
import { test, expect } from '@playwright/test';

test('基本的なテスト', async ({ page }) =&gt; {
    await page.goto('https://playwright.dev/');
    const name = await page.innerText('.navbar__title');
    expect(name).toBe('Playwright!');
});

test('実験的なテスト', async ({ page }) =&gt; {
    await page.goto('https://playwright.dev/');
    const name = await page.innerText('.navbar__title');
    expect(name).toBe('Playwright!!');
});

// playwright.config.ts
import { PlaywrightTestConfig } from '@playwright/test';
const config: PlaywrightTestConfig = {
    use: {
        screenshot: 'only-on-failure',
    },
};
export default config;"><pre class="notranslate">// failtest.spec.ts
import { test, expect } from <span class="pl-s"><span class="pl-pds">'</span>@playwright/test<span class="pl-pds">'</span></span><span class="pl-k">;</span>

test(<span class="pl-s"><span class="pl-pds">'</span>基本的なテスト<span class="pl-pds">'</span></span>, async ({ page }) =<span class="pl-k">&gt;</span> {
    await page.goto(<span class="pl-s"><span class="pl-pds">'</span>https://playwright.dev/<span class="pl-pds">'</span></span>)<span class="pl-k">;</span>
    const name = await page.innerText(<span class="pl-s"><span class="pl-pds">'</span>.navbar__title<span class="pl-pds">'</span></span>)<span class="pl-k">;</span>
    expect(name).toBe(<span class="pl-s"><span class="pl-pds">'</span>Playwright!<span class="pl-pds">'</span></span>)<span class="pl-k">;</span>
})<span class="pl-k">;</span>

test(<span class="pl-s"><span class="pl-pds">'</span>実験的なテスト<span class="pl-pds">'</span></span>, async ({ page }) =<span class="pl-k">&gt;</span> {
    await page.goto(<span class="pl-s"><span class="pl-pds">'</span>https://playwright.dev/<span class="pl-pds">'</span></span>)<span class="pl-k">;</span>
    const name = await page.innerText(<span class="pl-s"><span class="pl-pds">'</span>.navbar__title<span class="pl-pds">'</span></span>)<span class="pl-k">;</span>
    expect(name).toBe(<span class="pl-s"><span class="pl-pds">'</span>Playwright!!<span class="pl-pds">'</span></span>)<span class="pl-k">;</span>
})<span class="pl-k">;</span>

// playwright.config.ts
import { PlaywrightTestConfig } from <span class="pl-s"><span class="pl-pds">'</span>@playwright/test<span class="pl-pds">'</span></span><span class="pl-k">;</span>
const config: PlaywrightTestConfig = {
    use: {
        screenshot: <span class="pl-s"><span class="pl-pds">'</span>only-on-failure<span class="pl-pds">'</span></span>,
    },
}<span class="pl-k">;</span>
<span class="pl-k">export</span> default config<span class="pl-k">;</span></pre></div>
<h3 dir="auto">Relevant log output</h3>
<p dir="auto"><em>No response</em></p>
<h3 dir="auto">Feature request</h3>
<p dir="auto">Hi,<br>
Currently Playwright-test's generated test output directory name is including the test's title, but it can only includes alphanumeric values, all non-ASCII character will be replaced with a hyphen <code class="notranslate">-</code>.</p>
<p dir="auto">My tests title is in Japanese so it would be nice if it can include non-ASCII character in the output folder.</p>