<h3 dir="auto">System info</h3>
<ul dir="auto">
<li>Playwright Version: v1.32.3</li>
<li>Operating System: macOS 13.3.1</li>
<li>Browser: Chromium</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>Link to the GitHub repository with the repro</strong></p>
<p dir="auto"><a href="https://github.com/silvenon/repro/tree/379b04a1bf5111d99caf8f86e404100d77d086aa">https://github.com/silvenon/repro at 379b04a1bf5111d99caf8f86e404100d77d086aa</a></p>
<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('has title', async ({ page }) =&gt; {
  test.fail()
  await page.goto('https://playwright.dev/');
  await expect(page).toHaveTitle(/Cypress/);
});"><pre class="notranslate"><span class="pl-en">test</span><span class="pl-kos">(</span><span class="pl-s">'has title'</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-kos">{</span>
  <span class="pl-s1">test</span><span class="pl-kos">.</span><span class="pl-en">fail</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://playwright.dev/'</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">page</span><span class="pl-kos">)</span><span class="pl-kos">.</span><span class="pl-en">toHaveTitle</span><span class="pl-kos">(</span><span class="pl-pds"><span class="pl-c1">/</span>Cypress<span class="pl-c1">/</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-kos">;</span></pre></div>
<p dir="auto">Everything is as installed by Playwright itself, no changes to the configuration.</p>
<p dir="auto"><strong>Steps</strong></p>
<ul dir="auto">
<li>run <code class="notranslate">npx playwright test --ui</code></li>
<li>run the test</li>
</ul>
<p dir="auto"><strong>Expected</strong></p>
<p dir="auto">Even though the test fails, it should be marked as successful.</p>
<p dir="auto"><strong>Actual</strong></p>
<p dir="auto">It's marked as failed. All other forms of running Playwright tests consider this test successful:</p>
<ul dir="auto">
<li>clicking on the test using VS Code extension</li>
<li>running <code class="notranslate">npx playwright test</code></li>
<li>even using the debug mode</li>
</ul>
<p dir="auto">But UI doesn't seem to recognize the <code class="notranslate">test.fail()</code> in any way (might be the same with <code class="notranslate">test.skip()</code> and others, I didn't try).</p>
<p dir="auto">I'm aware that UI it's experimental, I just really like the <code class="notranslate">test.fail()</code> feature. <g-emoji class="g-emoji" alias="smiling_face_with_three_hearts" fallback-src="https://github.githubassets.com/images/icons/emoji/unicode/1f970.png">🥰</g-emoji></p>
<h3 dir="auto">System info</h3>
<ul dir="auto">
<li>Playwright Version: [v1.31.1]</li>
<li>Operating System: [macOS 13.2.1]</li>
<li>Other info: UI Mode</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>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('Should be marked as passed', async ({}) =&gt; {
  test.fail();
  expect(1).toEqual(2);
});"><pre class="notranslate"><span class="pl-en">test</span><span class="pl-kos">(</span><span class="pl-s">'Should be marked as passed'</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-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">fail</span><span class="pl-kos">(</span><span class="pl-kos">)</span><span class="pl-kos">;</span>
  <span class="pl-en">expect</span><span class="pl-kos">(</span><span class="pl-c1">1</span><span class="pl-kos">)</span><span class="pl-kos">.</span><span class="pl-en">toEqual</span><span class="pl-kos">(</span><span class="pl-c1">2</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 using UI Mode</li>
</ul>
<p dir="auto"><strong>Expected</strong></p>
<p dir="auto">Test should end with pass, because <code class="notranslate">test.fail()</code> was used.</p>
<p dir="auto"><strong>Actual</strong></p>
<p dir="auto">Test ends with fail. The same test executed using  VS Code extension ends with pass.<br>
<a target="_blank" rel="noopener noreferrer nofollow" href="https://user-images.githubusercontent.com/23238398/228843558-9854beea-5879-4954-af1a-282d6fcc31b0.jpg"><img src="https://user-images.githubusercontent.com/23238398/228843558-9854beea-5879-4954-af1a-282d6fcc31b0.jpg" alt="Image 30-03-2023 at 14 59" style="max-width: 100%;"></a></p>