<?xml version="1.0" encoding="UTF-8"?>
<rss version="2.0" xmlns:atom="http://www.w3.org/2005/Atom" xmlns:dc="http://purl.org/dc/elements/1.1/">
  <channel>
    <title>DEV Community: Anton Gulin</title>
    <description>The latest articles on DEV Community by Anton Gulin (@aiwithanton).</description>
    <link>https://dev.to/aiwithanton</link>
    <image>
      <url>https://media2.dev.to/dynamic/image/width=90,height=90,fit=cover,gravity=auto,format=auto/https:%2F%2Fdev-to-uploads.s3.us-east-2.amazonaws.com%2Fuploads%2Fuser%2Fprofile_image%2F3872452%2F17f47297-ddc6-457c-9920-47c0dd1acd1b.png</url>
      <title>DEV Community: Anton Gulin</title>
      <link>https://dev.to/aiwithanton</link>
    </image>
    <atom:link rel="self" type="application/rss+xml" href="https://dev.to/feed/aiwithanton"/>
    <language>en</language>
    <item>
      <title>Playwright test locks stop at the shard. Give each shard its own server.</title>
      <dc:creator>Anton Gulin</dc:creator>
      <pubDate>Sat, 28 Nov 2026 15:02:00 +0000</pubDate>
      <link>https://dev.to/aiwithanton/playwright-test-locks-stop-at-the-shard-give-each-shard-its-own-server-46g9</link>
      <guid>https://dev.to/aiwithanton/playwright-test-locks-stop-at-the-shard-give-each-shard-its-own-server-46g9</guid>
      <description>&lt;p&gt;&lt;em&gt;Originally published on &lt;a href="https://www.anton.qa/blog/posts/playwright-lock-across-shards" rel="noopener noreferrer"&gt;anton.qa&lt;/a&gt;.&lt;/em&gt;&lt;/p&gt;

&lt;p&gt;Two readers on DEV added a good point to the &lt;a href="https://www.anton.qa/blog/posts/playwright-exclusive-test-lock" rel="noopener noreferrer"&gt;&lt;code&gt;-exclusive-&lt;/code&gt; lock article&lt;/a&gt;. Playwright 1.63 added test locks. Version 1.65 added the built-in &lt;code&gt;-exclusive-&lt;/code&gt; lock. It makes one test run alone, such as a server restart. But a lock only sees its own Playwright run. What happens when a suite is split into shards?&lt;/p&gt;

&lt;p&gt;Their advice was to give each shard its own server and port. One reader also suggested keeping each shard's test data under its own name prefix.&lt;/p&gt;

&lt;p&gt;The results below come from real runs on Playwright 1.65.1. You'll see the failure, two fixes, and one small trap in the config.&lt;/p&gt;

&lt;h2&gt;
  
  
  Shards are separate runs
&lt;/h2&gt;

&lt;p&gt;Sharding splits one test suite into parts, called shards. You pick a part with a flag like &lt;code&gt;--shard=1/2&lt;/code&gt;. CI is the system that runs your tests on each push. There, each shard is usually its own job.&lt;/p&gt;

&lt;p&gt;The &lt;a href="https://playwright.dev/docs/test-parallel#test-locks" rel="noopener noreferrer"&gt;test-locks docs&lt;/a&gt; say locks work across files, worker processes and projects. Shards aren't on that list. Each shard is a separate run, and it only knows its own tests.&lt;/p&gt;

&lt;h2&gt;
  
  
  Two shards, one server: three tests fail
&lt;/h2&gt;

&lt;p&gt;The demo reuses the notes server from the last article. Its data lives in memory, so a restart wipes it. For 1.5 seconds after a restart, it answers 503. That status means "busy, try again later."&lt;/p&gt;

&lt;p&gt;One thing changed. The server now takes its port as an argument. A port is the number a server listens on.&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight javascript"&gt;&lt;code&gt;&lt;span class="c1"&gt;// A tiny notes server. Data lives in memory, so a restart wipes it.&lt;/span&gt;
&lt;span class="c1"&gt;// Usage: node server.mjs [port]&lt;/span&gt;
&lt;span class="k"&gt;import&lt;/span&gt; &lt;span class="n"&gt;http&lt;/span&gt; &lt;span class="k"&gt;from&lt;/span&gt; &lt;span class="s1"&gt;'node:http'&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;

&lt;span class="kd"&gt;const&lt;/span&gt; &lt;span class="n"&gt;port&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="nb"&gt;Number&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="nb"&gt;process&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="n"&gt;argv&lt;/span&gt;&lt;span class="p"&gt;[&lt;/span&gt;&lt;span class="mi"&gt;2&lt;/span&gt;&lt;span class="p"&gt;]&lt;/span&gt; &lt;span class="o"&gt;??&lt;/span&gt; &lt;span class="mi"&gt;3123&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;
&lt;span class="kd"&gt;let&lt;/span&gt; &lt;span class="n"&gt;notes&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="k"&gt;new&lt;/span&gt; &lt;span class="nb"&gt;Map&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;
&lt;span class="kd"&gt;let&lt;/span&gt; &lt;span class="n"&gt;restartingUntil&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="mi"&gt;0&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;

&lt;span class="n"&gt;http&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;createServer&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;req&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="n"&gt;res&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt; &lt;span class="o"&gt;=&amp;gt;&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt;
  &lt;span class="kd"&gt;const&lt;/span&gt; &lt;span class="n"&gt;url&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="k"&gt;new&lt;/span&gt; &lt;span class="no"&gt;URL&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;req&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="n"&gt;url&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="s1"&gt;'http://localhost'&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;
  &lt;span class="k"&gt;if&lt;/span&gt; &lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="nb"&gt;Date&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;now&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt; &lt;span class="o"&gt;&amp;lt;&lt;/span&gt; &lt;span class="n"&gt;restartingUntil&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt;
    &lt;span class="n"&gt;res&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;writeHead&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="mi"&gt;503&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;end&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="s1"&gt;'restarting'&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;
    &lt;span class="k"&gt;return&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;
  &lt;span class="p"&gt;}&lt;/span&gt;
  &lt;span class="k"&gt;if&lt;/span&gt; &lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;req&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="n"&gt;method&lt;/span&gt; &lt;span class="o"&gt;===&lt;/span&gt; &lt;span class="s1"&gt;'POST'&lt;/span&gt; &lt;span class="o"&gt;&amp;amp;&amp;amp;&lt;/span&gt; &lt;span class="n"&gt;url&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="n"&gt;pathname&lt;/span&gt; &lt;span class="o"&gt;===&lt;/span&gt; &lt;span class="s1"&gt;'/restart'&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt;
    &lt;span class="n"&gt;notes&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="k"&gt;new&lt;/span&gt; &lt;span class="nb"&gt;Map&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;
    &lt;span class="n"&gt;restartingUntil&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="nb"&gt;Date&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;now&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt; &lt;span class="o"&gt;+&lt;/span&gt; &lt;span class="mi"&gt;1500&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;
    &lt;span class="n"&gt;res&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;writeHead&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="mi"&gt;202&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;end&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="s1"&gt;'restarting'&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;
    &lt;span class="k"&gt;return&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;
  &lt;span class="p"&gt;}&lt;/span&gt;
  &lt;span class="kd"&gt;const&lt;/span&gt; &lt;span class="n"&gt;id&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="n"&gt;url&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="n"&gt;pathname&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;slice&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="s1"&gt;'/notes/'&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="n"&gt;length&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;
  &lt;span class="k"&gt;if&lt;/span&gt; &lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;req&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="n"&gt;method&lt;/span&gt; &lt;span class="o"&gt;===&lt;/span&gt; &lt;span class="s1"&gt;'PUT'&lt;/span&gt; &lt;span class="o"&gt;&amp;amp;&amp;amp;&lt;/span&gt; &lt;span class="n"&gt;url&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="n"&gt;pathname&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;startsWith&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="s1"&gt;'/notes/'&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt;
    &lt;span class="n"&gt;notes&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;set&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;id&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="s1"&gt;'saved'&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;
    &lt;span class="n"&gt;res&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;writeHead&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="mi"&gt;201&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;end&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="s1"&gt;'saved'&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;
    &lt;span class="k"&gt;return&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;
  &lt;span class="p"&gt;}&lt;/span&gt;
  &lt;span class="k"&gt;if&lt;/span&gt; &lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;req&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="n"&gt;method&lt;/span&gt; &lt;span class="o"&gt;===&lt;/span&gt; &lt;span class="s1"&gt;'GET'&lt;/span&gt; &lt;span class="o"&gt;&amp;amp;&amp;amp;&lt;/span&gt; &lt;span class="n"&gt;url&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="n"&gt;pathname&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;startsWith&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="s1"&gt;'/notes/'&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt;
    &lt;span class="n"&gt;res&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;writeHead&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;notes&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;has&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;id&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt; &lt;span class="o"&gt;?&lt;/span&gt; &lt;span class="mi"&gt;200&lt;/span&gt; &lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="mi"&gt;404&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;end&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;notes&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;get&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;id&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt; &lt;span class="o"&gt;??&lt;/span&gt; &lt;span class="s1"&gt;'missing'&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;
    &lt;span class="k"&gt;return&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;
  &lt;span class="p"&gt;}&lt;/span&gt;
  &lt;span class="n"&gt;res&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;writeHead&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;url&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="n"&gt;pathname&lt;/span&gt; &lt;span class="o"&gt;===&lt;/span&gt; &lt;span class="s1"&gt;'/health'&lt;/span&gt; &lt;span class="o"&gt;?&lt;/span&gt; &lt;span class="mi"&gt;200&lt;/span&gt; &lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="mi"&gt;404&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;end&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;
&lt;span class="p"&gt;}&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;listen&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;port&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Save it as &lt;code&gt;server.mjs&lt;/code&gt;. The tests are the same seven as last time. Six tests save a note, wait one second, then read it back. The seventh restarts the server and waits until it answers again.&lt;/p&gt;

&lt;p&gt;The restart test now has a tag, &lt;code&gt;@restart&lt;/code&gt;. A tag is a label you can filter on.&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight javascript"&gt;&lt;code&gt;&lt;span class="k"&gt;import&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt; &lt;span class="n"&gt;test&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="n"&gt;expect&lt;/span&gt; &lt;span class="p"&gt;}&lt;/span&gt; &lt;span class="k"&gt;from&lt;/span&gt; &lt;span class="s1"&gt;'@playwright/test'&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;

&lt;span class="kd"&gt;function&lt;/span&gt; &lt;span class="nf"&gt;noteTest&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;name&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt;
  &lt;span class="nf"&gt;test&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="sb"&gt;`save note ${name}`&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="k"&gt;async&lt;/span&gt; &lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="p"&gt;{&lt;/span&gt; &lt;span class="n"&gt;request&lt;/span&gt; &lt;span class="p"&gt;}&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt; &lt;span class="o"&gt;=&amp;gt;&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt;
    &lt;span class="nf"&gt;expect&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="k"&gt;await&lt;/span&gt; &lt;span class="n"&gt;request&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;put&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="sb"&gt;`/notes/${name}`&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;status&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;toBe&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="mi"&gt;201&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;
    &lt;span class="k"&gt;await&lt;/span&gt; &lt;span class="k"&gt;new&lt;/span&gt; &lt;span class="nb"&gt;Promise&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;resolve&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt; &lt;span class="o"&gt;=&amp;gt;&lt;/span&gt; &lt;span class="nb"&gt;setTimeout&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;resolve&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="mi"&gt;1000&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;
    &lt;span class="nf"&gt;expect&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="k"&gt;await&lt;/span&gt; &lt;span class="n"&gt;request&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;get&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="sb"&gt;`/notes/${name}`&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;status&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;toBe&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="mi"&gt;200&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;
  &lt;span class="p"&gt;}&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;
&lt;span class="p"&gt;}&lt;/span&gt;

&lt;span class="nf"&gt;test&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="s1"&gt;'restart the server'&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt; &lt;span class="n"&gt;tag&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="s1"&gt;'@restart'&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="n"&gt;lock&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="s1"&gt;'-exclusive-'&lt;/span&gt; &lt;span class="p"&gt;}&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="k"&gt;async&lt;/span&gt; &lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="p"&gt;{&lt;/span&gt; &lt;span class="n"&gt;request&lt;/span&gt; &lt;span class="p"&gt;}&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt; &lt;span class="o"&gt;=&amp;gt;&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt;
  &lt;span class="nf"&gt;expect&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="k"&gt;await&lt;/span&gt; &lt;span class="n"&gt;request&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;post&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="s1"&gt;'/restart'&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;status&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;toBe&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="mi"&gt;202&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;
  &lt;span class="k"&gt;await&lt;/span&gt; &lt;span class="n"&gt;expect&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;poll&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="k"&gt;async&lt;/span&gt; &lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt; &lt;span class="o"&gt;=&amp;gt;&lt;/span&gt; &lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="k"&gt;await&lt;/span&gt; &lt;span class="n"&gt;request&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;get&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="s1"&gt;'/health'&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;status&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt;
    &lt;span class="n"&gt;timeout&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="mi"&gt;5000&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;
  &lt;span class="p"&gt;}&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;toBe&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="mi"&gt;200&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;
&lt;span class="p"&gt;}&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;

&lt;span class="nf"&gt;noteTest&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="s1"&gt;'a'&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;
&lt;span class="nf"&gt;noteTest&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="s1"&gt;'b'&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;
&lt;span class="nf"&gt;noteTest&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="s1"&gt;'c'&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;
&lt;span class="nf"&gt;noteTest&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="s1"&gt;'d'&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;
&lt;span class="nf"&gt;noteTest&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="s1"&gt;'e'&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;
&lt;span class="nf"&gt;noteTest&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="s1"&gt;'f'&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Save it as &lt;code&gt;tests/notes.spec.mjs&lt;/code&gt;. This time the restart comes first in the file. That makes the overlap happen on every run, as you'll see below.&lt;/p&gt;

&lt;p&gt;The first config sends every shard to one server that is already running. Think of a shared test server in CI, often called staging.&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight javascript"&gt;&lt;code&gt;&lt;span class="k"&gt;import&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt; &lt;span class="n"&gt;defineConfig&lt;/span&gt; &lt;span class="p"&gt;}&lt;/span&gt; &lt;span class="k"&gt;from&lt;/span&gt; &lt;span class="s1"&gt;'@playwright/test'&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;

&lt;span class="c1"&gt;// All shards call one server that is already running.&lt;/span&gt;
&lt;span class="k"&gt;export&lt;/span&gt; &lt;span class="k"&gt;default&lt;/span&gt; &lt;span class="nf"&gt;defineConfig&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="p"&gt;{&lt;/span&gt;
  &lt;span class="n"&gt;testDir&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="s1"&gt;'./tests'&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;
  &lt;span class="n"&gt;fullyParallel&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="kc"&gt;true&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;
  &lt;span class="n"&gt;workers&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="mi"&gt;3&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;
  &lt;span class="n"&gt;retries&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="mi"&gt;0&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;
  &lt;span class="n"&gt;use&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt; &lt;span class="n"&gt;baseURL&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="nb"&gt;process&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="n"&gt;env&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="no"&gt;BASE_URL&lt;/span&gt; &lt;span class="o"&gt;??&lt;/span&gt; &lt;span class="s1"&gt;'http://localhost:3123'&lt;/span&gt; &lt;span class="p"&gt;}&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;
&lt;span class="p"&gt;}&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Save it as &lt;code&gt;playwright.shared.config.mjs&lt;/code&gt;. &lt;code&gt;fullyParallel: true&lt;/code&gt; lets Playwright split single tests between shards, not just whole files. Start the server in one terminal:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;node server.mjs
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Then run both shards at once from a second terminal:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;npx playwright &lt;span class="nb"&gt;test&lt;/span&gt; --config playwright.shared.config.mjs --shard=1/2 &lt;span class="o"&gt;&amp;amp;&lt;/span&gt;
npx playwright &lt;span class="nb"&gt;test&lt;/span&gt; --config playwright.shared.config.mjs --shard=2/2 &lt;span class="o"&gt;&amp;amp;&lt;/span&gt;
&lt;span class="nb"&gt;wait&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;The &lt;code&gt;&amp;amp;&lt;/code&gt; starts each command in the background, so both shards run together. These commands are for macOS and Linux.&lt;/p&gt;

&lt;p&gt;Three runs ended the same way. Shard 1 ran 4 tests, and all passed. Shard 2 ran notes d, e and f, and all 3 failed. Every failure received 503, sometimes on the save and sometimes on the read-back.&lt;/p&gt;

&lt;p&gt;Here is the first run. Times are seconds from the first test's start, across both shards.&lt;/p&gt;

&lt;div class="table-wrapper-paragraph"&gt;&lt;table&gt;
&lt;thead&gt;
&lt;tr&gt;
&lt;th&gt;Shard&lt;/th&gt;
&lt;th&gt;Test&lt;/th&gt;
&lt;th&gt;Start&lt;/th&gt;
&lt;th&gt;End&lt;/th&gt;
&lt;th&gt;Result&lt;/th&gt;
&lt;/tr&gt;
&lt;/thead&gt;
&lt;tbody&gt;
&lt;tr&gt;
&lt;td&gt;2&lt;/td&gt;
&lt;td&gt;save note f&lt;/td&gt;
&lt;td&gt;0.00&lt;/td&gt;
&lt;td&gt;1.05&lt;/td&gt;
&lt;td&gt;Failed&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;2&lt;/td&gt;
&lt;td&gt;save note d&lt;/td&gt;
&lt;td&gt;0.00&lt;/td&gt;
&lt;td&gt;1.06&lt;/td&gt;
&lt;td&gt;Failed&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;1&lt;/td&gt;
&lt;td&gt;restart the server&lt;/td&gt;
&lt;td&gt;0.01&lt;/td&gt;
&lt;td&gt;1.92&lt;/td&gt;
&lt;td&gt;Passed&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;2&lt;/td&gt;
&lt;td&gt;save note e&lt;/td&gt;
&lt;td&gt;0.01&lt;/td&gt;
&lt;td&gt;1.06&lt;/td&gt;
&lt;td&gt;Failed&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;1&lt;/td&gt;
&lt;td&gt;save note a&lt;/td&gt;
&lt;td&gt;1.94&lt;/td&gt;
&lt;td&gt;2.95&lt;/td&gt;
&lt;td&gt;Passed&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;1&lt;/td&gt;
&lt;td&gt;save note b&lt;/td&gt;
&lt;td&gt;2.18&lt;/td&gt;
&lt;td&gt;3.21&lt;/td&gt;
&lt;td&gt;Passed&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;1&lt;/td&gt;
&lt;td&gt;save note c&lt;/td&gt;
&lt;td&gt;2.18&lt;/td&gt;
&lt;td&gt;3.21&lt;/td&gt;
&lt;td&gt;Passed&lt;/td&gt;
&lt;/tr&gt;
&lt;/tbody&gt;
&lt;/table&gt;&lt;/div&gt;

&lt;p&gt;Inside shard 1, the lock worked. The restart ran alone, and notes a, b and c waited for it. Shard 2 never saw that lock. Its three tests ran during the restart and got 503.&lt;/p&gt;

&lt;h3&gt;
  
  
  A pass can be luck
&lt;/h3&gt;

&lt;p&gt;In another version of the test file, the restart came fourth instead of first. Shard 1 then ran notes a, b and c before the restart. Shard 2 passed in all three runs.&lt;/p&gt;

&lt;p&gt;But its last test ended only 0.03 to 0.07 seconds before the restart began. Nothing kept the two shards apart. Shard 2 just happened to finish first.&lt;/p&gt;

&lt;h2&gt;
  
  
  When do shards share a server?
&lt;/h2&gt;

&lt;p&gt;GitHub-hosted runners give every job a fresh, separate runner. GitHub's &lt;a href="https://docs.github.com/en/actions/reference/workflows-and-actions/workflow-syntax" rel="noopener noreferrer"&gt;workflow docs&lt;/a&gt; say "each job runs in a fresh instance of a runner image". Say your config starts the app with &lt;code&gt;webServer&lt;/code&gt;. That option starts a server before the tests run. Then each CI shard already gets its own copy.&lt;/p&gt;

&lt;p&gt;Shards share a server in two common cases:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;
&lt;strong&gt;The shards run on one machine.&lt;/strong&gt; Your laptop is one example. One big CI machine is another.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;The shards call a shared server or database.&lt;/strong&gt; One example is a staging server that every job uses.&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;The first case has a simple fix. The second needs a different plan.&lt;/p&gt;

&lt;h2&gt;
  
  
  Fix 1: each shard starts its own server
&lt;/h2&gt;

&lt;p&gt;Give each shard its own port, and let each shard start its own server. Read the shard number from one place. Here it comes from an environment variable, a named value set before a command. I called it &lt;code&gt;SHARD&lt;/code&gt;.&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight javascript"&gt;&lt;code&gt;&lt;span class="k"&gt;import&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt; &lt;span class="n"&gt;defineConfig&lt;/span&gt; &lt;span class="p"&gt;}&lt;/span&gt; &lt;span class="k"&gt;from&lt;/span&gt; &lt;span class="s1"&gt;'@playwright/test'&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;

&lt;span class="c1"&gt;// One source for the shard: SHARD=1/2, SHARD=2/2, or nothing.&lt;/span&gt;
&lt;span class="kd"&gt;const&lt;/span&gt; &lt;span class="p"&gt;[&lt;/span&gt;&lt;span class="n"&gt;current&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="n"&gt;total&lt;/span&gt;&lt;span class="p"&gt;]&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="nb"&gt;process&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="n"&gt;env&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="no"&gt;SHARD&lt;/span&gt; &lt;span class="o"&gt;??&lt;/span&gt; &lt;span class="s1"&gt;''&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;split&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="s1"&gt;'/'&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;map&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="nb"&gt;Number&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;
&lt;span class="kd"&gt;const&lt;/span&gt; &lt;span class="n"&gt;port&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="mi"&gt;3123&lt;/span&gt; &lt;span class="o"&gt;+&lt;/span&gt; &lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;current&lt;/span&gt; &lt;span class="o"&gt;||&lt;/span&gt; &lt;span class="mi"&gt;0&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;

&lt;span class="k"&gt;export&lt;/span&gt; &lt;span class="k"&gt;default&lt;/span&gt; &lt;span class="nf"&gt;defineConfig&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="p"&gt;{&lt;/span&gt;
  &lt;span class="n"&gt;testDir&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="s1"&gt;'./tests'&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;
  &lt;span class="n"&gt;fullyParallel&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="kc"&gt;true&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;
  &lt;span class="n"&gt;workers&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="mi"&gt;3&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;
  &lt;span class="n"&gt;retries&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="mi"&gt;0&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;
  &lt;span class="n"&gt;shard&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="n"&gt;current&lt;/span&gt; &lt;span class="o"&gt;?&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt; &lt;span class="n"&gt;current&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="n"&gt;total&lt;/span&gt; &lt;span class="p"&gt;}&lt;/span&gt; &lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="kc"&gt;null&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;
  &lt;span class="n"&gt;use&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt; &lt;span class="n"&gt;baseURL&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="sb"&gt;`http://localhost:${port}`&lt;/span&gt; &lt;span class="p"&gt;}&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;
  &lt;span class="n"&gt;webServer&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt;
    &lt;span class="n"&gt;command&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="sb"&gt;`node server.mjs ${port}`&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;
    &lt;span class="n"&gt;url&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="sb"&gt;`http://localhost:${port}/health`&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;
    &lt;span class="n"&gt;reuseExistingServer&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="kc"&gt;false&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;
  &lt;span class="p"&gt;}&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;
&lt;span class="p"&gt;}&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Save it as &lt;code&gt;playwright.config.mjs&lt;/code&gt;. &lt;code&gt;SHARD=1/2&lt;/code&gt; now sets two things. The config's &lt;a href="https://playwright.dev/docs/api/class-testconfig#test-config-shard" rel="noopener noreferrer"&gt;&lt;code&gt;shard&lt;/code&gt; option&lt;/a&gt; picks the tests. Port 3124 goes to the server and to &lt;code&gt;baseURL&lt;/code&gt;, the address the tests call. Without &lt;code&gt;SHARD&lt;/code&gt;, the whole suite runs on port 3123, so stop the first server before you try that.&lt;/p&gt;

&lt;p&gt;Run both shards at once:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;&lt;span class="nv"&gt;SHARD&lt;/span&gt;&lt;span class="o"&gt;=&lt;/span&gt;1/2 npx playwright &lt;span class="nb"&gt;test&lt;/span&gt; &lt;span class="o"&gt;&amp;amp;&lt;/span&gt;
&lt;span class="nv"&gt;SHARD&lt;/span&gt;&lt;span class="o"&gt;=&lt;/span&gt;2/2 npx playwright &lt;span class="nb"&gt;test&lt;/span&gt; &lt;span class="o"&gt;&amp;amp;&lt;/span&gt;
&lt;span class="nb"&gt;wait&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;All three runs passed: 4 tests in shard 1 and 3 in shard 2. In the demo's JSON reports, the two server commands were &lt;code&gt;node server.mjs 3124&lt;/code&gt; and &lt;code&gt;node server.mjs 3125&lt;/code&gt;.&lt;/p&gt;

&lt;p&gt;The restart still overlapped notes d, e and f in time. But it restarted a different server, so nothing failed.&lt;/p&gt;

&lt;h3&gt;
  
  
  Keep the shard number in one place
&lt;/h3&gt;

&lt;p&gt;Why not pass &lt;code&gt;--shard&lt;/code&gt; on the command line, like the sharding guide does? You can, but then the port won't follow it.&lt;/p&gt;

&lt;p&gt;One run set &lt;code&gt;SHARD=1/2&lt;/code&gt; and also passed &lt;code&gt;--shard=2/2&lt;/code&gt;. The command-line flag won, so Playwright ran shard 2's tests. The server still used port 3124, the port for shard 1. With one value in one place, the two can't disagree.&lt;/p&gt;

&lt;h3&gt;
  
  
  Two servers on one port
&lt;/h3&gt;

&lt;p&gt;On one machine, two servers need two ports. In one more test, both shards started a server on port 3123. In all three runs, one shard stopped before running any test:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;[WebServer] Error: listen EADDRINUSE: address already in use :::3123
Error: Process from config.webServer was not able to start. Exit code: 1
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;&lt;code&gt;EADDRINUSE&lt;/code&gt; means the port is already taken. The other shard passed. Which shard lost changed from run to run.&lt;/p&gt;

&lt;h3&gt;
  
  
  In GitHub Actions
&lt;/h3&gt;

&lt;p&gt;Here is how I'd pass &lt;code&gt;SHARD&lt;/code&gt; from a GitHub Actions matrix. A matrix runs one job per value, here one job per shard. The shape follows the &lt;a href="https://playwright.dev/docs/test-sharding#github-actions-example" rel="noopener noreferrer"&gt;Playwright sharding guide&lt;/a&gt;.&lt;/p&gt;

&lt;p&gt;This file passed actionlint, a checker for workflow files. It was not run in CI.&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight yaml"&gt;&lt;code&gt;&lt;span class="na"&gt;name&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="s"&gt;Playwright tests&lt;/span&gt;
&lt;span class="na"&gt;on&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="p"&gt;[&lt;/span&gt;&lt;span class="s"&gt;push&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="s"&gt;pull_request&lt;/span&gt;&lt;span class="p"&gt;]&lt;/span&gt;

&lt;span class="na"&gt;jobs&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt;
  &lt;span class="na"&gt;test&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt;
    &lt;span class="na"&gt;runs-on&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="s"&gt;ubuntu-latest&lt;/span&gt;
    &lt;span class="na"&gt;strategy&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt;
      &lt;span class="na"&gt;fail-fast&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="kc"&gt;false&lt;/span&gt;
      &lt;span class="na"&gt;matrix&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt;
        &lt;span class="na"&gt;shard&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="p"&gt;[&lt;/span&gt;&lt;span class="mi"&gt;1&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="mi"&gt;2&lt;/span&gt;&lt;span class="p"&gt;]&lt;/span&gt;
    &lt;span class="na"&gt;steps&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt;
      &lt;span class="p"&gt;-&lt;/span&gt; &lt;span class="na"&gt;uses&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="s"&gt;actions/checkout@v6&lt;/span&gt;
      &lt;span class="p"&gt;-&lt;/span&gt; &lt;span class="na"&gt;uses&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="s"&gt;actions/setup-node@v6&lt;/span&gt;
        &lt;span class="na"&gt;with&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt;
          &lt;span class="na"&gt;node-version&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="mi"&gt;24&lt;/span&gt;
      &lt;span class="p"&gt;-&lt;/span&gt; &lt;span class="na"&gt;run&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="s"&gt;npm ci&lt;/span&gt;
      &lt;span class="p"&gt;-&lt;/span&gt; &lt;span class="na"&gt;run&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="s"&gt;npx playwright test&lt;/span&gt;
        &lt;span class="na"&gt;env&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt;
          &lt;span class="na"&gt;SHARD&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="s"&gt;${{ matrix.shard }}/2&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;If your tests open a browser, add &lt;code&gt;npx playwright install --with-deps&lt;/code&gt; after &lt;code&gt;npm ci&lt;/code&gt;. The demo skips it, because it only uses the &lt;code&gt;request&lt;/code&gt; fixture, a built-in HTTP client.&lt;/p&gt;

&lt;h2&gt;
  
  
  Fix 2: when there is only one server
&lt;/h2&gt;

&lt;p&gt;Sometimes you can't copy the server. It might be a shared staging server, or a database every job uses.&lt;/p&gt;

&lt;p&gt;Then keep the restart out of the shards. Run it once, alone, after they finish. The &lt;code&gt;@restart&lt;/code&gt; tag makes that easy:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;npx playwright &lt;span class="nb"&gt;test&lt;/span&gt; --config playwright.shared.config.mjs --shard=1/2 --grep-invert @restart &lt;span class="o"&gt;&amp;amp;&lt;/span&gt;
npx playwright &lt;span class="nb"&gt;test&lt;/span&gt; --config playwright.shared.config.mjs --shard=2/2 --grep-invert @restart &lt;span class="o"&gt;&amp;amp;&lt;/span&gt;
&lt;span class="nb"&gt;wait&lt;/span&gt;
npx playwright &lt;span class="nb"&gt;test&lt;/span&gt; --config playwright.shared.config.mjs --grep @restart
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;&lt;code&gt;--grep-invert @restart&lt;/code&gt; skips the tagged test. &lt;code&gt;--grep @restart&lt;/code&gt; runs only that test. All three runs passed: 3 notes in each shard, then the restart alone. The restart never overlapped another test.&lt;/p&gt;

&lt;p&gt;In GitHub Actions, the restart becomes its own job. &lt;code&gt;needs: shards&lt;/code&gt; makes it wait for both shards. This file also passed actionlint and was not run in CI.&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight yaml"&gt;&lt;code&gt;&lt;span class="na"&gt;name&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="s"&gt;Playwright tests&lt;/span&gt;
&lt;span class="na"&gt;on&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="p"&gt;[&lt;/span&gt;&lt;span class="s"&gt;push&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="s"&gt;pull_request&lt;/span&gt;&lt;span class="p"&gt;]&lt;/span&gt;

&lt;span class="na"&gt;jobs&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt;
  &lt;span class="na"&gt;shards&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt;
    &lt;span class="na"&gt;runs-on&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="s"&gt;ubuntu-latest&lt;/span&gt;
    &lt;span class="na"&gt;strategy&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt;
      &lt;span class="na"&gt;fail-fast&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="kc"&gt;false&lt;/span&gt;
      &lt;span class="na"&gt;matrix&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt;
        &lt;span class="na"&gt;shard&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="p"&gt;[&lt;/span&gt;&lt;span class="mi"&gt;1&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="mi"&gt;2&lt;/span&gt;&lt;span class="p"&gt;]&lt;/span&gt;
    &lt;span class="na"&gt;steps&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt;
      &lt;span class="p"&gt;-&lt;/span&gt; &lt;span class="na"&gt;uses&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="s"&gt;actions/checkout@v6&lt;/span&gt;
      &lt;span class="p"&gt;-&lt;/span&gt; &lt;span class="na"&gt;uses&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="s"&gt;actions/setup-node@v6&lt;/span&gt;
        &lt;span class="na"&gt;with&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt;
          &lt;span class="na"&gt;node-version&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="mi"&gt;24&lt;/span&gt;
      &lt;span class="p"&gt;-&lt;/span&gt; &lt;span class="na"&gt;run&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="s"&gt;npm ci&lt;/span&gt;
      &lt;span class="p"&gt;-&lt;/span&gt; &lt;span class="na"&gt;run&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="p"&gt;&amp;gt;&lt;/span&gt;&lt;span class="s"&gt;-&lt;/span&gt;
          &lt;span class="s"&gt;npx playwright test --config playwright.shared.config.mjs&lt;/span&gt;
          &lt;span class="s"&gt;--shard=${{ matrix.shard }}/2 --grep-invert @restart&lt;/span&gt;
        &lt;span class="na"&gt;env&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt;
          &lt;span class="na"&gt;BASE_URL&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="s"&gt;https://staging.example.com&lt;/span&gt;

  &lt;span class="na"&gt;restart&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt;
    &lt;span class="na"&gt;needs&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="s"&gt;shards&lt;/span&gt;
    &lt;span class="na"&gt;runs-on&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="s"&gt;ubuntu-latest&lt;/span&gt;
    &lt;span class="na"&gt;steps&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt;
      &lt;span class="p"&gt;-&lt;/span&gt; &lt;span class="na"&gt;uses&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="s"&gt;actions/checkout@v6&lt;/span&gt;
      &lt;span class="p"&gt;-&lt;/span&gt; &lt;span class="na"&gt;uses&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="s"&gt;actions/setup-node@v6&lt;/span&gt;
        &lt;span class="na"&gt;with&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt;
          &lt;span class="na"&gt;node-version&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="mi"&gt;24&lt;/span&gt;
      &lt;span class="p"&gt;-&lt;/span&gt; &lt;span class="na"&gt;run&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="s"&gt;npm ci&lt;/span&gt;
      &lt;span class="p"&gt;-&lt;/span&gt; &lt;span class="na"&gt;run&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="s"&gt;npx playwright test --config playwright.shared.config.mjs --grep @restart&lt;/span&gt;
        &lt;span class="na"&gt;env&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt;
          &lt;span class="na"&gt;BASE_URL&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="s"&gt;https://staging.example.com&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Two limits apply. If a shard fails, GitHub skips the restart job by default. The &lt;a href="https://docs.github.com/en/actions/reference/workflows-and-actions/workflow-syntax#jobsjob_idneeds" rel="noopener noreferrer"&gt;&lt;code&gt;needs&lt;/code&gt; docs&lt;/a&gt; explain this. Also, this only orders jobs inside one workflow run. Another workflow or team can still call the same staging server.&lt;/p&gt;

&lt;h2&gt;
  
  
  Shared data: name it by shard, too
&lt;/h2&gt;

&lt;p&gt;The first reader also suggested a data namespace per shard. A namespace is a prefix that keeps one shard's data apart. That matters when shards share a database.&lt;/p&gt;

&lt;p&gt;Watch for one trap. Playwright runs tests in several workers at once. A worker is one test process. A common way to name test data uses its number, &lt;code&gt;parallelIndex&lt;/code&gt;. In the demo, both shards had workers 0, 1 and 2. So a name like &lt;code&gt;user-0&lt;/code&gt; would repeat in both shards.&lt;/p&gt;

&lt;p&gt;Add the shard number. Inside a test, &lt;code&gt;testInfo.config.shard&lt;/code&gt; holds it:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight javascript"&gt;&lt;code&gt;&lt;span class="kd"&gt;function&lt;/span&gt; &lt;span class="nf"&gt;dataName&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;testInfo&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt;
  &lt;span class="kd"&gt;const&lt;/span&gt; &lt;span class="n"&gt;shard&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="n"&gt;testInfo&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="n"&gt;config&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="n"&gt;shard&lt;/span&gt;&lt;span class="o"&gt;?&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="n"&gt;current&lt;/span&gt; &lt;span class="o"&gt;??&lt;/span&gt; &lt;span class="mi"&gt;0&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;
  &lt;span class="k"&gt;return&lt;/span&gt; &lt;span class="sb"&gt;`s${shard}-w${testInfo.parallelIndex}`&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;
&lt;span class="p"&gt;}&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;In a small test file, six tests printed this name in two shards. In three runs, the names went from &lt;code&gt;s1-w0&lt;/code&gt; to &lt;code&gt;s2-w2&lt;/code&gt;, with no repeats. That held with &lt;code&gt;--shard&lt;/code&gt; on the command line and with &lt;code&gt;SHARD&lt;/code&gt; in the config.&lt;/p&gt;

&lt;p&gt;The name belongs to a worker, not a test. Tests that run one after another in a worker share it. Two workers running at once get different names, even in different shards.&lt;/p&gt;

&lt;p&gt;Two workflows might use the same database at once. Then I'd add the CI run ID too. GitHub sets it as &lt;code&gt;GITHUB_RUN_ID&lt;/code&gt;. A re-run keeps that ID, so I'd add &lt;code&gt;GITHUB_RUN_ATTEMPT&lt;/code&gt; as well. The reader also suggested cleaning up only your own namespace at the end. Then a failed job can't delete another shard's data. I agree, but this demo has no database, so neither idea was run here.&lt;/p&gt;

&lt;p&gt;A namespace doesn't help with a restart, though. Notes d, e and f already had their own names. They still failed, because the restart took down the whole server.&lt;/p&gt;

&lt;h2&gt;
  
  
  Which one I'd pick
&lt;/h2&gt;

&lt;ul&gt;
&lt;li&gt;
&lt;strong&gt;You can start the app inside each shard:&lt;/strong&gt; I'd give each shard its own server and data, from one &lt;code&gt;SHARD&lt;/code&gt; value.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;There is one shared server:&lt;/strong&gt; I'd tag the tests that restart or reset it. Then I'd run them alone after the shards.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Inside each shard:&lt;/strong&gt; I'd keep the &lt;code&gt;-exclusive-&lt;/code&gt; lock. It still keeps the restart away from that shard's own tests.&lt;/li&gt;
&lt;/ul&gt;

&lt;h2&gt;
  
  
  Try it
&lt;/h2&gt;

&lt;p&gt;The demo ran on macOS with Node.js 24 and Playwright 1.65.1. Make a folder with the four files from this article:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;server.mjs
playwright.config.mjs
playwright.shared.config.mjs
tests/notes.spec.mjs
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Then install Playwright:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;npm init -y
npm install --save-exact @playwright/test@1.65.1
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Run the commands from each section. You should see these results:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;Two shards on one server: 4 passed in one shard, 3 failed in the other.&lt;/li&gt;
&lt;li&gt;Fix 1: 4 passed and 3 passed.&lt;/li&gt;
&lt;li&gt;Fix 2: 3 passed, 3 passed, then 1 passed.&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;Exact seconds will differ on your machine. The demo's waits are set by hand, so the overlap happens every time. It shows what a shared restart does to another shard. It doesn't measure how often that happens in a real suite.&lt;/p&gt;

&lt;p&gt;Thanks to the two readers on DEV who spotted this. Their per-shard server advice held up in every run here.&lt;/p&gt;

&lt;p&gt;&lt;em&gt;I'm Anton. I build AI tools and measure how fast they really run. Former Apple engineer. I make &lt;a href="https://ollamatps.com" rel="noopener noreferrer"&gt;ollamatps.com&lt;/a&gt; and write about building and measuring AI at &lt;a href="https://www.anton.qa" rel="noopener noreferrer"&gt;anton.qa&lt;/a&gt;.&lt;/em&gt;&lt;/p&gt;

</description>
      <category>playwright</category>
      <category>testing</category>
      <category>ci</category>
      <category>webdev</category>
    </item>
    <item>
      <title>What Is an AI QA Architect? Role, System, and Skills</title>
      <dc:creator>Anton Gulin</dc:creator>
      <pubDate>Sat, 21 Nov 2026 19:33:40 +0000</pubDate>
      <link>https://dev.to/aiwithanton/what-is-an-ai-qa-architect-role-system-and-skills-548h</link>
      <guid>https://dev.to/aiwithanton/what-is-an-ai-qa-architect-role-system-and-skills-548h</guid>
      <description>&lt;p&gt;&lt;em&gt;Originally published on &lt;a href="https://www.anton.qa/blog/posts/what-is-ai-qa-architect" rel="noopener noreferrer"&gt;anton.qa&lt;/a&gt;.&lt;/em&gt;&lt;/p&gt;

&lt;p&gt;Last updated: 2026-05-25&lt;/p&gt;

&lt;p&gt;An AI QA Architect designs the test system AI agents run on. They connect requirements, test generation, browser execution, evidence, and human review. The job keeps QA engineers in control. It gives agents a safe place to create, run, fix, and explain tests.&lt;/p&gt;

&lt;p&gt;QA means quality assurance.&lt;/p&gt;

&lt;p&gt;AI QA Architect is a system role.&lt;br&gt;
It is not a tool title.&lt;/p&gt;

&lt;p&gt;The person owns the way AI touches quality work.&lt;br&gt;
That includes the rules, the evidence, and the release gate.&lt;/p&gt;

&lt;h2&gt;
  
  
  The Simple Definition
&lt;/h2&gt;

&lt;p&gt;An AI QA Architect is responsible for the test architecture behind AI-assisted quality work.&lt;/p&gt;

&lt;p&gt;Architecture means the system design.&lt;br&gt;
It answers five questions:&lt;/p&gt;

&lt;ol&gt;
&lt;li&gt;What can the agent read?&lt;/li&gt;
&lt;li&gt;What can the agent change?&lt;/li&gt;
&lt;li&gt;What evidence must it produce?&lt;/li&gt;
&lt;li&gt;Who reviews the result?&lt;/li&gt;
&lt;li&gt;What blocks the release?&lt;/li&gt;
&lt;/ol&gt;

&lt;p&gt;The role matters because AI drafts tests fast.&lt;br&gt;
Fast tests are not enough.&lt;/p&gt;

&lt;p&gt;You need a system that catches weak tests before they land.&lt;br&gt;
You also need evidence humans can review.&lt;/p&gt;

&lt;h2&gt;
  
  
  Why The Role Exists Now
&lt;/h2&gt;

&lt;p&gt;Most QA systems were built for humans first.&lt;/p&gt;

&lt;p&gt;A person read the ticket.&lt;br&gt;
A person chose the test.&lt;br&gt;
A person checked the failure.&lt;br&gt;
A person decided if the release was safe.&lt;/p&gt;

&lt;p&gt;AI changes the speed of that loop.&lt;/p&gt;

&lt;p&gt;An agent can draft a test from a ticket.&lt;br&gt;
It can inspect a failing trace.&lt;br&gt;
It can suggest a fix.&lt;br&gt;
It can explain a failure.&lt;/p&gt;

&lt;p&gt;That power creates a new risk.&lt;/p&gt;

&lt;p&gt;If the system has weak gates, AI makes weak work faster.&lt;br&gt;
If the system has strong gates, AI can help the team move safely.&lt;/p&gt;

&lt;p&gt;That is the AI QA Architect's job.&lt;/p&gt;

&lt;h2&gt;
  
  
  The Five Parts Of The System
&lt;/h2&gt;

&lt;h3&gt;
  
  
  1. Requirement Intake
&lt;/h3&gt;

&lt;p&gt;The agent needs clean input.&lt;/p&gt;

&lt;p&gt;Input can be a user story, bug report, ticket, or spec.&lt;br&gt;
The architect defines what good input means.&lt;/p&gt;

&lt;p&gt;A good input names:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;user goal&lt;/li&gt;
&lt;li&gt;expected result&lt;/li&gt;
&lt;li&gt;risky path&lt;/li&gt;
&lt;li&gt;test data&lt;/li&gt;
&lt;li&gt;release impact&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;Without this, the agent guesses.&lt;br&gt;
Guessing creates noisy tests.&lt;/p&gt;

&lt;h3&gt;
  
  
  2. Test Generation
&lt;/h3&gt;

&lt;p&gt;AI can draft tests.&lt;br&gt;
Humans still review them.&lt;/p&gt;

&lt;p&gt;A good generation flow has rules.&lt;/p&gt;

&lt;p&gt;It tells the agent:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;which tool to use&lt;/li&gt;
&lt;li&gt;which patterns to follow&lt;/li&gt;
&lt;li&gt;what code style to match&lt;/li&gt;
&lt;li&gt;what not to test&lt;/li&gt;
&lt;li&gt;when to stop&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;This keeps generated tests inside the team's standards.&lt;/p&gt;

&lt;h3&gt;
  
  
  3. Execution
&lt;/h3&gt;

&lt;p&gt;Execution means running the test.&lt;/p&gt;

&lt;p&gt;For browser checks, tools like Playwright matter.&lt;br&gt;
They produce traces, screenshots, reports, and browser state.&lt;/p&gt;

&lt;p&gt;Those artifacts become receipts.&lt;br&gt;
Receipts are proof a human can review.&lt;/p&gt;

&lt;p&gt;AI agents need receipts too.&lt;br&gt;
Without receipts, the agent only has text.&lt;/p&gt;

&lt;h3&gt;
  
  
  4. Failure Analysis
&lt;/h3&gt;

&lt;p&gt;A failed test is not enough.&lt;/p&gt;

&lt;p&gt;The system must answer:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;Did the app break?&lt;/li&gt;
&lt;li&gt;Did the test break?&lt;/li&gt;
&lt;li&gt;Did the data change?&lt;/li&gt;
&lt;li&gt;Did the environment fail?&lt;/li&gt;
&lt;li&gt;Should the release stop?&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;AI can help sort the evidence.&lt;br&gt;
The human still owns the decision.&lt;/p&gt;

&lt;h3&gt;
  
  
  5. Release Gate
&lt;/h3&gt;

&lt;p&gt;A release gate decides what ships.&lt;/p&gt;

&lt;p&gt;CI means server test runs.&lt;br&gt;
The gate uses CI results, test reports, and risk rules.&lt;/p&gt;

&lt;p&gt;An AI QA Architect defines the gate.&lt;br&gt;
They decide which failures block release.&lt;br&gt;
They decide which failures need review.&lt;br&gt;
They decide what evidence is required.&lt;/p&gt;

&lt;h2&gt;
  
  
  How This Differs From QA Automation
&lt;/h2&gt;

&lt;p&gt;QA automation asks, "Can we run the test?"&lt;/p&gt;

&lt;p&gt;AI QA architecture asks, "Can we trust the system around the test?"&lt;/p&gt;

&lt;p&gt;That includes automation.&lt;br&gt;
It also includes agents, prompts, data, evidence, review, and release rules.&lt;/p&gt;

&lt;p&gt;A QA automation engineer may build the runner.&lt;br&gt;
An AI QA Architect owns the full loop.&lt;/p&gt;

&lt;h2&gt;
  
  
  How MCP Fits
&lt;/h2&gt;

&lt;p&gt;MCP means Model Context Protocol.&lt;br&gt;
It is a standard way for AI tools to connect with external tools.&lt;/p&gt;

&lt;p&gt;MCP testing has two jobs.&lt;/p&gt;

&lt;p&gt;First, test the MCP server you build.&lt;br&gt;
That means tools, resources, prompts, and errors.&lt;/p&gt;

&lt;p&gt;Second, test software through MCP-enabled tools.&lt;br&gt;
That means the agent can call a browser, database, or API tool.&lt;/p&gt;

&lt;p&gt;Both jobs need a test system.&lt;/p&gt;

&lt;p&gt;The official MCP Inspector helps developers test MCP servers.&lt;br&gt;
It gives a visual way to inspect capabilities and debug requests.&lt;/p&gt;

&lt;p&gt;That is useful.&lt;br&gt;
It is not the full QA system.&lt;/p&gt;

&lt;p&gt;The architect still defines the rules around safe use.&lt;/p&gt;

&lt;h2&gt;
  
  
  Skills An AI QA Architect Needs
&lt;/h2&gt;

&lt;p&gt;You need test automation depth.&lt;br&gt;
You need enough AI knowledge to set safe boundaries.&lt;br&gt;
You need architecture judgment.&lt;/p&gt;

&lt;p&gt;Core skills:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;Playwright or another browser test tool&lt;/li&gt;
&lt;li&gt;CI pipeline design&lt;/li&gt;
&lt;li&gt;test data strategy&lt;/li&gt;
&lt;li&gt;trace and report review&lt;/li&gt;
&lt;li&gt;prompt rules for agents&lt;/li&gt;
&lt;li&gt;MCP server testing&lt;/li&gt;
&lt;li&gt;release gate design&lt;/li&gt;
&lt;li&gt;risk-based testing&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;LLM means language model.&lt;br&gt;
You do not need to train one.&lt;/p&gt;

&lt;p&gt;You do need to know how it fails.&lt;br&gt;
It can hallucinate.&lt;br&gt;
It can skip edge cases.&lt;br&gt;
It can accept weak evidence.&lt;/p&gt;

&lt;p&gt;Your system must catch those failures.&lt;/p&gt;

&lt;h2&gt;
  
  
  What The Role Is Not
&lt;/h2&gt;

&lt;p&gt;An AI QA Architect is not a person who buys AI tools.&lt;/p&gt;

&lt;p&gt;It is not a person who tells testers to stop writing tests.&lt;/p&gt;

&lt;p&gt;It is not a person who trusts every generated test.&lt;/p&gt;

&lt;p&gt;The role is more practical.&lt;/p&gt;

&lt;p&gt;You design the system so agents can help safely.&lt;br&gt;
You protect the human decision.&lt;br&gt;
You make quality visible before release.&lt;/p&gt;

&lt;h2&gt;
  
  
  A Practical Checklist
&lt;/h2&gt;

&lt;p&gt;Use this before adding AI to a test suite.&lt;/p&gt;

&lt;ol&gt;
&lt;li&gt;Can the agent read the requirement clearly?&lt;/li&gt;
&lt;li&gt;Can it follow your test patterns?&lt;/li&gt;
&lt;li&gt;Can it run the right tool?&lt;/li&gt;
&lt;li&gt;Can it produce reviewable evidence?&lt;/li&gt;
&lt;li&gt;Can a human approve or reject the result?&lt;/li&gt;
&lt;li&gt;Can CI block unsafe releases?&lt;/li&gt;
&lt;li&gt;Can the team trace why a test changed?&lt;/li&gt;
&lt;/ol&gt;

&lt;p&gt;If the answer is no, fix the system first.&lt;/p&gt;

&lt;h2&gt;
  
  
  FAQ
&lt;/h2&gt;

&lt;h3&gt;
  
  
  What does an AI QA Architect do?
&lt;/h3&gt;

&lt;p&gt;An AI QA Architect designs the test system AI agents use. They define how agents read requirements, generate tests, run checks, and produce evidence. The goal is safer test automation with human review.&lt;/p&gt;

&lt;h3&gt;
  
  
  Is an AI QA Architect replacing QA engineers?
&lt;/h3&gt;

&lt;p&gt;No. The role protects human review. AI agents can draft tests and inspect failures. Humans still own the quality decision. The architect designs the rules around that work.&lt;/p&gt;

&lt;h3&gt;
  
  
  What is AI test automation architecture?
&lt;/h3&gt;

&lt;p&gt;AI test automation architecture connects human intent, AI assistance, test execution, evidence, and release gates. It includes prompts, tools, CI, reports, data, and review rules.&lt;/p&gt;

&lt;h3&gt;
  
  
  How does MCP testing relate to QA?
&lt;/h3&gt;

&lt;p&gt;MCP testing covers two jobs. You test MCP servers you build, and you test software through MCP-enabled tools. Both need clear inputs, safe tool access, and evidence a human can review.&lt;/p&gt;

&lt;h3&gt;
  
  
  What should a team build first?
&lt;/h3&gt;

&lt;p&gt;Build the evidence loop first. Every test failure should show action, page state, assertion, logs, and release impact. Then add AI help inside that loop.&lt;/p&gt;

&lt;h2&gt;
  
  
  Start With Evidence
&lt;/h2&gt;

&lt;p&gt;AI QA Architect is a system owner.&lt;/p&gt;

&lt;p&gt;The job is not to make AI look smart.&lt;br&gt;
The job is to make quality safer when AI joins the loop.&lt;/p&gt;

&lt;p&gt;Start with evidence.&lt;br&gt;
Add agents after that.&lt;/p&gt;

&lt;p&gt;&lt;em&gt;I'm Anton. I build AI tools and measure how fast they really run. Former Apple engineer. I make &lt;a href="https://ollamatps.com" rel="noopener noreferrer"&gt;ollamatps.com&lt;/a&gt; and write about building and measuring AI at &lt;a href="https://www.anton.qa" rel="noopener noreferrer"&gt;anton.qa&lt;/a&gt;.&lt;/em&gt;&lt;/p&gt;

</description>
      <category>ai</category>
      <category>qa</category>
      <category>testing</category>
      <category>automation</category>
    </item>
    <item>
      <title>Drag-and-Drop Automation is Finally Native in Playwright MCP</title>
      <dc:creator>Anton Gulin</dc:creator>
      <pubDate>Sat, 21 Nov 2026 19:32:24 +0000</pubDate>
      <link>https://dev.to/aiwithanton/drag-and-drop-automation-is-finally-native-in-playwright-mcp-4o5g</link>
      <guid>https://dev.to/aiwithanton/drag-and-drop-automation-is-finally-native-in-playwright-mcp-4o5g</guid>
      <description>&lt;p&gt;&lt;em&gt;Originally published on &lt;a href="https://www.anton.qa/blog/posts/drag-and-drop-automation" rel="noopener noreferrer"&gt;anton.qa&lt;/a&gt;.&lt;/em&gt;&lt;/p&gt;

&lt;h2&gt;
  
  
  I hate testing drag-and-drop.
&lt;/h2&gt;

&lt;p&gt;Most QA teams do. We either skip it or we write hacks.&lt;/p&gt;

&lt;p&gt;I have seen it all. Scripts that try to "flick" the mouse. Scripts that inject JavaScript.&lt;/p&gt;

&lt;p&gt;They all break. They are hard to maintain.&lt;/p&gt;

&lt;p&gt;This month, Playwright MCP v0.0.71 shipped a fix.&lt;/p&gt;

&lt;p&gt;It adds a tool called &lt;code&gt;browser_drop&lt;/code&gt;.&lt;/p&gt;

&lt;h2&gt;
  
  
  Why This Changes Things
&lt;/h2&gt;

&lt;p&gt;Before, your AI agent had to guess how to move an item.&lt;/p&gt;

&lt;p&gt;Now, it uses the native Playwright API: &lt;code&gt;Locator.drop&lt;/code&gt;.&lt;/p&gt;

&lt;p&gt;It works for:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;Moving cards in a grid.&lt;/li&gt;
&lt;li&gt;Dropping files into an upload zone.&lt;/li&gt;
&lt;li&gt;Reordering lists.
It works because it handles the mouse events for you.&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;No more "faking" the move.&lt;/p&gt;

&lt;h2&gt;
  
  
  How to Use It
&lt;/h2&gt;

&lt;p&gt;Here is one line of code to use in your MCP tool:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight typescript"&gt;&lt;code&gt;&lt;span class="kd"&gt;const&lt;/span&gt; &lt;span class="n"&gt;result&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="k"&gt;await&lt;/span&gt; &lt;span class="n"&gt;server&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="n"&gt;tools&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;call&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="s2"&gt;"browser_drop"&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt;
  &lt;span class="n"&gt;source&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="s2"&gt;"text=MyFile.pdf"&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;
  &lt;span class="n"&gt;target&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="s2"&gt;"#drop-zone"&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;
&lt;span class="p"&gt;}&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;That is it. One command.&lt;/p&gt;

&lt;p&gt;The AI agent finds the file. It moves it to the zone. It drops it.&lt;/p&gt;

&lt;h2&gt;
  
  
  The "Below the Fold" Gotcha
&lt;/h2&gt;

&lt;p&gt;There is one small catch.&lt;/p&gt;

&lt;p&gt;Playwright needs the items to be on your screen to drop them.&lt;/p&gt;

&lt;p&gt;If your list is long and the target is at the bottom, the drop will fail.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;The Fix:&lt;/strong&gt; Scroll the target into view first.&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight typescript"&gt;&lt;code&gt;&lt;span class="c1"&gt;// Scroll first, then drop&lt;/span&gt;
&lt;span class="k"&gt;await&lt;/span&gt; &lt;span class="n"&gt;server&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="n"&gt;tools&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;call&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="s2"&gt;"browser_evaluate"&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt;
  &lt;span class="n"&gt;expression&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="sb"&gt;`document.querySelector("#drop-zone").scrollIntoView()`&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;
&lt;span class="p"&gt;}&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;This simple step stops your tests from failing in CI (where screens are smaller).&lt;/p&gt;

&lt;h2&gt;
  
  
  What Else Is New?
&lt;/h2&gt;

&lt;p&gt;The v0.0.71 release added two more features:&lt;/p&gt;

&lt;ol&gt;
&lt;li&gt;
&lt;strong&gt;Network Bodies&lt;/strong&gt;: &lt;code&gt;browser_network_requests&lt;/code&gt; now captures the full response from your server. You can check what the API said, not just the status code.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Plain Code&lt;/strong&gt;: &lt;code&gt;browser_evaluate&lt;/code&gt; now takes plain JavaScript. You do not need a function wrapper anymore.&lt;/li&gt;
&lt;/ol&gt;

&lt;h2&gt;
  
  
  Verdict
&lt;/h2&gt;

&lt;p&gt;If you use AI agents for testing, upgrade today.&lt;/p&gt;

&lt;p&gt;&lt;code&gt;browser_drop&lt;/code&gt; removes the last big "hack" in our pipeline.&lt;/p&gt;

&lt;p&gt;I architect the systems AI agents run on. Native tools like this make those systems stable.&lt;/p&gt;

&lt;p&gt;&lt;em&gt;I'm Anton. I build AI tools and measure how fast they really run. Former Apple engineer. I make &lt;a href="https://ollamatps.com" rel="noopener noreferrer"&gt;ollamatps.com&lt;/a&gt; and write about building and measuring AI at &lt;a href="https://www.anton.qa" rel="noopener noreferrer"&gt;anton.qa&lt;/a&gt;.&lt;/em&gt;&lt;/p&gt;

</description>
      <category>playwright</category>
      <category>mcp</category>
      <category>automation</category>
      <category>testing</category>
    </item>
    <item>
      <title>browser_run_code_unsafe: Honest Architecture</title>
      <dc:creator>Anton Gulin</dc:creator>
      <pubDate>Sat, 21 Nov 2026 19:31:08 +0000</pubDate>
      <link>https://dev.to/aiwithanton/browserruncodeunsafe-honest-architecture-26ch</link>
      <guid>https://dev.to/aiwithanton/browserruncodeunsafe-honest-architecture-26ch</guid>
      <description>&lt;p&gt;&lt;em&gt;Originally published on &lt;a href="https://www.anton.qa/blog/posts/browser_run_code_unsafe" rel="noopener noreferrer"&gt;anton.qa&lt;/a&gt;.&lt;/em&gt;&lt;/p&gt;

&lt;h2&gt;
  
  
  TL;DR
&lt;/h2&gt;

&lt;p&gt;Playwright MCP v0.0.72 renamed browser_run_code to browser_run_code_unsafe, making sandbox escape risk explicit. The new browser_network_request tool adds indexed request inspection. Teams using this MCP server in CI pipelines need to update tool references and security documentation now.&lt;/p&gt;

&lt;h2&gt;
  
  
  The Release
&lt;/h2&gt;

&lt;p&gt;Microsoft shipped playwright-mcp v0.0.72 on April 30, 2026 with two headline changes: a renamed tool that forces explicit acknowledgment of security boundaries, and a new indexed network request API.&lt;/p&gt;

&lt;p&gt;The tool formerly known as &lt;code&gt;browser_run_code&lt;/code&gt; is now &lt;code&gt;browser_run_code_unsafe&lt;/code&gt;. The rename surfaces a capability that was always there, arbitrary code execution within the Playwright browser context, and makes the sandbox implications impossible to miss in code reviews, CI configs, and architecture docs.&lt;/p&gt;

&lt;p&gt;Also new: &lt;code&gt;browser_network_requests&lt;/code&gt; now returns a numbered list, and &lt;code&gt;browser_network_request&lt;/code&gt; lets you fetch any single request by index, including headers and body. Both tools accept a &lt;code&gt;filename&lt;/code&gt; option for direct file output.&lt;/p&gt;

&lt;h2&gt;
  
  
  Why This Matters for Engineers, QA, and CI
&lt;/h2&gt;

&lt;p&gt;I've seen what happens when security assumptions live in the gap between "works in dev" and "approved for prod." On one project, where I led test infrastructure through a 40% faster test execution migration from Selenium to Playwright, the gap between a tool's name and its actual risk profile costs real time.&lt;/p&gt;

&lt;p&gt;When a tool is named &lt;code&gt;browser_run_code&lt;/code&gt;, it's easy to approve it in a security review without asking what code actually runs. When it's named &lt;code&gt;browser_run_code_unsafe&lt;/code&gt;, you can't pretend the sandbox boundary is theoretical. This rename is documentation embedded in the API contract.&lt;/p&gt;

&lt;p&gt;For QA architects integrating MCP servers into CI pipelines, this matters in three places: security review templates, tool permission configs in your MCP client, and any internal docs that reference the old name.&lt;/p&gt;

&lt;h2&gt;
  
  
  How to Use It
&lt;/h2&gt;

&lt;p&gt;The new indexed request API is straightforward. Here's a TypeScript example using the new &lt;code&gt;browser_network_request&lt;/code&gt; with an index:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight typescript"&gt;&lt;code&gt;&lt;span class="c1"&gt;// Fetch the numbered list from browser_network_requests&lt;/span&gt;
&lt;span class="kd"&gt;const&lt;/span&gt; &lt;span class="n"&gt;requestList&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="k"&gt;await&lt;/span&gt; &lt;span class="n"&gt;client&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;callTool&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="s1"&gt;'browser_network_requests'&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt;
  &lt;span class="n"&gt;url&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="s1"&gt;'https://api.example.com/orders'&lt;/span&gt;
&lt;span class="p"&gt;}&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;
&lt;span class="c1"&gt;// Returns: [{index: 0, method: 'GET', url: '...'}, {index: 1, ...}]&lt;/span&gt;

&lt;span class="c1"&gt;// Fetch full details for a specific request&lt;/span&gt;
&lt;span class="kd"&gt;const&lt;/span&gt; &lt;span class="n"&gt;fullRequest&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="k"&gt;await&lt;/span&gt; &lt;span class="n"&gt;client&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;callTool&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="s1"&gt;'browser_network_request'&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt;
  &lt;span class="n"&gt;index&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="mi"&gt;0&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;
  &lt;span class="n"&gt;filename&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="s1"&gt;'request_0.json'&lt;/span&gt;  &lt;span class="c1"&gt;// Optional: write directly to file&lt;/span&gt;
&lt;span class="p"&gt;}&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;

&lt;span class="c1"&gt;// Or fetch just headers for inspection&lt;/span&gt;
&lt;span class="kd"&gt;const&lt;/span&gt; &lt;span class="n"&gt;headers&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="k"&gt;await&lt;/span&gt; &lt;span class="n"&gt;client&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;callTool&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="s1"&gt;'browser_network_request'&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt;
  &lt;span class="n"&gt;index&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="mi"&gt;0&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;
  &lt;span class="n"&gt;part&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="s1"&gt;'headers'&lt;/span&gt;
&lt;span class="p"&gt;}&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;For the renamed tool, update your tool references:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight typescript"&gt;&lt;code&gt;&lt;span class="c1"&gt;// Before (v0.0.71)&lt;/span&gt;
&lt;span class="k"&gt;await&lt;/span&gt; &lt;span class="n"&gt;client&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;callTool&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="s1"&gt;'browser_run_code'&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt;
  &lt;span class="n"&gt;code&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="sb"&gt;`await page.click('#submit')`&lt;/span&gt;
&lt;span class="p"&gt;}&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;

&lt;span class="c1"&gt;// After (v0.0.72)&lt;/span&gt;
&lt;span class="k"&gt;await&lt;/span&gt; &lt;span class="n"&gt;client&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;callTool&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="s1"&gt;'browser_run_code_unsafe'&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt;
  &lt;span class="n"&gt;code&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="sb"&gt;`await page.click('#submit')`&lt;/span&gt;
&lt;span class="p"&gt;}&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;The functionality is identical. The name changed.&lt;/p&gt;

&lt;h2&gt;
  
  
  The Gotcha Nobody Is Talking About
&lt;/h2&gt;

&lt;p&gt;The rename doesn't change behavior, but it will break your existing integrations silently if you're using tool name matching in your MCP client config. If you hardcoded &lt;code&gt;browser_run_code&lt;/code&gt; in a tool registry or a Claude Desktop config file, you'll get a "tool not found" error with no explanation that a rename is the cause.&lt;/p&gt;

&lt;p&gt;The unhandled rejection fix (previously crashing the server on unhandled errors in &lt;code&gt;browser_run_code_unsafe&lt;/code&gt;) means old error patterns in your logs may disappear. That's good, but if you had monitoring that expected crashes on certain error types, you'll need to update alert thresholds.&lt;/p&gt;

&lt;h2&gt;
  
  
  What This Changes in Your CI Pipeline
&lt;/h2&gt;

&lt;p&gt;If you're running Playwright MCP in CI, using it to drive browser automation for end-to-end tests or visual regression checks, the rename forces a config audit. In practice, this is a one-line change in your tool mapping, but it should trigger a broader review of what other tools you're calling and whether their names still match upstream.&lt;/p&gt;

&lt;p&gt;The new &lt;code&gt;filename&lt;/code&gt; option for network tools solves a real CI artifact problem: network logs that used to need in-memory buffering and post-processing can now write directly to the filesystem, making them available for artifact upload without extra code.&lt;/p&gt;

&lt;p&gt;On one project, I shipped changes that cut deployment times in half partly because artifact handling got smarter. Direct file output from MCP tools is that kind of small win that compounds across hundreds of test runs.&lt;/p&gt;

&lt;h2&gt;
  
  
  Migration Notes
&lt;/h2&gt;

&lt;ul&gt;
&lt;li&gt;Update all tool name references from &lt;code&gt;browser_run_code&lt;/code&gt; to &lt;code&gt;browser_run_code_unsafe&lt;/code&gt;
&lt;/li&gt;
&lt;li&gt;Review security documentation to reflect the explicit "unsafe" designation&lt;/li&gt;
&lt;li&gt;Check MCP client configs for hardcoded tool names&lt;/li&gt;
&lt;li&gt;The &lt;code&gt;filename&lt;/code&gt; parameter is backward-compatible (optional, existing behavior unchanged)&lt;/li&gt;
&lt;li&gt;The indexed request API is additive. Existing &lt;code&gt;browser_network_requests&lt;/code&gt; behavior works as before&lt;/li&gt;
&lt;/ul&gt;

&lt;h2&gt;
  
  
  Verdict
&lt;/h2&gt;

&lt;p&gt;The &lt;code&gt;browser_run_code_unsafe&lt;/code&gt; rename is the right call. It's an API contract change that forces honest conversations about what your automation tools can actually do. In enterprise environments where QA architects own security review sign-off, explicit naming prevents the kind of assumption drift that creates vulnerabilities.&lt;/p&gt;

&lt;p&gt;The new indexed network request API is a solid ergonomic improvement, pinpoint access to individual requests without parsing full lists. Combined with the &lt;code&gt;filename&lt;/code&gt; output option, it makes Playwright MCP a more capable tool for CI pipelines that need artifact generation.&lt;/p&gt;

&lt;p&gt;This is a non-breaking change for functionality, but a breaking change for tool name references. Audit your configs, update your docs, and move on. The 40% faster test execution gains from the Selenium→Playwright migration taught me that staying current on toolchain changes pays off, it's rarely as painful as it feels in the moment.&lt;/p&gt;

&lt;p&gt;Upgrade and update your tool names. Then look at what you can do with indexed request inspection that you couldn't before.&lt;/p&gt;

&lt;p&gt;&lt;em&gt;I'm Anton. I build AI tools and measure how fast they really run. Former Apple engineer. I make &lt;a href="https://ollamatps.com" rel="noopener noreferrer"&gt;ollamatps.com&lt;/a&gt; and write about building and measuring AI at &lt;a href="https://www.anton.qa" rel="noopener noreferrer"&gt;anton.qa&lt;/a&gt;.&lt;/em&gt;&lt;/p&gt;

</description>
      <category>playwright</category>
      <category>mcp</category>
      <category>security</category>
      <category>testing</category>
    </item>
    <item>
      <title>Playwright CLI v0.1.10 Brings Spec-Driven Testing Skills for AI Agents</title>
      <dc:creator>Anton Gulin</dc:creator>
      <pubDate>Sat, 21 Nov 2026 19:29:52 +0000</pubDate>
      <link>https://dev.to/aiwithanton/playwright-cli-v0110-brings-spec-driven-testing-skills-for-ai-agents-2cf0</link>
      <guid>https://dev.to/aiwithanton/playwright-cli-v0110-brings-spec-driven-testing-skills-for-ai-agents-2cf0</guid>
      <description>&lt;p&gt;&lt;em&gt;Originally published on &lt;a href="https://www.anton.qa/blog/posts/playwright-cli-v0-1-10-brings" rel="noopener noreferrer"&gt;anton.qa&lt;/a&gt;.&lt;/em&gt;&lt;/p&gt;

&lt;h2&gt;
  
  
  TL;DR
&lt;/h2&gt;

&lt;p&gt;Playwright CLI v0.1.10 introduces a spec-driven testing skill that guides AI agents through plan/generate/heal workflows for maintaining test suites from written specifications. Network inspection now uses stable request indexing, and raw output is default for all data-fetching commands, eliminating preprocessing steps in CI pipelines.&lt;/p&gt;

&lt;h2&gt;
  
  
  The release
&lt;/h2&gt;

&lt;p&gt;Playwright CLI v0.1.10 shipped on April 30th with two headline features that reshape how AI agents interact with browser automation. The network inspection subsystem got a complete overhaul, &lt;code&gt;network&lt;/code&gt; is gone, replaced by &lt;code&gt;requests&lt;/code&gt; plus granular subcommands that output indexed, pipe-friendly data. But the feature I'm actually excited about is the spec-driven testing skill: a &lt;code&gt;references/spec-driven-testing.md&lt;/code&gt; reference that teaches AI agents to drive Playwright tests from written specifications.&lt;/p&gt;

&lt;p&gt;This matters because I spend my days building test infrastructure that scales. On one project, I oversaw a 300% increase in test count while hitting 50% faster deployments. That didn't happen by writing more tests manually. It happened by building workflows that let the system do the repetitive work. The spec-driven testing skill is exactly that kind of workflow accelerator.&lt;/p&gt;

&lt;h2&gt;
  
  
  Why this matters for engineers and QA architects
&lt;/h2&gt;

&lt;p&gt;If you're running AI-augmented QA workflows, you know the problem: agents can generate test code, but without a structured pattern for keeping that code alive, regressions pile up and the suite rots. The spec-driven testing skill provides that structure.&lt;/p&gt;

&lt;p&gt;The &lt;code&gt;references/spec-driven-testing.md&lt;/code&gt; file outlines a plan/generate/heal cycle. An agent reads a written spec, plans which Playwright assertions map to the spec's behavior, generates the corresponding test code, then heals regressions when the spec changes or the app drifts. This isn't hypothetical, I've seen this pattern work at scale when migrating from Selenium to Playwright, where we achieved 40% faster test execution.&lt;/p&gt;

&lt;p&gt;For CI engineers, the network inspection overhaul matters more immediately. The old &lt;code&gt;network&lt;/code&gt; command inlined bodies and required brittle string parsing. The new numbered commands (&lt;code&gt;requests&lt;/code&gt;, &lt;code&gt;request &amp;lt;num&amp;gt;&lt;/code&gt;, &lt;code&gt;request-headers &amp;lt;num&amp;gt;&lt;/code&gt;, &lt;code&gt;request-body &amp;lt;num&amp;gt;&lt;/code&gt;) output stable indexes and pipe-friendly data. You can pipe directly to &lt;code&gt;jq&lt;/code&gt; without stripping wrapper text.&lt;/p&gt;

&lt;h2&gt;
  
  
  How to use it
&lt;/h2&gt;

&lt;p&gt;Here's the spec-driven testing workflow in practice. The skill lives at &lt;code&gt;references/spec-driven-testing.md&lt;/code&gt; and gets loaded automatically when you're running Playwright CLI with agent-mode enabled:&lt;/p&gt;

&lt;h1&gt;
  
  
  Start Playwright CLI with agent mode
&lt;/h1&gt;

&lt;p&gt;npx playwright-cli --agent&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;&lt;span class="c"&gt;# The spec-driven testing skill is loaded from references/&lt;/span&gt;
&lt;span class="c"&gt;# Agent can now read a spec and generate tests following the pattern:&lt;/span&gt;
&lt;span class="c"&gt;# 1. PLAN: Map spec requirements to Playwright selectors/assertions&lt;/span&gt;
&lt;span class="c"&gt;# 2. GENERATE: Write test code&lt;/span&gt;
&lt;span class="c"&gt;# 3. HEAL: Detect and fix regressions when specs/app change&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;For the network inspection overhaul, here's a working example:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;&lt;span class="c"&gt;# List all requests with stable numbered indexes&lt;/span&gt;
playwright-cli requests

&lt;span class="c"&gt;# Get full details for request #5&lt;/span&gt;
playwright-cli request 5

&lt;span class="c"&gt;# Extract headers and pipe to jq for CI processing&lt;/span&gt;
playwright-cli request-headers 5 &lt;span class="o"&gt;|&lt;/span&gt; jq &lt;span class="s1"&gt;'.set-cookie'&lt;/span&gt;

&lt;span class="c"&gt;# Save response body directly to file&lt;/span&gt;
playwright-cli response-body 5 --filename ./debug-response.json

&lt;span class="c"&gt;# Run a test that uses the extracted data&lt;/span&gt;
playwright-cli &lt;span class="nb"&gt;test&lt;/span&gt; --config ./playwright.config.ts
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;The raw output change is significant: data-fetching commands like &lt;code&gt;cookie-list&lt;/code&gt;, &lt;code&gt;localstorage-list&lt;/code&gt;, and &lt;code&gt;route-list&lt;/code&gt; now emit unwrapped output by default. Your CI scripts drop 1-2 preprocessing steps per invocation.&lt;/p&gt;

&lt;h2&gt;
  
  
  The gotcha nobody is talking about
&lt;/h2&gt;

&lt;p&gt;The spec-driven testing skill is read-only in this release. You get the reference file and the pattern, but there's no built-in mechanism for the agent to automatically detect spec changes and trigger heals. You have to wire that yourself. In my experience, the first implementation is always manual. You define the trigger conditions, the diff logic, the heal policy. The skill gives you the pattern. You build the automation.&lt;/p&gt;

&lt;p&gt;This is honest: don't expect autonomous test maintenance out of the box. Plan for 2-4 weeks of integration work to wire the heal step into your CI pipeline, depending on your test suite size and the stability of your application contract.&lt;/p&gt;

&lt;h2&gt;
  
  
  What this changes in your CI pipeline
&lt;/h2&gt;

&lt;p&gt;Three concrete changes:&lt;/p&gt;

&lt;ol&gt;
&lt;li&gt;
&lt;strong&gt;Network data is now scriptable.&lt;/strong&gt; You can pull request headers, bodies, and responses directly into CI steps without parsing wrapper text. I estimate this saves 15-30 minutes of scripting work per team per quarter.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Spec-driven test maintenance becomes possible.&lt;/strong&gt; If you're running AI agents for QA, the pattern exists now. You still need to implement the trigger/heal logic, but the framework is there.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;MCP server stability improves.&lt;/strong&gt; Unhandled promise rejections from user callbacks no longer crash the transport. If you're running Playwright CLI as a long-running MCP server (common in AI-augmented workflows), this is meaningful reliability.&lt;/li&gt;
&lt;/ol&gt;

&lt;h2&gt;
  
  
  Migration notes
&lt;/h2&gt;

&lt;p&gt;The &lt;code&gt;network&lt;/code&gt; command is replaced. If you have scripts that parse &lt;code&gt;network&lt;/code&gt; output, they need updating:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;&lt;span class="c"&gt;# Old: playwright-cli network&lt;/span&gt;
&lt;span class="c"&gt;# New: playwright-cli requests&lt;/span&gt;

&lt;span class="c"&gt;# Old: parse inline bodies from network output&lt;/span&gt;
&lt;span class="c"&gt;# New: playwright-cli request-body &amp;lt;num&amp;gt; --filename ./body.txt&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Data-fetching commands (&lt;code&gt;cookie-list&lt;/code&gt;, &lt;code&gt;route-list&lt;/code&gt;, etc.) now emit raw output. If you were stripping the &lt;code&gt;### Result&lt;/code&gt; wrapper, remove that logic, it's gone.&lt;/p&gt;

&lt;p&gt;Config-relative path resolution for &lt;code&gt;initPage&lt;/code&gt; and &lt;code&gt;initScript&lt;/code&gt; now resolves against the config directory (matching Vite/Vitest/ESLint behavior). If you were working around silent load failures, those workarounds are no longer needed.&lt;/p&gt;

&lt;h2&gt;
  
  
  Verdict
&lt;/h2&gt;

&lt;p&gt;Playwright CLI v0.1.10 is a meaningful release for AI QA architects and CI engineers alike. The spec-driven testing skill is the headline for teams adopting AI-augmented workflows, it provides the pattern, even if the automation is still DIY. The network inspection overhaul is the practical win for everyone else: stable indexing, pipe-friendly output, raw by default.&lt;/p&gt;

&lt;p&gt;My recommendation: upgrade, wire the MCP server stability fixes first (low risk, immediate benefit), then evaluate the network inspection changes for your CI scripts. The spec-driven skill is a longer-term investment, budget the integration time honestly, and you'll get the payoff.&lt;/p&gt;

&lt;p&gt;If you're already running Playwright in your CI pipeline, this release makes it easier to script and maintain. If you're building AI-augmented QA workflows, the skill gives you a structure to teach your agents. Both audiences win.&lt;/p&gt;

&lt;p&gt;&lt;em&gt;I'm Anton. I build AI tools and measure how fast they really run. Former Apple engineer. I make &lt;a href="https://ollamatps.com" rel="noopener noreferrer"&gt;ollamatps.com&lt;/a&gt; and write about building and measuring AI at &lt;a href="https://www.anton.qa" rel="noopener noreferrer"&gt;anton.qa&lt;/a&gt;.&lt;/em&gt;&lt;/p&gt;

</description>
      <category>playwright</category>
      <category>ai</category>
      <category>testing</category>
      <category>automation</category>
    </item>
    <item>
      <title>The MCP Ecosystem Just Collapsed Into Playwright</title>
      <dc:creator>Anton Gulin</dc:creator>
      <pubDate>Sat, 21 Nov 2026 19:28:35 +0000</pubDate>
      <link>https://dev.to/aiwithanton/the-mcp-ecosystem-just-collapsed-into-playwright-5609</link>
      <guid>https://dev.to/aiwithanton/the-mcp-ecosystem-just-collapsed-into-playwright-5609</guid>
      <description>&lt;p&gt;&lt;em&gt;Originally published on &lt;a href="https://www.anton.qa/blog/posts/the-mcp-ecosystem-just-collapsed-into-playwright" rel="noopener noreferrer"&gt;anton.qa&lt;/a&gt;.&lt;/em&gt;&lt;/p&gt;

&lt;h2&gt;
  
  
  I spent years fighting login scripts for tests.
&lt;/h2&gt;

&lt;p&gt;AI agents made it worse. They still get stuck at login screens. This month, that changed.&lt;/p&gt;

&lt;p&gt;MCP (how AI talks to tools) is changing how we test. Two teams at Microsoft shipped a fix. They released two ways to share your browser with AI.&lt;/p&gt;

&lt;ol&gt;
&lt;li&gt;Playwright core added &lt;code&gt;browser.bind()&lt;/code&gt;.&lt;/li&gt;
&lt;li&gt;The CLI team added an MCP Bridge.
Both land in the same month. This is not a test. It is the new way.&lt;/li&gt;
&lt;/ol&gt;

&lt;h2&gt;
  
  
  The Drama: What This Replaces
&lt;/h2&gt;

&lt;p&gt;Browser tests have a "login gap." Headless browsers (browsers without a window) start empty. They have no cookies, sessions, or secure login codes.&lt;/p&gt;

&lt;p&gt;When your app needs a company login, a headless browser fails. Teams solve it with hacks. We export cookies, make "special" accounts, or snapshot Docker images.&lt;/p&gt;

&lt;p&gt;I spent 20% of my time just keeping these hacks alive. These new tools don't solve login. They skip it. The human logs in once. The agent uses the same browser.&lt;/p&gt;

&lt;h2&gt;
  
  
  What &lt;code&gt;browser.bind()&lt;/code&gt; Does
&lt;/h2&gt;

&lt;p&gt;&lt;code&gt;browser.bind()&lt;/code&gt; shares the browser you are already using. It shares your cookies and your tabs. When you call it, Playwright creates a local data connection.&lt;/p&gt;

&lt;p&gt;Any AI agent connects to that pipe. It sees the exact same browser you see.&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight typescript"&gt;&lt;code&gt;&lt;span class="k"&gt;import&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt; &lt;span class="n"&gt;chromium&lt;/span&gt; &lt;span class="p"&gt;}&lt;/span&gt; &lt;span class="k"&gt;from&lt;/span&gt; &lt;span class="s1"&gt;'playwright'&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;

&lt;span class="kd"&gt;const&lt;/span&gt; &lt;span class="n"&gt;browser&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="k"&gt;await&lt;/span&gt; &lt;span class="n"&gt;chromium&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;launch&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="p"&gt;{&lt;/span&gt; &lt;span class="n"&gt;headless&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="kc"&gt;false&lt;/span&gt; &lt;span class="p"&gt;}&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;
&lt;span class="kd"&gt;const&lt;/span&gt; &lt;span class="n"&gt;context&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="k"&gt;await&lt;/span&gt; &lt;span class="n"&gt;browser&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;newContext&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;
&lt;span class="kd"&gt;const&lt;/span&gt; &lt;span class="n"&gt;page&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="k"&gt;await&lt;/span&gt; &lt;span class="n"&gt;context&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;newPage&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;

&lt;span class="c1"&gt;// Log in manually. Run your setup.&lt;/span&gt;
&lt;span class="k"&gt;await&lt;/span&gt; &lt;span class="n"&gt;page&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;goto&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="s1"&gt;'https://internal-dashboard.example.com'&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;

&lt;span class="c1"&gt;// Share the browser with AI agents.&lt;/span&gt;
&lt;span class="kd"&gt;const&lt;/span&gt; &lt;span class="n"&gt;binding&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="k"&gt;await&lt;/span&gt; &lt;span class="n"&gt;browser&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;bind&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="p"&gt;{&lt;/span&gt; &lt;span class="n"&gt;pipe&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="s1"&gt;'/tmp/playwright-pipe'&lt;/span&gt; &lt;span class="p"&gt;}&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;

&lt;span class="c1"&gt;// Now Claude can use this exact browser.&lt;/span&gt;
&lt;span class="c1"&gt;// Same cookies. Same session.&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;This is for developers. One line of code. No more re-logging in. No more cookie scripts.&lt;/p&gt;

&lt;h2&gt;
  
  
  What the MCP Bridge Extension Does
&lt;/h2&gt;

&lt;p&gt;The extension is the "no-code" path. Install it in Chrome and click one button. Your open tab now talks to your AI.&lt;/p&gt;

&lt;p&gt;Claude (the AI) sees the page. It can click and type. No terminal needed. Just one click.&lt;/p&gt;

&lt;p&gt;Before: Login -&amp;gt; export cookies -&amp;gt; start new browser.&lt;br&gt;
After: Click the extension. Done.&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;&lt;span class="c"&gt;# Connect your tools to the extension&lt;/span&gt;
playwright-cli attach --extension
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Both tools shipped in one month. They solve the same pain.&lt;/p&gt;

&lt;h2&gt;
  
  
  The Architect's Read: A New Standard
&lt;/h2&gt;

&lt;p&gt;This is a standard being born. Before, every team built their own bridge to the browser. Now, it is a standard feature.&lt;/p&gt;

&lt;p&gt;Two teams shipped one pattern in 30 days. The signal is clear. The browser is now a shared space. Humans and AI agents work on the same surface.&lt;/p&gt;

&lt;p&gt;What does this mean for QA? It means you stop babysitting login scripts. Your AI agent tests run where your humans test. The wall between "human" and "agent" testing is gone.&lt;/p&gt;

&lt;h2&gt;
  
  
  What Most Teams Miss
&lt;/h2&gt;

&lt;p&gt;The win is not just a faster script. The win is "Shared State." Before, we had parallel worlds. One human click and one agent click meant two browsers and two truths.&lt;/p&gt;

&lt;p&gt;Now they are one. When an AI agent finds a bug, you open the same browser. You see the same state and same session.&lt;/p&gt;

&lt;p&gt;No more "it works on my machine." Same browser. Same bug.&lt;/p&gt;

&lt;h2&gt;
  
  
  How to Try It Today
&lt;/h2&gt;

&lt;p&gt;If you use Playwright, &lt;code&gt;browser.bind()&lt;/code&gt; is in v1.59.0. If you want the no-code path, get the extension. Then run &lt;code&gt;playwright-cli attach --extension&lt;/code&gt;.&lt;/p&gt;

&lt;p&gt;Both connect your agent to a real, logged-in browser. Not a toy. Use the browser your team uses.&lt;/p&gt;

&lt;p&gt;&lt;em&gt;I'm Anton. I build AI tools and measure how fast they really run. Former Apple engineer. I make &lt;a href="https://ollamatps.com" rel="noopener noreferrer"&gt;ollamatps.com&lt;/a&gt; and write about building and measuring AI at &lt;a href="https://www.anton.qa" rel="noopener noreferrer"&gt;anton.qa&lt;/a&gt;.&lt;/em&gt;&lt;/p&gt;

</description>
      <category>playwright</category>
      <category>mcp</category>
      <category>ai</category>
      <category>testing</category>
    </item>
    <item>
      <title>Playwright 1.65 breaking changes: each error and its fix</title>
      <dc:creator>Anton Gulin</dc:creator>
      <pubDate>Sat, 21 Nov 2026 15:03:58 +0000</pubDate>
      <link>https://dev.to/aiwithanton/playwright-165-breaking-changes-each-error-and-its-fix-3nnk</link>
      <guid>https://dev.to/aiwithanton/playwright-165-breaking-changes-each-error-and-its-fix-3nnk</guid>
      <description>&lt;p&gt;&lt;em&gt;Originally published on &lt;a href="https://www.anton.qa/blog/posts/playwright-1-65-breaking-changes" rel="noopener noreferrer"&gt;anton.qa&lt;/a&gt;.&lt;/em&gt;&lt;/p&gt;

&lt;p&gt;The Playwright 1.65 release notes list ten changes that can fail your tests. A small demo ran each one on 1.64.1 and on 1.65.1. Below is the real output for each, and a fix that worked.&lt;/p&gt;

&lt;p&gt;Some old passes were hiding real problems. Sections 2, 3 and 5 show three.&lt;/p&gt;

&lt;p&gt;Find your error in the table. Each number matches a section below.&lt;/p&gt;

&lt;div class="table-wrapper-paragraph"&gt;&lt;table&gt;
&lt;thead&gt;
&lt;tr&gt;
&lt;th&gt;Change&lt;/th&gt;
&lt;th&gt;You're affected if&lt;/th&gt;
&lt;th&gt;What you see&lt;/th&gt;
&lt;th&gt;Fix&lt;/th&gt;
&lt;/tr&gt;
&lt;/thead&gt;
&lt;tbody&gt;
&lt;tr&gt;
&lt;td&gt;1. Class fields&lt;/td&gt;
&lt;td&gt;A page object sets a field from &lt;code&gt;this.page&lt;/code&gt;
&lt;/td&gt;
&lt;td&gt;&lt;code&gt;TypeError: Cannot read properties of undefined (reading 'getByRole')&lt;/code&gt;&lt;/td&gt;
&lt;td&gt;Set the field in the constructor&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;2. Inert elements&lt;/td&gt;
&lt;td&gt;A test fills or selects inside an &lt;code&gt;inert&lt;/code&gt; area&lt;/td&gt;
&lt;td&gt;A timeout. With an action timeout set, the log says &lt;code&gt;element is inert&lt;/code&gt;
&lt;/td&gt;
&lt;td&gt;Close the message first, as a user would&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;3. Sharded runs&lt;/td&gt;
&lt;td&gt;A &lt;code&gt;--shard&lt;/code&gt; run finds no tests&lt;/td&gt;
&lt;td&gt;&lt;code&gt;Error: No tests found&lt;/code&gt;&lt;/td&gt;
&lt;td&gt;Fix the filter. Add &lt;code&gt;--pass-with-no-tests&lt;/code&gt; only if zero tests is normal&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;4. Cookies by URL&lt;/td&gt;
&lt;td&gt;A test reads cookies for a subdomain, or for &lt;code&gt;/apiv2&lt;/code&gt; with an &lt;code&gt;/api&lt;/code&gt; cookie&lt;/td&gt;
&lt;td&gt;The cookie is missing from the list&lt;/td&gt;
&lt;td&gt;Ask with the cookie's own URL&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;5. Proxy login&lt;/td&gt;
&lt;td&gt;A site login came from the &lt;code&gt;proxy&lt;/code&gt; option&lt;/td&gt;
&lt;td&gt;The site answers 401&lt;/td&gt;
&lt;td&gt;Add &lt;code&gt;httpCredentials&lt;/code&gt;
&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;6. Hidden text&lt;/td&gt;
&lt;td&gt;A &lt;code&gt;getByRole&lt;/code&gt; name or an aria snapshot holds text the browser hides&lt;/td&gt;
&lt;td&gt;A snapshot mismatch, or &lt;code&gt;getByRole&lt;/code&gt; finds nothing&lt;/td&gt;
&lt;td&gt;Update the snapshot or the name&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;7. Request &lt;code&gt;params&lt;/code&gt;
&lt;/td&gt;
&lt;td&gt;A string &lt;code&gt;params&lt;/code&gt; goes to a URL that has a query&lt;/td&gt;
&lt;td&gt;Both queries are sent&lt;/td&gt;
&lt;td&gt;Keep the query in one place&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;8. Style imports&lt;/td&gt;
&lt;td&gt;A test imports a style file that does not exist&lt;/td&gt;
&lt;td&gt;&lt;code&gt;Error: Cannot find module './price.css'&lt;/code&gt;&lt;/td&gt;
&lt;td&gt;Create the file, or remove the import&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;9. Blob reports&lt;/td&gt;
&lt;td&gt;Two runs write blob reports to one folder&lt;/td&gt;
&lt;td&gt;Only the last report stays&lt;/td&gt;
&lt;td&gt;Use one folder per run&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;10. Test locations&lt;/td&gt;
&lt;td&gt;A script stores &lt;code&gt;file:line:column&lt;/code&gt;
&lt;/td&gt;
&lt;td&gt;&lt;code&gt;Error: No tests found.&lt;/code&gt;&lt;/td&gt;
&lt;td&gt;Use &lt;code&gt;file:line&lt;/code&gt;
&lt;/td&gt;
&lt;/tr&gt;
&lt;/tbody&gt;
&lt;/table&gt;&lt;/div&gt;

&lt;p&gt;The list follows the Notable Changes in the &lt;a href="https://github.com/microsoft/playwright/releases/tag/v1.65.0" rel="noopener noreferrer"&gt;1.65 release notes&lt;/a&gt;. Playwright 1.65.1 came out on November 13 with two fixes. One of them matters for section 1.&lt;/p&gt;

&lt;h2&gt;
  
  
  1. Class fields follow your TypeScript settings
&lt;/h2&gt;

&lt;p&gt;You're affected if a page object sets a field from &lt;code&gt;this.page&lt;/code&gt;. A page object is a class that holds one page's buttons. &lt;a href="https://www.anton.qa/blog/posts/page-object-model-in-playwright-with-typescript-complete-guide" rel="noopener noreferrer"&gt;This guide&lt;/a&gt; explains the pattern.&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight typescript"&gt;&lt;code&gt;&lt;span class="k"&gt;export&lt;/span&gt; &lt;span class="k"&gt;class&lt;/span&gt; &lt;span class="nc"&gt;LoginPage&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt;
  &lt;span class="k"&gt;readonly&lt;/span&gt; &lt;span class="n"&gt;submit&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="kc"&gt;this&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="n"&gt;page&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;getByRole&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="s1"&gt;'button'&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt; &lt;span class="n"&gt;name&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="s1"&gt;'Submit'&lt;/span&gt; &lt;span class="p"&gt;}&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;

  &lt;span class="nf"&gt;constructor&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="k"&gt;private&lt;/span&gt; &lt;span class="k"&gt;readonly&lt;/span&gt; &lt;span class="n"&gt;page&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="nc"&gt;Page&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt;&lt;span class="p"&gt;}&lt;/span&gt;
&lt;span class="p"&gt;}&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;In the demo, a test with this class passes on 1.64.1. On 1.65.1 it fails:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;TypeError: Cannot read properties of undefined (reading 'getByRole')
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;It fails when &lt;code&gt;tsconfig.json&lt;/code&gt;, the TypeScript settings file, targets ES2022 or newer. It also fails when no target is set.&lt;/p&gt;

&lt;p&gt;Why? Playwright 1.65 follows the TypeScript setting &lt;code&gt;useDefineForClassFields&lt;/code&gt;. With it on, the &lt;code&gt;submit&lt;/code&gt; line runs before the constructor saves &lt;code&gt;page&lt;/code&gt;. The constructor is the class's setup code. So &lt;code&gt;this.page&lt;/code&gt; is still empty.&lt;/p&gt;

&lt;p&gt;Two fixes. Both pass in the same demo.&lt;/p&gt;

&lt;ol&gt;
&lt;li&gt;Set the field inside the constructor:
&lt;/li&gt;
&lt;/ol&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight typescript"&gt;&lt;code&gt;&lt;span class="k"&gt;export&lt;/span&gt; &lt;span class="k"&gt;class&lt;/span&gt; &lt;span class="nc"&gt;LoginPage&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt;
  &lt;span class="k"&gt;readonly&lt;/span&gt; &lt;span class="n"&gt;submit&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="nc"&gt;Locator&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;

  &lt;span class="nf"&gt;constructor&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="k"&gt;private&lt;/span&gt; &lt;span class="k"&gt;readonly&lt;/span&gt; &lt;span class="n"&gt;page&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="nc"&gt;Page&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt;
    &lt;span class="kc"&gt;this&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="n"&gt;submit&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="n"&gt;page&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;getByRole&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="s1"&gt;'button'&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt; &lt;span class="n"&gt;name&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="s1"&gt;'Submit'&lt;/span&gt; &lt;span class="p"&gt;}&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;
  &lt;span class="p"&gt;}&lt;/span&gt;
&lt;span class="p"&gt;}&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;ol&gt;
&lt;li&gt;Or switch the setting off in &lt;code&gt;tsconfig.json&lt;/code&gt;:
&lt;/li&gt;
&lt;/ol&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight json"&gt;&lt;code&gt;&lt;span class="p"&gt;{&lt;/span&gt;
  &lt;span class="nl"&gt;"compilerOptions"&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt;
    &lt;span class="nl"&gt;"target"&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="s2"&gt;"ES2022"&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;
    &lt;span class="nl"&gt;"useDefineForClassFields"&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="kc"&gt;false&lt;/span&gt;
  &lt;span class="p"&gt;}&lt;/span&gt;
&lt;span class="p"&gt;}&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;I'd pick fix 1. It works with any target. Fix 2 also changes every other class that file covers.&lt;/p&gt;

&lt;h3&gt;
  
  
  If you picked fix 2, use 1.65.1
&lt;/h3&gt;

&lt;p&gt;On 1.65.0, fix 2 broke one more pattern. A class with a decorator and a static field failed to load. A decorator is a label like &lt;code&gt;@Page&lt;/code&gt; above a class. A static field belongs to the class itself.&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight typescript"&gt;&lt;code&gt;&lt;span class="nd"&gt;@Page&lt;/span&gt;
&lt;span class="k"&gt;class&lt;/span&gt; &lt;span class="nc"&gt;CartPage&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt;
  &lt;span class="k"&gt;static&lt;/span&gt; &lt;span class="k"&gt;readonly&lt;/span&gt; &lt;span class="no"&gt;PATH&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="s1"&gt;'/cart'&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;
&lt;span class="p"&gt;}&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;





&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;TypeError: _initClass is not a function
Error: No tests found
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;In the demo, this file loads on 1.64.1 and on 1.65.1. It fails only on 1.65.0, and only with the setting off. A static block failed too, with &lt;code&gt;Cannot set properties of undefined&lt;/code&gt;. Playwright 1.65.1 fixed both, as &lt;a href="https://github.com/microsoft/playwright/issues/43936" rel="noopener noreferrer"&gt;issue 43936&lt;/a&gt; describes.&lt;/p&gt;

&lt;p&gt;Playwright's docs cover this setting under &lt;a href="https://playwright.dev/docs/test-typescript#tsconfig-class-fields" rel="noopener noreferrer"&gt;TypeScript class fields&lt;/a&gt;.&lt;/p&gt;

&lt;h2&gt;
  
  
  2. Actions wait until an element is not inert
&lt;/h2&gt;

&lt;p&gt;You're affected if a test fills or selects inside an area marked &lt;code&gt;inert&lt;/code&gt;. That HTML attribute switches off part of a page. Some apps set it on a form while a message is open.&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight html"&gt;&lt;code&gt;&lt;span class="nt"&gt;&amp;lt;main&lt;/span&gt; &lt;span class="na"&gt;inert&lt;/span&gt;&lt;span class="nt"&gt;&amp;gt;&lt;/span&gt;
  &lt;span class="nt"&gt;&amp;lt;label&amp;gt;&lt;/span&gt;Plan &lt;span class="nt"&gt;&amp;lt;select&lt;/span&gt; &lt;span class="na"&gt;id&lt;/span&gt;&lt;span class="o"&gt;=&lt;/span&gt;&lt;span class="s"&gt;"plan"&lt;/span&gt;&lt;span class="nt"&gt;&amp;gt;&lt;/span&gt;...&lt;span class="nt"&gt;&amp;lt;/select&amp;gt;&amp;lt;/label&amp;gt;&lt;/span&gt;
  &lt;span class="nt"&gt;&amp;lt;label&amp;gt;&lt;/span&gt;Email &lt;span class="nt"&gt;&amp;lt;input&lt;/span&gt; &lt;span class="na"&gt;id&lt;/span&gt;&lt;span class="o"&gt;=&lt;/span&gt;&lt;span class="s"&gt;"email"&lt;/span&gt;&lt;span class="nt"&gt;&amp;gt;&amp;lt;/label&amp;gt;&lt;/span&gt;
&lt;span class="nt"&gt;&amp;lt;/main&amp;gt;&lt;/span&gt;
&lt;span class="nt"&gt;&amp;lt;div&lt;/span&gt; &lt;span class="na"&gt;role&lt;/span&gt;&lt;span class="o"&gt;=&lt;/span&gt;&lt;span class="s"&gt;"dialog"&lt;/span&gt; &lt;span class="na"&gt;aria-label&lt;/span&gt;&lt;span class="o"&gt;=&lt;/span&gt;&lt;span class="s"&gt;"Session expired"&lt;/span&gt;&lt;span class="nt"&gt;&amp;gt;&lt;/span&gt;
  &lt;span class="nt"&gt;&amp;lt;p&amp;gt;&lt;/span&gt;Session expired&lt;span class="nt"&gt;&amp;lt;/p&amp;gt;&lt;/span&gt;
  &lt;span class="nt"&gt;&amp;lt;button&amp;gt;&lt;/span&gt;OK&lt;span class="nt"&gt;&amp;lt;/button&amp;gt;&lt;/span&gt;
&lt;span class="nt"&gt;&amp;lt;/div&amp;gt;&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;The OK button removes &lt;code&gt;inert&lt;/code&gt; and closes the message. The test never clicks OK:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight typescript"&gt;&lt;code&gt;&lt;span class="k"&gt;await&lt;/span&gt; &lt;span class="n"&gt;page&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;locator&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="s1"&gt;'#plan'&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;selectOption&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="s1"&gt;'pro'&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;
&lt;span class="k"&gt;await&lt;/span&gt; &lt;span class="n"&gt;page&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;locator&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="s1"&gt;'#email'&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;fill&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="s1"&gt;'anna@example.com'&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;In the demo, both lines pass on 1.64.1. But &lt;code&gt;selectOption&lt;/code&gt; changed a dropdown no user could reach. And &lt;code&gt;fill&lt;/code&gt; gave no error while the field stayed empty.&lt;/p&gt;

&lt;p&gt;On 1.65.1 each line waits, then times out:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;TimeoutError: locator.selectOption: Timeout 3000ms exceeded.
Call log:
  - waiting for locator('#plan')
    - locator resolved to &amp;lt;select id="plan"&amp;gt;…&amp;lt;/select&amp;gt;
  - attempting select option action
    2 × waiting for element to be visible and enabled
      - element is inert
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;The demo sets an action timeout of 3 seconds. That is a time limit for one action. Without it, the run printed only a test timeout, with no reason:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;Test timeout of 30000ms exceeded.
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;So if the upgrade gives you only a test timeout, look for inert areas.&lt;/p&gt;

&lt;p&gt;Two fixes. Both pass in the same demo.&lt;/p&gt;

&lt;ol&gt;
&lt;li&gt;Do what a user does first. Close the message:
&lt;/li&gt;
&lt;/ol&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight typescript"&gt;&lt;code&gt;&lt;span class="k"&gt;await&lt;/span&gt; &lt;span class="n"&gt;page&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;getByRole&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="s1"&gt;'button'&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt; &lt;span class="n"&gt;name&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="s1"&gt;'OK'&lt;/span&gt; &lt;span class="p"&gt;}&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;click&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;ol&gt;
&lt;li&gt;If the area is inert only for a moment, change nothing. In the demo, &lt;code&gt;inert&lt;/code&gt; went away after one second. Playwright 1.65.1 waited about 1.2 seconds, then passed.&lt;/li&gt;
&lt;/ol&gt;

&lt;p&gt;I'd start with fix 1. A real user must close that message too. If the area stays inert, the page may have a bug.&lt;/p&gt;

&lt;p&gt;Not affected:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;
&lt;code&gt;click()&lt;/code&gt; and &lt;code&gt;check()&lt;/code&gt;, which already timed out on 1.64.1.&lt;/li&gt;
&lt;li&gt;Dialogs opened with &lt;code&gt;showModal()&lt;/code&gt; and no &lt;code&gt;inert&lt;/code&gt; attribute.&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;Playwright's docs list this under &lt;a href="https://playwright.dev/docs/actionability#not-inert" rel="noopener noreferrer"&gt;the not inert check&lt;/a&gt;.&lt;/p&gt;

&lt;h2&gt;
  
  
  3. A sharded run with no tests fails
&lt;/h2&gt;

&lt;p&gt;You're affected if &lt;code&gt;--shard&lt;/code&gt; splits your run across machines and it finds no tests.&lt;/p&gt;

&lt;p&gt;Example: a command picks tests by tag, a label like &lt;code&gt;@smoke&lt;/code&gt;. The tag has a typo:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;npx playwright &lt;span class="nb"&gt;test&lt;/span&gt; --grep @smkoe --shard=1/2
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;In the demo, 1.64.1 prints nothing and exits with code 0. CI, the pipeline that runs your tests, reads that as a pass. Zero tests ran.&lt;/p&gt;

&lt;p&gt;On 1.65.1 both shards fail:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;Error: No tests found
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Without &lt;code&gt;--shard&lt;/code&gt;, this command already failed on 1.64.1. With &lt;code&gt;--shard&lt;/code&gt;, a wrong path or test folder also passed. Playwright 1.65 counts the tests before it splits them.&lt;/p&gt;

&lt;p&gt;Two fixes. Both pass in the same demo.&lt;/p&gt;

&lt;ol&gt;
&lt;li&gt;Fix the tag, path or folder, so the run finds its tests.&lt;/li&gt;
&lt;li&gt;If finding no tests is normal for a job, add &lt;code&gt;--pass-with-no-tests&lt;/code&gt;.&lt;/li&gt;
&lt;/ol&gt;

&lt;p&gt;I'd start with fix 1. The new error may mean your tests never ran.&lt;/p&gt;

&lt;p&gt;Not affected:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;An empty shard, when other shards have tests.&lt;/li&gt;
&lt;li&gt;Runs with &lt;code&gt;--only-changed&lt;/code&gt; or &lt;code&gt;--last-failed&lt;/code&gt;.&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;Shards have one more limit. Playwright 1.65 added a lock that lets one test run alone. Each shard has its own lock, so tests in other shards still run. &lt;a href="https://www.anton.qa/blog/posts/playwright-exclusive-test-lock" rel="noopener noreferrer"&gt;This post on the lock&lt;/a&gt; shows a demo.&lt;/p&gt;

&lt;h2&gt;
  
  
  4. Cookie lookups by URL follow browser rules
&lt;/h2&gt;

&lt;p&gt;You're affected if a test reads cookies for a subdomain. The same goes for &lt;code&gt;/apiv2&lt;/code&gt; when the cookie path is &lt;code&gt;/api&lt;/code&gt;. A cookie is a small value a site stores, like a login session.&lt;/p&gt;

&lt;p&gt;The demo stores a cookie for one host. Then it asks about a subdomain:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight typescript"&gt;&lt;code&gt;&lt;span class="k"&gt;await&lt;/span&gt; &lt;span class="n"&gt;context&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;addCookies&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="p"&gt;[&lt;/span&gt;
  &lt;span class="p"&gt;{&lt;/span&gt; &lt;span class="n"&gt;name&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="s1"&gt;'session'&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="n"&gt;value&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="s1"&gt;'abc'&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="n"&gt;url&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="s1"&gt;'https://shop.example.com/'&lt;/span&gt; &lt;span class="p"&gt;}&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;
&lt;span class="p"&gt;]&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;
&lt;span class="kd"&gt;const&lt;/span&gt; &lt;span class="n"&gt;cookies&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="k"&gt;await&lt;/span&gt; &lt;span class="n"&gt;context&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;cookies&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="s1"&gt;'https://api.shop.example.com/'&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;
&lt;span class="nb"&gt;console&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;log&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="nb"&gt;JSON&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;stringify&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;cookies&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;map&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;c&lt;/span&gt; &lt;span class="o"&gt;=&amp;gt;&lt;/span&gt; &lt;span class="n"&gt;c&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="n"&gt;name&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;





&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;1.64.1   ["session"]
1.65.1   []
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;A cookie set this way belongs to one host. A browser does not send it to &lt;code&gt;api.shop.example.com&lt;/code&gt;. The old answer listed it anyway. The new answer matches what the browser sends.&lt;/p&gt;

&lt;p&gt;Paths changed the same way. A cookie with &lt;code&gt;Path=/api&lt;/code&gt; was listed for &lt;code&gt;/apiv2&lt;/code&gt; on 1.64.1. On 1.65.1 it is listed for &lt;code&gt;/api&lt;/code&gt; and &lt;code&gt;/api/orders&lt;/code&gt; only.&lt;/p&gt;

&lt;p&gt;A test that checks the list then fails:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;Error: expect(received).toContain(expected) // indexOf

Expected value: "session"
Received array: []
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Two fixes. Both worked in the demo.&lt;/p&gt;

&lt;ol&gt;
&lt;li&gt;Ask with the cookie's own URL, here &lt;code&gt;https://shop.example.com/&lt;/code&gt;.&lt;/li&gt;
&lt;li&gt;To cover subdomains, set the cookie with a domain that starts with a dot:
&lt;/li&gt;
&lt;/ol&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight typescript"&gt;&lt;code&gt;&lt;span class="k"&gt;await&lt;/span&gt; &lt;span class="n"&gt;context&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;addCookies&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="p"&gt;[&lt;/span&gt;
  &lt;span class="p"&gt;{&lt;/span&gt; &lt;span class="n"&gt;name&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="s1"&gt;'session'&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="n"&gt;value&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="s1"&gt;'abc'&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="n"&gt;domain&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="s1"&gt;'.shop.example.com'&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="n"&gt;path&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="s1"&gt;'/'&lt;/span&gt; &lt;span class="p"&gt;}&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;
&lt;span class="p"&gt;]&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;&lt;code&gt;request.cookies(url)&lt;/code&gt; changed the same way. For these cookies, the requests sent the same Cookie header on both versions. These rules come from RFC 6265, the web standard for cookies.&lt;/p&gt;

&lt;p&gt;Two small notes from the demo. A &lt;code&gt;Path=/foo/&lt;/code&gt; cookie did not match &lt;code&gt;/foo&lt;/code&gt; on either version, so nothing changes there. And a server sent &lt;code&gt;Set-Cookie: token&lt;/code&gt;, a cookie with no name. Playwright 1.64.1 sent back &lt;code&gt;token=&lt;/code&gt;. Playwright 1.65.1 sends back &lt;code&gt;token&lt;/code&gt;.&lt;/p&gt;

&lt;h2&gt;
  
  
  5. Proxy passwords stay with the proxy
&lt;/h2&gt;

&lt;p&gt;You're affected if a site login used the username and password from the &lt;code&gt;proxy&lt;/code&gt; option. A proxy is a server your browser traffic passes through.&lt;/p&gt;

&lt;p&gt;The demo has a local proxy and a local site. The site asks for its own login with a 401 answer.&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight typescript"&gt;&lt;code&gt;&lt;span class="n"&gt;test&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;use&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="p"&gt;{&lt;/span&gt;
  &lt;span class="n"&gt;proxy&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt;
    &lt;span class="n"&gt;server&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="s1"&gt;'http://127.0.0.1:4763'&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;
    &lt;span class="n"&gt;username&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="s1"&gt;'proxyuser'&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;
    &lt;span class="n"&gt;password&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="s1"&gt;'proxypass'&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;
  &lt;span class="p"&gt;}&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;
&lt;span class="p"&gt;}&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;

&lt;span class="nf"&gt;test&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="s1"&gt;'open the account page'&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="k"&gt;async&lt;/span&gt; &lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="p"&gt;{&lt;/span&gt; &lt;span class="n"&gt;page&lt;/span&gt; &lt;span class="p"&gt;}&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt; &lt;span class="o"&gt;=&amp;gt;&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt;
  &lt;span class="kd"&gt;const&lt;/span&gt; &lt;span class="n"&gt;response&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="k"&gt;await&lt;/span&gt; &lt;span class="n"&gt;page&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;goto&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="s1"&gt;'http://shop.test/account'&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;
  &lt;span class="nb"&gt;console&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;log&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;response&lt;/span&gt;&lt;span class="o"&gt;?&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;status&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="k"&gt;await&lt;/span&gt; &lt;span class="n"&gt;page&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;locator&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="s1"&gt;'body'&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;innerText&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;
&lt;span class="p"&gt;}&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;





&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;1.64.1   200 Logged in as: proxyuser:proxypass
1.65.1   401 Login required
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;On 1.64.1, Chromium answered the site's login with the proxy password. The site received &lt;code&gt;proxyuser:proxypass&lt;/code&gt;. On 1.65.1 the site receives nothing and answers 401.&lt;/p&gt;

&lt;p&gt;The old behavior sent a proxy password to a website. It could also hide a setup mistake. A test could pass while the site's real login was never set.&lt;/p&gt;

&lt;p&gt;This demo proxy lets anyone through. It never asks for its password. A proxy that does ask gave the same result on the second page visit.&lt;/p&gt;

&lt;p&gt;Fix: give the website its own login with &lt;code&gt;httpCredentials&lt;/code&gt;:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight typescript"&gt;&lt;code&gt;&lt;span class="n"&gt;test&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;use&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="p"&gt;{&lt;/span&gt;
  &lt;span class="n"&gt;proxy&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt;
    &lt;span class="n"&gt;server&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="s1"&gt;'http://127.0.0.1:4763'&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;
    &lt;span class="n"&gt;username&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="s1"&gt;'proxyuser'&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;
    &lt;span class="n"&gt;password&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="s1"&gt;'proxypass'&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;
  &lt;span class="p"&gt;}&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;
  &lt;span class="n"&gt;httpCredentials&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt; &lt;span class="n"&gt;username&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="s1"&gt;'shopuser'&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="n"&gt;password&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="s1"&gt;'shoppass'&lt;/span&gt; &lt;span class="p"&gt;}&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;
&lt;span class="p"&gt;}&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;On 1.65.1 the site receives &lt;code&gt;shopuser:shoppass&lt;/code&gt; and answers 200. On 1.64.1 the same settings still sent the proxy password to the site. The demo used Chromium only.&lt;/p&gt;

&lt;h2&gt;
  
  
  6. Hidden text is no longer in names and aria snapshots
&lt;/h2&gt;

&lt;p&gt;You're affected if a &lt;code&gt;getByRole&lt;/code&gt; name or an aria snapshot includes text the browser hides. An aria snapshot is a text outline of what a screen reader gets.&lt;/p&gt;

&lt;p&gt;Case one is a closed &lt;code&gt;&amp;lt;details&amp;gt;&lt;/code&gt; block with text directly inside:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight html"&gt;&lt;code&gt;&lt;span class="nt"&gt;&amp;lt;details&amp;gt;&lt;/span&gt;
  &lt;span class="nt"&gt;&amp;lt;summary&amp;gt;&lt;/span&gt;Shipping&lt;span class="nt"&gt;&amp;lt;/summary&amp;gt;&lt;/span&gt;
  Ships in 2 days
&lt;span class="nt"&gt;&amp;lt;/details&amp;gt;&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;





&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight typescript"&gt;&lt;code&gt;&lt;span class="nb"&gt;console&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;log&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="k"&gt;await&lt;/span&gt; &lt;span class="n"&gt;page&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;locator&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="s1"&gt;'body'&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;ariaSnapshot&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;





&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;1.64.1   - group: Shipping Ships in 2 days
1.65.1   - group: Shipping
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;After a click on Shipping, both versions print the full line. A snapshot saved on 1.64.1 fails on 1.65.1:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;Error: expect(locator).toMatchAriaSnapshot(expected) failed

Expected: "- group: Shipping Ships in 2 days"
Received: "- group: Shipping"
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Case two is a custom element that never shows its inner text:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight html"&gt;&lt;code&gt;&lt;span class="nt"&gt;&amp;lt;a&lt;/span&gt; &lt;span class="na"&gt;href&lt;/span&gt;&lt;span class="o"&gt;=&lt;/span&gt;&lt;span class="s"&gt;"/cart"&lt;/span&gt;&lt;span class="nt"&gt;&amp;gt;&amp;lt;cart-icon&amp;gt;&lt;/span&gt;cart icon fallback&lt;span class="nt"&gt;&amp;lt;/cart-icon&amp;gt;&lt;/span&gt; Cart&lt;span class="nt"&gt;&amp;lt;/a&amp;gt;&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Here &lt;code&gt;cart-icon&lt;/code&gt; draws its own picture and has no slot for the inner words. The link's accessible name is what a screen reader says for it:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;1.64.1   - link "cart icon fallback Cart":
1.65.1   - link "Cart":
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;So a locator with the old long name finds nothing on 1.65.1. And &lt;code&gt;getByRole('link', { name: 'Cart', exact: true })&lt;/code&gt; finds the link on 1.65.1 only.&lt;/p&gt;

&lt;p&gt;Two fixes. Both worked in the demo.&lt;/p&gt;

&lt;ol&gt;
&lt;li&gt;For snapshots, read the difference first. Then update the file:
&lt;/li&gt;
&lt;/ol&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;npx playwright &lt;span class="nb"&gt;test&lt;/span&gt; --update-snapshots
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;That rewrites snapshot files. For a snapshot written inside the test, Playwright saves a patch instead. Apply it with &lt;code&gt;git apply test-results/rebaselines.patch&lt;/code&gt;.&lt;/p&gt;

&lt;ol&gt;
&lt;li&gt;For names, use the text a user can see.&lt;/li&gt;
&lt;/ol&gt;

&lt;p&gt;Not affected: &lt;code&gt;getByText('Ships in 2 days')&lt;/code&gt; still finds the hidden text on both versions.&lt;/p&gt;

&lt;h2&gt;
  
  
  7. String params are added to the query
&lt;/h2&gt;

&lt;p&gt;You're affected if an API test passes string &lt;code&gt;params&lt;/code&gt; to a URL with a query. The query is the part after the &lt;code&gt;?&lt;/code&gt;.&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight typescript"&gt;&lt;code&gt;&lt;span class="kd"&gt;const&lt;/span&gt; &lt;span class="n"&gt;response&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="k"&gt;await&lt;/span&gt; &lt;span class="n"&gt;request&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;get&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="s1"&gt;'/search?lang=en'&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt; &lt;span class="n"&gt;params&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="s1"&gt;'page=2'&lt;/span&gt; &lt;span class="p"&gt;}&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;In the demo, a small local server answers with the URL it received:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;1.64.1   /search?page=2
1.65.1   /search?lang=en&amp;amp;page=2
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Playwright 1.64.1 replaced the query. Playwright 1.65.1 keeps it and adds the string. &lt;code&gt;URLSearchParams&lt;/code&gt; values changed the same way. Object values like &lt;code&gt;{ page: 2 }&lt;/code&gt; were already added on 1.64.1.&lt;/p&gt;

&lt;p&gt;Watch for a key that appears twice. A URL with &lt;code&gt;?page=1&lt;/code&gt; plus &lt;code&gt;params: 'page=2'&lt;/code&gt; now sends &lt;code&gt;page=1&amp;amp;page=2&lt;/code&gt;.&lt;/p&gt;

&lt;p&gt;Fix: keep the query in one place. Put all of it in the URL, or all of it in &lt;code&gt;params&lt;/code&gt;.&lt;/p&gt;

&lt;h2&gt;
  
  
  8. An imported style file must exist
&lt;/h2&gt;

&lt;p&gt;You're affected if a test imports a &lt;code&gt;.css&lt;/code&gt;, &lt;code&gt;.less&lt;/code&gt; or &lt;code&gt;.scss&lt;/code&gt; file that is missing. It also fails when an app file your test imports has such an import.&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight typescript"&gt;&lt;code&gt;&lt;span class="k"&gt;import&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt; &lt;span class="n"&gt;test&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="n"&gt;expect&lt;/span&gt; &lt;span class="p"&gt;}&lt;/span&gt; &lt;span class="k"&gt;from&lt;/span&gt; &lt;span class="s1"&gt;'@playwright/test'&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;
&lt;span class="k"&gt;import&lt;/span&gt; &lt;span class="s1"&gt;'./price.css'&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Playwright 1.64.1 removed such imports, so a missing file did no harm. Playwright 1.65.1 loads the file as an empty module. So the file must be there:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;Error: Cannot find module './price.css'
...
Error: No tests found
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;One way to get here is a style file made by a build step. If that step has not run, the file is not there yet.&lt;/p&gt;

&lt;p&gt;Fix: make sure the file exists before the tests start. Or remove the import if the test does not need it. With the file in place, the demo passes on both versions.&lt;/p&gt;

&lt;p&gt;One import got better. &lt;code&gt;import styles from './button.module.css'&lt;/code&gt; failed on 1.64.1 with &lt;code&gt;ReferenceError: styles is not defined&lt;/code&gt;. On 1.65.1, &lt;code&gt;styles&lt;/code&gt; is an empty object and the test runs.&lt;/p&gt;

&lt;h2&gt;
  
  
  9. The blob reporter empties its folder
&lt;/h2&gt;

&lt;p&gt;You're affected if two runs write blob reports into one folder. A blob report is a zip file with one run's results. The &lt;code&gt;merge-reports&lt;/code&gt; command joins several of them into one report.&lt;/p&gt;

&lt;p&gt;The demo uses &lt;code&gt;reporter: 'blob'&lt;/code&gt; and runs two shards on one machine:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;npx playwright &lt;span class="nb"&gt;test&lt;/span&gt; --shard=1/2
npx playwright &lt;span class="nb"&gt;test&lt;/span&gt; --shard=2/2
ls blob-report
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;





&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;report-2.zip
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;The first report is gone. The merged report then shows 2 of the 4 tests.&lt;/p&gt;

&lt;p&gt;The release notes say 1.64 kept older reports with different names. In the demo, 1.64.0 and 1.64.1 removed the first report too. So check this even before you upgrade. Your merged report may already be missing tests.&lt;/p&gt;

&lt;p&gt;Two fixes. Both gave a merged report with all 4 tests.&lt;/p&gt;

&lt;ol&gt;
&lt;li&gt;Give each run its own folder. Then copy the zip files into one folder and merge:
&lt;/li&gt;
&lt;/ol&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;&lt;span class="nv"&gt;PLAYWRIGHT_BLOB_OUTPUT_DIR&lt;/span&gt;&lt;span class="o"&gt;=&lt;/span&gt;blob-1 npx playwright &lt;span class="nb"&gt;test&lt;/span&gt; --shard=1/2
&lt;span class="nv"&gt;PLAYWRIGHT_BLOB_OUTPUT_DIR&lt;/span&gt;&lt;span class="o"&gt;=&lt;/span&gt;blob-2 npx playwright &lt;span class="nb"&gt;test&lt;/span&gt; --shard=2/2
mkdir -p all-blob-reports &lt;span class="o"&gt;&amp;amp;&amp;amp;&lt;/span&gt; cp blob-1/*.zip blob-2/*.zip all-blob-reports/
npx playwright merge-reports --reporter=list all-blob-reports
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;ol&gt;
&lt;li&gt;Or name each file. Then Playwright does not clear the folder:
&lt;/li&gt;
&lt;/ol&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;&lt;span class="nv"&gt;PLAYWRIGHT_BLOB_OUTPUT_FILE&lt;/span&gt;&lt;span class="o"&gt;=&lt;/span&gt;all-blob-reports/shard-1.zip npx playwright &lt;span class="nb"&gt;test&lt;/span&gt; --shard=1/2
&lt;span class="nv"&gt;PLAYWRIGHT_BLOB_OUTPUT_FILE&lt;/span&gt;&lt;span class="o"&gt;=&lt;/span&gt;all-blob-reports/shard-2.zip npx playwright &lt;span class="nb"&gt;test&lt;/span&gt; --shard=2/2
npx playwright merge-reports --reporter=list all-blob-reports
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Playwright's docs describe both options under &lt;a href="https://playwright.dev/docs/test-reporters#blob-reporter" rel="noopener noreferrer"&gt;blob reporter&lt;/a&gt;.&lt;/p&gt;

&lt;h2&gt;
  
  
  10. Test locations point to the start of the call
&lt;/h2&gt;

&lt;p&gt;You're affected if a script or a saved command uses &lt;code&gt;file:line:column&lt;/code&gt;.&lt;/p&gt;

&lt;p&gt;In the demo, a test sits on line 3 of &lt;code&gt;a.spec.ts&lt;/code&gt;:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;1.64.1   a.spec.ts:3:5 › top level
1.65.1   a.spec.ts:3:1 › top level
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;The column now points to the start of &lt;code&gt;test(&lt;/code&gt;. This applies to projects that compile to CommonJS, the older Node.js module format. Projects with &lt;code&gt;"type": "module"&lt;/code&gt; already printed &lt;code&gt;3:1&lt;/code&gt; on 1.64.1.&lt;/p&gt;

&lt;p&gt;A saved command with the old column finds nothing on 1.65.1:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;npx playwright &lt;span class="nb"&gt;test&lt;/span&gt; tests/a.spec.ts:3:5
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;





&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;Error: No tests found.
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Fix: leave the column out. &lt;code&gt;tests/a.spec.ts:3&lt;/code&gt; finds the test on both versions. The &lt;code&gt;column&lt;/code&gt; value in the JSON report changes too, from 5 to 1.&lt;/p&gt;

&lt;h2&gt;
  
  
  Also new in 1.65
&lt;/h2&gt;

&lt;p&gt;&lt;strong&gt;A reason for skip, fixme, fail and slow.&lt;/strong&gt; &lt;code&gt;test.skip('Not implemented yet')&lt;/code&gt; now saves that text as the reason. The demo ran 16 tests with these calls on both versions. Every test had the same result. Only the saved reason is new.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Node.js 20.&lt;/strong&gt; Playwright no longer tests on Node.js 20. The 1.65.1 packages still declare &lt;code&gt;"node": "&amp;gt;=20"&lt;/code&gt;. The docs list Node.js 22, 24 and 26. I'd move to one of those. The demo did not run on Node.js 20.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Docker images.&lt;/strong&gt; The official images now carry Node.js 26, not 24. The Dockerfile line changed from &lt;code&gt;ARG NODE_VERSION=24&lt;/code&gt; to &lt;code&gt;ARG NODE_VERSION=26&lt;/code&gt;. Your own scripts in that image run on Node.js 26 too.&lt;/p&gt;

&lt;h2&gt;
  
  
  What 1.65.1 fixed
&lt;/h2&gt;

&lt;p&gt;Playwright 1.65.1 came out on November 13, 2026. Its notes list two fixes.&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;Decorated classes with a static field load again with &lt;code&gt;useDefineForClassFields&lt;/code&gt; off. Section 1 shows the run.&lt;/li&gt;
&lt;li&gt;Test locations were one column off under Bun 1.4.4 or newer, as &lt;a href="https://github.com/microsoft/playwright/issues/43934" rel="noopener noreferrer"&gt;issue 43934&lt;/a&gt; describes. Bun is another program that can run your tests. This fix was not executed here, because the demo machine has Bun 1.4.2.&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;If you upgrade this week, I'd go straight to 1.65.1.&lt;/p&gt;

&lt;h2&gt;
  
  
  How the demo ran
&lt;/h2&gt;

&lt;p&gt;Each change has its own small project. All of them ran on &lt;code&gt;@playwright/test&lt;/code&gt; 1.64.1 and 1.65.1. Most also ran on 1.65.0. The setup was Node.js 24, macOS and Chromium only.&lt;/p&gt;

&lt;p&gt;The output blocks are cut to the lines that matter. The pages, servers and names are made up. Your timings will differ.&lt;/p&gt;

&lt;p&gt;To check your own suite, upgrade on a branch and run it:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;npm install -D @playwright/test@1.65.1
npx playwright install --with-deps
npx playwright --version
npx playwright &lt;span class="nb"&gt;test&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Then match any new error to the table at the top. If time is short, I'd check sections 1 to 3 first. Those can stop a suite on its first run.&lt;/p&gt;

&lt;p&gt;&lt;em&gt;I'm Anton. I build AI tools and measure how fast they really run. Former Apple engineer. I make &lt;a href="https://ollamatps.com" rel="noopener noreferrer"&gt;ollamatps.com&lt;/a&gt; and write about building and measuring AI at &lt;a href="https://www.anton.qa" rel="noopener noreferrer"&gt;anton.qa&lt;/a&gt;.&lt;/em&gt;&lt;/p&gt;

</description>
      <category>playwright</category>
      <category>testing</category>
      <category>typescript</category>
      <category>webdev</category>
    </item>
    <item>
      <title>One Playwright test restarts the server. Lock just that test.</title>
      <dc:creator>Anton Gulin</dc:creator>
      <pubDate>Sat, 14 Nov 2026 15:01:04 +0000</pubDate>
      <link>https://dev.to/aiwithanton/one-playwright-test-restarts-the-server-lock-just-that-test-595o</link>
      <guid>https://dev.to/aiwithanton/one-playwright-test-restarts-the-server-lock-just-that-test-595o</guid>
      <description>&lt;p&gt;&lt;em&gt;Originally published on &lt;a href="https://www.anton.qa/blog/posts/playwright-exclusive-test-lock" rel="noopener noreferrer"&gt;anton.qa&lt;/a&gt;.&lt;/em&gt;&lt;/p&gt;

&lt;p&gt;Last week, two tests shared one account and got in each other's way. The fix was to &lt;a href="https://www.anton.qa/blog/posts/parallel-playwright-account-data" rel="noopener noreferrer"&gt;give each test its own data&lt;/a&gt;.&lt;/p&gt;

&lt;p&gt;Some shared things can't be split up like that. One test restarts the test server. Another resets a setting for the whole app. Every test running at that moment feels it.&lt;/p&gt;

&lt;p&gt;The usual fix is to run tests one at a time. That works, but the whole suite gets slower. Playwright 1.65 adds a smaller tool, the built-in &lt;code&gt;-exclusive-&lt;/code&gt; lock:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight javascript"&gt;&lt;code&gt;&lt;span class="nf"&gt;test&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="s1"&gt;'restart the server'&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt; &lt;span class="n"&gt;lock&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="s1"&gt;'-exclusive-'&lt;/span&gt; &lt;span class="p"&gt;}&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="k"&gt;async&lt;/span&gt; &lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt; &lt;span class="o"&gt;=&amp;gt;&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt;
  &lt;span class="c1"&gt;// No other test runs while this one is running.&lt;/span&gt;
&lt;span class="p"&gt;}&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;That snippet comes from the &lt;a href="https://github.com/microsoft/playwright/releases/tag/v1.65.0" rel="noopener noreferrer"&gt;1.65 release notes&lt;/a&gt;. The locked test starts only when no other test is running. No other test starts until it finishes. The rest still run in parallel with each other. The &lt;a href="https://playwright.dev/docs/test-parallel#test-locks" rel="noopener noreferrer"&gt;test-locks docs&lt;/a&gt; describe the details.&lt;/p&gt;

&lt;p&gt;Below is a small demo you can copy. The results come from real runs on Playwright 1.65.0. The server and notes are made up, and everything stays on your machine.&lt;/p&gt;

&lt;h2&gt;
  
  
  A server that forgets on restart
&lt;/h2&gt;

&lt;p&gt;The demo server keeps notes in memory, so a restart wipes them. For 1.5 seconds after a restart, it answers 503. That status means "busy, try again later."&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight javascript"&gt;&lt;code&gt;&lt;span class="c1"&gt;// A tiny notes server. Data lives in memory, so a restart wipes it.&lt;/span&gt;
&lt;span class="k"&gt;import&lt;/span&gt; &lt;span class="n"&gt;http&lt;/span&gt; &lt;span class="k"&gt;from&lt;/span&gt; &lt;span class="s1"&gt;'node:http'&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;

&lt;span class="kd"&gt;let&lt;/span&gt; &lt;span class="n"&gt;notes&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="k"&gt;new&lt;/span&gt; &lt;span class="nb"&gt;Map&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;
&lt;span class="kd"&gt;let&lt;/span&gt; &lt;span class="n"&gt;restartingUntil&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="mi"&gt;0&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;

&lt;span class="n"&gt;http&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;createServer&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;req&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="n"&gt;res&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt; &lt;span class="o"&gt;=&amp;gt;&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt;
  &lt;span class="kd"&gt;const&lt;/span&gt; &lt;span class="n"&gt;url&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="k"&gt;new&lt;/span&gt; &lt;span class="no"&gt;URL&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;req&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="n"&gt;url&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="s1"&gt;'http://localhost'&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;
  &lt;span class="k"&gt;if&lt;/span&gt; &lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="nb"&gt;Date&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;now&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt; &lt;span class="o"&gt;&amp;lt;&lt;/span&gt; &lt;span class="n"&gt;restartingUntil&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt;
    &lt;span class="n"&gt;res&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;writeHead&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="mi"&gt;503&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;end&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="s1"&gt;'restarting'&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;
    &lt;span class="k"&gt;return&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;
  &lt;span class="p"&gt;}&lt;/span&gt;
  &lt;span class="k"&gt;if&lt;/span&gt; &lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;req&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="n"&gt;method&lt;/span&gt; &lt;span class="o"&gt;===&lt;/span&gt; &lt;span class="s1"&gt;'POST'&lt;/span&gt; &lt;span class="o"&gt;&amp;amp;&amp;amp;&lt;/span&gt; &lt;span class="n"&gt;url&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="n"&gt;pathname&lt;/span&gt; &lt;span class="o"&gt;===&lt;/span&gt; &lt;span class="s1"&gt;'/restart'&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt;
    &lt;span class="n"&gt;notes&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="k"&gt;new&lt;/span&gt; &lt;span class="nb"&gt;Map&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;
    &lt;span class="n"&gt;restartingUntil&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="nb"&gt;Date&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;now&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt; &lt;span class="o"&gt;+&lt;/span&gt; &lt;span class="mi"&gt;1500&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;
    &lt;span class="n"&gt;res&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;writeHead&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="mi"&gt;202&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;end&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="s1"&gt;'restarting'&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;
    &lt;span class="k"&gt;return&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;
  &lt;span class="p"&gt;}&lt;/span&gt;
  &lt;span class="kd"&gt;const&lt;/span&gt; &lt;span class="n"&gt;id&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="n"&gt;url&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="n"&gt;pathname&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;slice&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="s1"&gt;'/notes/'&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="n"&gt;length&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;
  &lt;span class="k"&gt;if&lt;/span&gt; &lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;req&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="n"&gt;method&lt;/span&gt; &lt;span class="o"&gt;===&lt;/span&gt; &lt;span class="s1"&gt;'PUT'&lt;/span&gt; &lt;span class="o"&gt;&amp;amp;&amp;amp;&lt;/span&gt; &lt;span class="n"&gt;url&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="n"&gt;pathname&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;startsWith&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="s1"&gt;'/notes/'&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt;
    &lt;span class="n"&gt;notes&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;set&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;id&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="s1"&gt;'saved'&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;
    &lt;span class="n"&gt;res&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;writeHead&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="mi"&gt;201&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;end&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="s1"&gt;'saved'&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;
    &lt;span class="k"&gt;return&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;
  &lt;span class="p"&gt;}&lt;/span&gt;
  &lt;span class="k"&gt;if&lt;/span&gt; &lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;req&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="n"&gt;method&lt;/span&gt; &lt;span class="o"&gt;===&lt;/span&gt; &lt;span class="s1"&gt;'GET'&lt;/span&gt; &lt;span class="o"&gt;&amp;amp;&amp;amp;&lt;/span&gt; &lt;span class="n"&gt;url&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="n"&gt;pathname&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;startsWith&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="s1"&gt;'/notes/'&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt;
    &lt;span class="n"&gt;res&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;writeHead&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;notes&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;has&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;id&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt; &lt;span class="o"&gt;?&lt;/span&gt; &lt;span class="mi"&gt;200&lt;/span&gt; &lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="mi"&gt;404&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;end&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;notes&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;get&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;id&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt; &lt;span class="o"&gt;??&lt;/span&gt; &lt;span class="s1"&gt;'missing'&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;
    &lt;span class="k"&gt;return&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;
  &lt;span class="p"&gt;}&lt;/span&gt;
  &lt;span class="n"&gt;res&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;writeHead&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;url&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="n"&gt;pathname&lt;/span&gt; &lt;span class="o"&gt;===&lt;/span&gt; &lt;span class="s1"&gt;'/health'&lt;/span&gt; &lt;span class="o"&gt;?&lt;/span&gt; &lt;span class="mi"&gt;200&lt;/span&gt; &lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="mi"&gt;404&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;end&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;
&lt;span class="p"&gt;}&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;listen&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="mi"&gt;3123&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Save it as &lt;code&gt;server.mjs&lt;/code&gt;. Next come the tests. Six tests each save a note, wait one second, then read it back. The wait stands in for real page work. The seventh test restarts the server and waits until it answers again.&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight javascript"&gt;&lt;code&gt;&lt;span class="k"&gt;import&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt; &lt;span class="n"&gt;test&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="n"&gt;expect&lt;/span&gt; &lt;span class="p"&gt;}&lt;/span&gt; &lt;span class="k"&gt;from&lt;/span&gt; &lt;span class="s1"&gt;'@playwright/test'&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;

&lt;span class="kd"&gt;function&lt;/span&gt; &lt;span class="nf"&gt;noteTest&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;name&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt;
  &lt;span class="nf"&gt;test&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="sb"&gt;`save note ${name}`&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="k"&gt;async&lt;/span&gt; &lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="p"&gt;{&lt;/span&gt; &lt;span class="n"&gt;request&lt;/span&gt; &lt;span class="p"&gt;}&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt; &lt;span class="o"&gt;=&amp;gt;&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt;
    &lt;span class="nf"&gt;expect&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="k"&gt;await&lt;/span&gt; &lt;span class="n"&gt;request&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;put&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="sb"&gt;`/notes/${name}`&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;status&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;toBe&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="mi"&gt;201&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;
    &lt;span class="k"&gt;await&lt;/span&gt; &lt;span class="k"&gt;new&lt;/span&gt; &lt;span class="nb"&gt;Promise&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;resolve&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt; &lt;span class="o"&gt;=&amp;gt;&lt;/span&gt; &lt;span class="nb"&gt;setTimeout&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;resolve&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="mi"&gt;1000&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;
    &lt;span class="nf"&gt;expect&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="k"&gt;await&lt;/span&gt; &lt;span class="n"&gt;request&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;get&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="sb"&gt;`/notes/${name}`&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;status&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;toBe&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="mi"&gt;200&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;
  &lt;span class="p"&gt;}&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;
&lt;span class="p"&gt;}&lt;/span&gt;

&lt;span class="nf"&gt;noteTest&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="s1"&gt;'a'&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;
&lt;span class="nf"&gt;noteTest&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="s1"&gt;'b'&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;
&lt;span class="nf"&gt;noteTest&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="s1"&gt;'c'&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;

&lt;span class="nf"&gt;test&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="s1"&gt;'restart the server'&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt; &lt;span class="n"&gt;lock&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="s1"&gt;'-exclusive-'&lt;/span&gt; &lt;span class="p"&gt;}&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="k"&gt;async&lt;/span&gt; &lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="p"&gt;{&lt;/span&gt; &lt;span class="n"&gt;request&lt;/span&gt; &lt;span class="p"&gt;}&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt; &lt;span class="o"&gt;=&amp;gt;&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt;
  &lt;span class="nf"&gt;expect&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="k"&gt;await&lt;/span&gt; &lt;span class="n"&gt;request&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;post&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="s1"&gt;'/restart'&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;status&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;toBe&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="mi"&gt;202&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;
  &lt;span class="k"&gt;await&lt;/span&gt; &lt;span class="n"&gt;expect&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;poll&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="k"&gt;async&lt;/span&gt; &lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt; &lt;span class="o"&gt;=&amp;gt;&lt;/span&gt; &lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="k"&gt;await&lt;/span&gt; &lt;span class="n"&gt;request&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;get&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="s1"&gt;'/health'&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;status&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt;
    &lt;span class="n"&gt;timeout&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="mi"&gt;5000&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;
  &lt;span class="p"&gt;}&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;toBe&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="mi"&gt;200&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;
&lt;span class="p"&gt;}&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;

&lt;span class="nf"&gt;noteTest&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="s1"&gt;'d'&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;
&lt;span class="nf"&gt;noteTest&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="s1"&gt;'e'&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;
&lt;span class="nf"&gt;noteTest&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="s1"&gt;'f'&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Save it as &lt;code&gt;tests/notes.spec.mjs&lt;/code&gt;. &lt;code&gt;expect.poll&lt;/code&gt; keeps asking for the status until it gets 200, meaning OK. The tests use Playwright's &lt;code&gt;request&lt;/code&gt; fixture, a built-in HTTP client. So this demo needs no browser.&lt;/p&gt;

&lt;p&gt;The config runs three workers, meaning three test processes at once:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight javascript"&gt;&lt;code&gt;&lt;span class="k"&gt;import&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt; &lt;span class="n"&gt;defineConfig&lt;/span&gt; &lt;span class="p"&gt;}&lt;/span&gt; &lt;span class="k"&gt;from&lt;/span&gt; &lt;span class="s1"&gt;'@playwright/test'&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;

&lt;span class="k"&gt;export&lt;/span&gt; &lt;span class="k"&gt;default&lt;/span&gt; &lt;span class="nf"&gt;defineConfig&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="p"&gt;{&lt;/span&gt;
  &lt;span class="n"&gt;testDir&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="s1"&gt;'./tests'&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;
  &lt;span class="n"&gt;fullyParallel&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="kc"&gt;true&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;
  &lt;span class="n"&gt;workers&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="mi"&gt;3&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;
  &lt;span class="n"&gt;retries&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="mi"&gt;0&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;
  &lt;span class="n"&gt;reporter&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="p"&gt;[&lt;/span&gt;&lt;span class="p"&gt;[&lt;/span&gt;&lt;span class="s1"&gt;'list'&lt;/span&gt;&lt;span class="p"&gt;]&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="p"&gt;[&lt;/span&gt;&lt;span class="s1"&gt;'json'&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt; &lt;span class="n"&gt;outputFile&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="nb"&gt;process&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="n"&gt;env&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="no"&gt;REPORT&lt;/span&gt; &lt;span class="o"&gt;||&lt;/span&gt; &lt;span class="s1"&gt;'report.json'&lt;/span&gt; &lt;span class="p"&gt;}&lt;/span&gt;&lt;span class="p"&gt;]&lt;/span&gt;&lt;span class="p"&gt;]&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;
  &lt;span class="n"&gt;use&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt; &lt;span class="n"&gt;baseURL&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="s1"&gt;'http://localhost:3123'&lt;/span&gt; &lt;span class="p"&gt;}&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;
  &lt;span class="n"&gt;webServer&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt;
    &lt;span class="n"&gt;command&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="s1"&gt;'node server.mjs'&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;
    &lt;span class="n"&gt;url&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="s1"&gt;'http://localhost:3123/health'&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;
    &lt;span class="n"&gt;reuseExistingServer&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="kc"&gt;false&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;
  &lt;span class="p"&gt;}&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;
&lt;span class="p"&gt;}&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Save it as &lt;code&gt;playwright.config.mjs&lt;/code&gt;. &lt;code&gt;fullyParallel: true&lt;/code&gt; lets each test run on its own, even inside one file. That setting matters for the lock, as you'll see below. &lt;code&gt;webServer&lt;/code&gt; starts the notes server before the tests begin.&lt;/p&gt;

&lt;p&gt;The JSON reporter saves each test's start time and duration. The timelines below come from those reports. Times are seconds from the first test's start.&lt;/p&gt;

&lt;h2&gt;
  
  
  Without the lock, three tests fail
&lt;/h2&gt;

&lt;p&gt;First, the same file without &lt;code&gt;{ lock: '-exclusive-' }&lt;/code&gt;. Three runs ended the same way. Notes d, e and f failed, and 4 passed. In the first run, two failures looked like this:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;Expected: 200
Received: 503
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;The third expected 201, the "saved" status, and also got 503. Depending on timing, a note's save or its read-back gets the 503. So your error lines may differ. Here's the first run:&lt;/p&gt;

&lt;div class="table-wrapper-paragraph"&gt;&lt;table&gt;
&lt;thead&gt;
&lt;tr&gt;
&lt;th&gt;Test&lt;/th&gt;
&lt;th&gt;Start&lt;/th&gt;
&lt;th&gt;End&lt;/th&gt;
&lt;th&gt;Result&lt;/th&gt;
&lt;/tr&gt;
&lt;/thead&gt;
&lt;tbody&gt;
&lt;tr&gt;
&lt;td&gt;save note a&lt;/td&gt;
&lt;td&gt;0.00&lt;/td&gt;
&lt;td&gt;1.05&lt;/td&gt;
&lt;td&gt;Passed&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;save note b&lt;/td&gt;
&lt;td&gt;0.00&lt;/td&gt;
&lt;td&gt;1.05&lt;/td&gt;
&lt;td&gt;Passed&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;save note c&lt;/td&gt;
&lt;td&gt;0.00&lt;/td&gt;
&lt;td&gt;1.05&lt;/td&gt;
&lt;td&gt;Passed&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;restart the server&lt;/td&gt;
&lt;td&gt;1.08&lt;/td&gt;
&lt;td&gt;2.96&lt;/td&gt;
&lt;td&gt;Passed&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;save note d&lt;/td&gt;
&lt;td&gt;1.08&lt;/td&gt;
&lt;td&gt;2.09&lt;/td&gt;
&lt;td&gt;Failed&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;save note e&lt;/td&gt;
&lt;td&gt;1.08&lt;/td&gt;
&lt;td&gt;2.09&lt;/td&gt;
&lt;td&gt;Failed&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;save note f&lt;/td&gt;
&lt;td&gt;2.36&lt;/td&gt;
&lt;td&gt;2.39&lt;/td&gt;
&lt;td&gt;Failed&lt;/td&gt;
&lt;/tr&gt;
&lt;/tbody&gt;
&lt;/table&gt;&lt;/div&gt;

&lt;p&gt;The restart started next to notes d and e. In this run, it wiped their notes, then answered 503 when they read back. Note f started during the busy window, so its save got 503 right away.&lt;/p&gt;

&lt;p&gt;Look at which test passed, though. The restart did its job. The failures showed up in three tests that did nothing wrong. In a real suite, that looks like random failures in the wrong place.&lt;/p&gt;

&lt;h2&gt;
  
  
  With the lock, the restart waits its turn
&lt;/h2&gt;

&lt;p&gt;Put &lt;code&gt;{ lock: '-exclusive-' }&lt;/code&gt; back on the restart test. All three runs passed: 7 passed (4.4s).&lt;/p&gt;

&lt;div class="table-wrapper-paragraph"&gt;&lt;table&gt;
&lt;thead&gt;
&lt;tr&gt;
&lt;th&gt;Test&lt;/th&gt;
&lt;th&gt;Start&lt;/th&gt;
&lt;th&gt;End&lt;/th&gt;
&lt;th&gt;Result&lt;/th&gt;
&lt;/tr&gt;
&lt;/thead&gt;
&lt;tbody&gt;
&lt;tr&gt;
&lt;td&gt;save note a&lt;/td&gt;
&lt;td&gt;0.00&lt;/td&gt;
&lt;td&gt;1.05&lt;/td&gt;
&lt;td&gt;Passed&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;save note b&lt;/td&gt;
&lt;td&gt;0.00&lt;/td&gt;
&lt;td&gt;1.04&lt;/td&gt;
&lt;td&gt;Passed&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;save note c&lt;/td&gt;
&lt;td&gt;0.00&lt;/td&gt;
&lt;td&gt;1.04&lt;/td&gt;
&lt;td&gt;Passed&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;save note d&lt;/td&gt;
&lt;td&gt;1.07&lt;/td&gt;
&lt;td&gt;2.09&lt;/td&gt;
&lt;td&gt;Passed&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;save note e&lt;/td&gt;
&lt;td&gt;1.07&lt;/td&gt;
&lt;td&gt;2.09&lt;/td&gt;
&lt;td&gt;Passed&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;save note f&lt;/td&gt;
&lt;td&gt;1.07&lt;/td&gt;
&lt;td&gt;2.09&lt;/td&gt;
&lt;td&gt;Passed&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;restart the server&lt;/td&gt;
&lt;td&gt;2.10&lt;/td&gt;
&lt;td&gt;3.99&lt;/td&gt;
&lt;td&gt;Passed&lt;/td&gt;
&lt;/tr&gt;
&lt;/tbody&gt;
&lt;/table&gt;&lt;/div&gt;

&lt;p&gt;The restart ran alone, from 2.10 to 3.99 seconds. No other test overlapped it.&lt;/p&gt;

&lt;p&gt;It's the fourth test in the file, but it ran last. Each time a worker freed up, Playwright started another note test instead. The restart waited until nothing else was running.&lt;/p&gt;

&lt;p&gt;One more run moved the restart to the top of the file. Then it ran first, alone, from 0.00 to 1.91 seconds. The six note tests followed in parallel.&lt;/p&gt;

&lt;p&gt;So the lock decides "alone," not "when." The docs promise only that it starts when nothing else runs. If other tests need a fresh server first, the lock won't arrange that.&lt;/p&gt;

&lt;h2&gt;
  
  
  The lock needs tests that run on their own
&lt;/h2&gt;

&lt;p&gt;The test-locks docs add one important note. In default and serial modes, a file's tests run in one worker, one by one. So a lock on any test is held for the whole file.&lt;/p&gt;

&lt;p&gt;Without &lt;code&gt;fullyParallel&lt;/code&gt;, Playwright's default gives each file to one worker. Two files show what that means. One file holds notes a and b plus the locked restart. A second file holds notes x and y.&lt;/p&gt;

&lt;div class="table-wrapper-paragraph"&gt;&lt;table&gt;
&lt;thead&gt;
&lt;tr&gt;
&lt;th&gt;Setting&lt;/th&gt;
&lt;th&gt;What happened&lt;/th&gt;
&lt;th&gt;Run time&lt;/th&gt;
&lt;/tr&gt;
&lt;/thead&gt;
&lt;tbody&gt;
&lt;tr&gt;
&lt;td&gt;Default mode, no lock&lt;/td&gt;
&lt;td&gt;The two files ran side by side&lt;/td&gt;
&lt;td&gt;4.4s&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;Default mode, with the lock&lt;/td&gt;
&lt;td&gt;All five tests ran one after another, in one worker&lt;/td&gt;
&lt;td&gt;6.4s&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;Default mode, lock, file set to parallel&lt;/td&gt;
&lt;td&gt;The notes ran first, then the restart alone&lt;/td&gt;
&lt;td&gt;4.4s&lt;/td&gt;
&lt;/tr&gt;
&lt;/tbody&gt;
&lt;/table&gt;&lt;/div&gt;

&lt;p&gt;In default mode, the lock made its whole file exclusive. Notes a and b also ran with nothing beside them. To lock only the one test, set &lt;code&gt;fullyParallel: true&lt;/code&gt; in the config. Or add this line to that one file:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight javascript"&gt;&lt;code&gt;&lt;span class="n"&gt;test&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="n"&gt;describe&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;configure&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="p"&gt;{&lt;/span&gt; &lt;span class="n"&gt;mode&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="s1"&gt;'parallel'&lt;/span&gt; &lt;span class="p"&gt;}&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;h2&gt;
  
  
  Serial mode is a different tool
&lt;/h2&gt;

&lt;p&gt;&lt;code&gt;test.describe.configure({ mode: 'serial' })&lt;/code&gt; runs a file's tests in order, in one worker. If one fails, the tests after it are skipped. It's meant for tests that depend on each other. The &lt;a href="https://playwright.dev/docs/test-parallel#serial-mode" rel="noopener noreferrer"&gt;Playwright docs&lt;/a&gt; don't recommend it.&lt;/p&gt;

&lt;p&gt;Serial mode also doesn't pause other files. In one run, the restart sat in a serial file with no lock. Notes x and y, in another file, ran during the restart. Both received 503, so 2 failed and 2 passed.&lt;/p&gt;

&lt;h2&gt;
  
  
  Retries and shards
&lt;/h2&gt;

&lt;p&gt;A retry is a second try after a failure. In a retry run with nine notes, the restart failed its first try on purpose. One retry was allowed. That first try ran alone, after all nine notes. The retry also ran alone, on a fresh worker. Playwright marked the test flaky, meaning it failed, then passed. A passing retry still deserves a look, as &lt;a href="https://www.anton.qa/blog/posts/test-retries-hide-real-bugs" rel="noopener noreferrer"&gt;this post on retries&lt;/a&gt; explains.&lt;/p&gt;

&lt;p&gt;Sharding splits a suite across machines, with flags like &lt;code&gt;--shard=1/2&lt;/code&gt;. Each shard is its own Playwright run. The docs say locks work across files, workers and projects. Shards are separate runs, and in this test they didn't wait for each other.&lt;/p&gt;

&lt;p&gt;Two shards started together on one machine, sharing one server. Shard 1 ran the locked restart first, alone within its own run. Shard 2 had three note tests. They ran at the same moment. All three received 503 and failed.&lt;/p&gt;

&lt;p&gt;If your shards share a test server, the lock can't protect it. Give each shard its own server. Or run the restart in its own CI job, a separate build step.&lt;/p&gt;

&lt;h2&gt;
  
  
  Named locks, for a few tests
&lt;/h2&gt;

&lt;p&gt;&lt;a href="https://github.com/microsoft/playwright/releases/tag/v1.63.0" rel="noopener noreferrer"&gt;Playwright 1.63&lt;/a&gt; added named locks. Tests that share a lock name never run at the same time. Everything else keeps running in parallel.&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight javascript"&gt;&lt;code&gt;&lt;span class="nf"&gt;test&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="s1"&gt;'update user settings'&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt; &lt;span class="n"&gt;lock&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="s1"&gt;'user-settings'&lt;/span&gt; &lt;span class="p"&gt;}&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="k"&gt;async&lt;/span&gt; &lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="p"&gt;{&lt;/span&gt; &lt;span class="n"&gt;page&lt;/span&gt; &lt;span class="p"&gt;}&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt; &lt;span class="o"&gt;=&amp;gt;&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt;
  &lt;span class="c1"&gt;// never runs at the same time as other tests holding 'user-settings'&lt;/span&gt;
&lt;span class="p"&gt;}&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;A test can hold several locks, like &lt;code&gt;lock: ['database', 'external-api']&lt;/code&gt;. It runs only when all of them are free. Since 1.64, &lt;code&gt;test.describe.configure({ lock: 'user-settings' })&lt;/code&gt; adds a lock to a whole file or group. Locks work across files, workers and projects. A project is a named group of settings in your config.&lt;/p&gt;

&lt;p&gt;I'd pick a named lock when only a few tests touch the shared thing. The docs suggest &lt;code&gt;-exclusive-&lt;/code&gt; for tests that break if anything else runs. A server restart or a speed measurement fits that.&lt;/p&gt;

&lt;h2&gt;
  
  
  When I wouldn't use it
&lt;/h2&gt;

&lt;ul&gt;
&lt;li&gt;
&lt;strong&gt;The data can be separated.&lt;/strong&gt; Last week's fix keeps each test independent, and nothing has to wait.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Many tests need it.&lt;/strong&gt; Nothing else runs during a locked test. In the demo, that meant 1.9 seconds with one test running.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Shards or separate jobs share the resource.&lt;/strong&gt; The lock only sees its own run.&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;Here's how I'd choose. For one or two tests that restart or reset things, I'd use the lock. For a bigger group with its own setup, I'd move them to a separate project. &lt;a href="https://playwright.dev/docs/test-projects#dependencies" rel="noopener noreferrer"&gt;Project dependencies&lt;/a&gt; can make that project run after the main tests.&lt;/p&gt;

&lt;h2&gt;
  
  
  Try it
&lt;/h2&gt;

&lt;p&gt;The demo ran on Node.js 24. Playwright 1.65 supports Node.js 22, 24 and 26. Make a folder with the three files from this article:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;server.mjs
playwright.config.mjs
tests/notes.spec.mjs
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Then install Playwright and run the tests:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;npm init -y
npm install --save-exact @playwright/test@1.65.0
npx playwright &lt;span class="nb"&gt;test&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;With the lock, you should see 7 passed. Delete &lt;code&gt;{ lock: '-exclusive-' },&lt;/code&gt; from the restart test and run again. You should see the three failures. Each run also writes &lt;code&gt;report.json&lt;/code&gt;, with every test's start time and duration.&lt;/p&gt;

&lt;p&gt;Exact seconds will differ on your machine. The demo's waits are set by hand so the overlap happens every time. It shows how a restart hits nearby tests. It doesn't measure how often that happens.&lt;/p&gt;

&lt;p&gt;Lock the one test that changes things for everyone. Let the rest keep their speed.&lt;/p&gt;

&lt;p&gt;&lt;em&gt;I'm Anton. I build AI tools and measure how fast they really run. Former Apple engineer. I make &lt;a href="https://ollamatps.com" rel="noopener noreferrer"&gt;ollamatps.com&lt;/a&gt; and write about building and measuring AI at &lt;a href="https://www.anton.qa" rel="noopener noreferrer"&gt;anton.qa&lt;/a&gt;.&lt;/em&gt;&lt;/p&gt;

</description>
      <category>playwright</category>
      <category>testing</category>
      <category>javascript</category>
      <category>webdev</category>
    </item>
    <item>
      <title>Two Playwright tests, one account. Keep their data separate.</title>
      <dc:creator>Anton Gulin</dc:creator>
      <pubDate>Sat, 07 Nov 2026 16:01:13 +0000</pubDate>
      <link>https://dev.to/aiwithanton/two-playwright-tests-one-account-keep-their-data-separate-29dd</link>
      <guid>https://dev.to/aiwithanton/two-playwright-tests-one-account-keep-their-data-separate-29dd</guid>
      <description>&lt;p&gt;&lt;em&gt;Originally published on &lt;a href="https://www.anton.qa/blog/posts/parallel-playwright-account-data" rel="noopener noreferrer"&gt;anton.qa&lt;/a&gt;.&lt;/em&gt;&lt;/p&gt;

&lt;p&gt;One test expects Email alerts On. After reloading, it sees Off.&lt;/p&gt;

&lt;p&gt;In this Playwright demo, one test checks the Email alerts setting. Another test changes it. Run either test alone, and it passes. Run them together against one account, and the reader fails.&lt;/p&gt;

&lt;p&gt;Both tests still have their own browser storage. The writer saved Off to the account they share.&lt;/p&gt;

&lt;p&gt;These are real test results from a local app with made-up accounts. The demo deliberately places the save before the reader's reload. It shows how interference happens, without measuring how often it happens naturally.&lt;/p&gt;

&lt;h2&gt;
  
  
  Follow the setting
&lt;/h2&gt;

&lt;p&gt;Both tests begin with Email alerts set to On. The reader loads the setting, then waits while the writer changes it.&lt;/p&gt;

&lt;p&gt;The writer selects Off, clicks Save, and reloads. It sees Off, so its check passes. The reader then reloads the same account and receives that saved value.&lt;/p&gt;

&lt;p&gt;The shared run reports this mismatch:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;Expected: "On"
Received: "Off"
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;That excerpt comes from the reader's value assertion in the checked shared run. The writer passed. The reader failed because its account no longer had the expected setting.&lt;/p&gt;

&lt;p&gt;Give the writer and reader different accounts, and both tests pass. The writer reloads Off. The reader reloads On. The test steps and save order stay the same.&lt;/p&gt;

&lt;h2&gt;
  
  
  Try the four runs
&lt;/h2&gt;

&lt;p&gt;Get the &lt;a href="https://github.com/antongulin/anton-qa-resources/tree/main/posts/parallel-playwright-account-data" rel="noopener noreferrer"&gt;public example&lt;/a&gt; and open its &lt;code&gt;posts/parallel-playwright-account-data&lt;/code&gt; directory in a terminal. The verified setup used Node 26.13.0, npm 11.20.0, and Playwright 1.64.1.&lt;/p&gt;

&lt;p&gt;Install the dependencies and Chromium browser, then check the demo runner:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;npm ci
npx playwright &lt;span class="nb"&gt;install &lt;/span&gt;chromium
npm run &lt;span class="nb"&gt;test&lt;/span&gt;:guards
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;These checks verify how the runner recognizes results and cleans up afterward. All 45 passed in the verified run.&lt;/p&gt;

&lt;p&gt;On Linux, use this browser-install command instead:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;npx playwright &lt;span class="nb"&gt;install&lt;/span&gt; &lt;span class="nt"&gt;--with-deps&lt;/span&gt; chromium
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Installation needs network access and may need permission to install system libraries. The demonstration itself stays on your machine and uses made-up accounts. It sends no emails.&lt;/p&gt;

&lt;p&gt;Run each command separately, checking its result before starting the next:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;npm run demo &lt;span class="nt"&gt;--&lt;/span&gt; writer-alone
npm run demo &lt;span class="nt"&gt;--&lt;/span&gt; reader-alone
npm run demo &lt;span class="nt"&gt;--&lt;/span&gt; shared
npm run demo &lt;span class="nt"&gt;--&lt;/span&gt; separate
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Each command starts a fresh server with the setting back at On. You don't need to start the app separately.&lt;/p&gt;

&lt;div class="table-wrapper-paragraph"&gt;&lt;table&gt;
&lt;thead&gt;
&lt;tr&gt;
&lt;th&gt;Run&lt;/th&gt;
&lt;th&gt;Observed result&lt;/th&gt;
&lt;th&gt;Exit code&lt;/th&gt;
&lt;/tr&gt;
&lt;/thead&gt;
&lt;tbody&gt;
&lt;tr&gt;
&lt;td&gt;Writer alone&lt;/td&gt;
&lt;td&gt;Saves Off and reads Off after reload&lt;/td&gt;
&lt;td&gt;0&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;Reader alone&lt;/td&gt;
&lt;td&gt;Reads On after reload&lt;/td&gt;
&lt;td&gt;0&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;Together, shared account&lt;/td&gt;
&lt;td&gt;Writer passes. Reader expects On and receives Off&lt;/td&gt;
&lt;td&gt;1&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;Together, separate accounts&lt;/td&gt;
&lt;td&gt;Writer reads Off. Reader reads On. Both pass&lt;/td&gt;
&lt;td&gt;0&lt;/td&gt;
&lt;/tr&gt;
&lt;/tbody&gt;
&lt;/table&gt;&lt;/div&gt;

&lt;p&gt;The shared command intentionally exits with code 1. Keep that failure visible when trying the example. A setup problem or an unrecognized result exits with code 2.&lt;/p&gt;

&lt;p&gt;For the combined verification, run:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;npm run verify
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;This runs the guards and six fresh scenarios, including a repeated shared/separate pair. The six scenarios produce eight passes and two reader failures. The command exits 0 only after confirming those exact expected results.&lt;/p&gt;

&lt;p&gt;Each scenario prints an &lt;code&gt;artifacts/&lt;/code&gt; directory containing its report, observations and server events. Those files let you inspect the values and save order.&lt;/p&gt;

&lt;h2&gt;
  
  
  What separate browsers protect
&lt;/h2&gt;

&lt;p&gt;A browser context keeps a test's browser state separate. Cookies and localStorage belong to that context. The &lt;a href="https://playwright.dev/docs/browser-contexts" rel="noopener noreferrer"&gt;Playwright isolation guide&lt;/a&gt; explains this boundary.&lt;/p&gt;

&lt;p&gt;The example checks localStorage, a store inside the browser. Both tests use the key &lt;code&gt;context-probe&lt;/code&gt;. The writer stores &lt;code&gt;writer&lt;/code&gt;, and the reader stores &lt;code&gt;reader&lt;/code&gt;. Each still reads its own value after the account change.&lt;/p&gt;

&lt;p&gt;The reader's two checks appear together in &lt;code&gt;tests/accounts.spec.js&lt;/code&gt;:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight javascript"&gt;&lt;code&gt;  &lt;span class="nf"&gt;expect&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="nx"&gt;observation&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nx"&gt;probe&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="dl"&gt;'&lt;/span&gt;&lt;span class="s1"&gt;Reader context keeps its own storage&lt;/span&gt;&lt;span class="dl"&gt;'&lt;/span&gt;&lt;span class="p"&gt;).&lt;/span&gt;&lt;span class="nf"&gt;toBe&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="dl"&gt;'&lt;/span&gt;&lt;span class="s1"&gt;reader&lt;/span&gt;&lt;span class="dl"&gt;'&lt;/span&gt;&lt;span class="p"&gt;);&lt;/span&gt;
  &lt;span class="nf"&gt;expect&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="nx"&gt;observation&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nx"&gt;value&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="dl"&gt;'&lt;/span&gt;&lt;span class="s1"&gt;Reader account remains On after reload&lt;/span&gt;&lt;span class="dl"&gt;'&lt;/span&gt;&lt;span class="p"&gt;).&lt;/span&gt;&lt;span class="nf"&gt;toBe&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="dl"&gt;'&lt;/span&gt;&lt;span class="s1"&gt;On&lt;/span&gt;&lt;span class="dl"&gt;'&lt;/span&gt;&lt;span class="p"&gt;);&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;The storage check passes in the shared run. The account-value check fails.&lt;/p&gt;

&lt;p&gt;Email alerts lives on the server, outside those browser contexts. Both requests select the same account, so both see its saved setting. Opening a fresh context doesn't create a new server account.&lt;/p&gt;

&lt;p&gt;Here, a cookie holds a made-up account name for the server to select. It demonstrates account selection without implementing production sign-in or using real credentials.&lt;/p&gt;

&lt;h2&gt;
  
  
  Separate the data each test changes
&lt;/h2&gt;

&lt;p&gt;The two paired modes use these entries from &lt;code&gt;verify.mjs&lt;/code&gt;:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight javascript"&gt;&lt;code&gt;  &lt;span class="nx"&gt;shared&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt; &lt;span class="nl"&gt;writer&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="dl"&gt;'&lt;/span&gt;&lt;span class="s1"&gt;demo-shared&lt;/span&gt;&lt;span class="dl"&gt;'&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="nx"&gt;reader&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="dl"&gt;'&lt;/span&gt;&lt;span class="s1"&gt;demo-shared&lt;/span&gt;&lt;span class="dl"&gt;'&lt;/span&gt; &lt;span class="p"&gt;},&lt;/span&gt;
  &lt;span class="nx"&gt;separate&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt; &lt;span class="nl"&gt;writer&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="dl"&gt;'&lt;/span&gt;&lt;span class="s1"&gt;demo-writer&lt;/span&gt;&lt;span class="dl"&gt;'&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="nx"&gt;reader&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="dl"&gt;'&lt;/span&gt;&lt;span class="s1"&gt;demo-reader&lt;/span&gt;&lt;span class="dl"&gt;'&lt;/span&gt; &lt;span class="p"&gt;},&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Only the account assignment changes. Both modes use two workers, meaning two processes running the tests. Both keep separate browser contexts and zero retries.&lt;/p&gt;

&lt;p&gt;For an account-wide setting such as Email alerts, separate accounts fit the change. &lt;a href="https://playwright.dev/docs/auth" rel="noopener noreferrer"&gt;Playwright's authentication guide&lt;/a&gt; describes one account per parallel worker. Tests reusing that account still need a known starting state.&lt;/p&gt;

&lt;p&gt;For tests editing different records, give each test records it alone owns. The &lt;a href="https://playwright.dev/docs/test-parallel" rel="noopener noreferrer"&gt;parallelism guide&lt;/a&gt; describes this approach. Separate accounts won't help if both tests still edit the same shared record.&lt;/p&gt;

&lt;p&gt;I'd also keep account pools separate between simultaneous suite runs. Otherwise, two runs could assign the same account to different writers. Reset changed data before another test needs its starting value.&lt;/p&gt;

&lt;h2&gt;
  
  
  A shared account can still make sense
&lt;/h2&gt;

&lt;p&gt;Sharing an account can suit tests that read data without interfering with one another. Their setup must also leave the other tests' data unchanged. Playwright's authentication guide explicitly supports that choice.&lt;/p&gt;

&lt;p&gt;I'd choose the account arrangement around what each test can change. A page-reading test and an account-settings test need different protection when they share an account.&lt;/p&gt;

&lt;h2&gt;
  
  
  Keep the demonstration's limits
&lt;/h2&gt;

&lt;p&gt;The example uses explicit waiting points to arrange the save and reload. Those waiting points belong to the demonstration setup. They make the sequence repeatable without measuring random failures.&lt;/p&gt;

&lt;p&gt;The server holds its settings in memory for one scenario. Values survive page reloads, but a new scenario starts fresh. This example doesn't implement a production account pool or persistent database.&lt;/p&gt;

&lt;p&gt;Use the &lt;a href="https://github.com/antongulin/anton-qa-resources/tree/main/posts/parallel-playwright-account-data" rel="noopener noreferrer"&gt;four-run example&lt;/a&gt; to see the boundary before choosing accounts for your tests. The reader can keep On while the writer saves Off, with both tests running together.&lt;/p&gt;

&lt;p&gt;&lt;em&gt;I'm Anton. I build AI tools and measure how fast they really run. Former Apple engineer. I make &lt;a href="https://ollamatps.com" rel="noopener noreferrer"&gt;ollamatps.com&lt;/a&gt; and write about building and measuring AI at &lt;a href="https://www.anton.qa" rel="noopener noreferrer"&gt;anton.qa&lt;/a&gt;.&lt;/em&gt;&lt;/p&gt;

</description>
      <category>playwright</category>
      <category>testing</category>
      <category>javascript</category>
      <category>webdev</category>
    </item>
    <item>
      <title>What should an AI code review read?</title>
      <dc:creator>Anton Gulin</dc:creator>
      <pubDate>Sat, 31 Oct 2026 15:01:03 +0000</pubDate>
      <link>https://dev.to/aiwithanton/what-should-an-ai-code-review-read-20in</link>
      <guid>https://dev.to/aiwithanton/what-should-an-ai-code-review-read-20in</guid>
      <description>&lt;p&gt;Originally published on &lt;a href="https://www.anton.qa/blog/posts/what-should-an-ai-code-review-read" rel="noopener noreferrer"&gt;anton.qa&lt;/a&gt;.&lt;/p&gt;

&lt;p&gt;A reader asked whether more files change a review's verdict. Or do they mostly increase confidence in the same finding?&lt;/p&gt;

&lt;p&gt;Relevant code can reveal a problem the edited lines cannot explain alone. Start with the behavior the change should preserve. Then read the code that depends on it.&lt;/p&gt;

&lt;p&gt;An AI review asks a model to inspect code. This fictional example explains what useful context can add. It is not an AI review experiment.&lt;/p&gt;

&lt;h2&gt;
  
  
  Two parts need different orders
&lt;/h2&gt;

&lt;p&gt;A queue is a waiting list. Our fictional program receives jobs in arrival order.&lt;br&gt;
The runner chooses the next job. It must choose the earliest ready job.&lt;/p&gt;

&lt;p&gt;The screen has a different requirement. It should show ready jobs from shortest to longest.&lt;/p&gt;

&lt;p&gt;These are the exact example inputs:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight javascript"&gt;&lt;code&gt;&lt;span class="kd"&gt;const&lt;/span&gt; &lt;span class="nx"&gt;queue&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="p"&gt;[&lt;/span&gt;
  &lt;span class="p"&gt;{&lt;/span&gt; &lt;span class="na"&gt;id&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="dl"&gt;"&lt;/span&gt;&lt;span class="s2"&gt;J1&lt;/span&gt;&lt;span class="dl"&gt;"&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="na"&gt;ready&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="kc"&gt;false&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="na"&gt;minutes&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="mi"&gt;1&lt;/span&gt; &lt;span class="p"&gt;},&lt;/span&gt;
  &lt;span class="p"&gt;{&lt;/span&gt; &lt;span class="na"&gt;id&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="dl"&gt;"&lt;/span&gt;&lt;span class="s2"&gt;J2&lt;/span&gt;&lt;span class="dl"&gt;"&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="na"&gt;ready&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="kc"&gt;true&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="na"&gt;minutes&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="mi"&gt;10&lt;/span&gt; &lt;span class="p"&gt;},&lt;/span&gt;
  &lt;span class="p"&gt;{&lt;/span&gt; &lt;span class="na"&gt;id&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="dl"&gt;"&lt;/span&gt;&lt;span class="s2"&gt;J3&lt;/span&gt;&lt;span class="dl"&gt;"&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="na"&gt;ready&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="kc"&gt;true&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="na"&gt;minutes&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="mi"&gt;2&lt;/span&gt; &lt;span class="p"&gt;},&lt;/span&gt;
&lt;span class="p"&gt;];&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;J1 arrived first, but it is not ready. J2 arrived before J3, so the runner needs J2.&lt;br&gt;
The screen should show J3 before J2 because J3 has the shorter estimate.&lt;/p&gt;

&lt;p&gt;The example uses unique job IDs and distinct, positive minute estimates. Invalid inputs are outside this small illustration. No job runs here.&lt;/p&gt;
&lt;h2&gt;
  
  
  Start with the shared function
&lt;/h2&gt;

&lt;p&gt;A function holds reusable code. A shared function serves several parts of a program.&lt;br&gt;
A caller is code that uses that function.&lt;/p&gt;

&lt;p&gt;Our three fictional files are &lt;code&gt;ready-jobs.js&lt;/code&gt;, &lt;code&gt;queue-screen.js&lt;/code&gt;, and &lt;code&gt;runner.js&lt;/code&gt;.&lt;br&gt;
The snippets show their relevant parts, without installation or a downloadable project.&lt;/p&gt;

&lt;p&gt;The shared function in &lt;code&gt;ready-jobs.js&lt;/code&gt; keeps ready jobs:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight javascript"&gt;&lt;code&gt;&lt;span class="kd"&gt;function&lt;/span&gt; &lt;span class="nf"&gt;readyJobs&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="nx"&gt;jobs&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt;
  &lt;span class="k"&gt;return&lt;/span&gt; &lt;span class="nx"&gt;jobs&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;filter&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="nx"&gt;job&lt;/span&gt; &lt;span class="o"&gt;=&amp;gt;&lt;/span&gt; &lt;span class="nx"&gt;job&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nx"&gt;ready&lt;/span&gt;&lt;span class="p"&gt;);&lt;/span&gt;
&lt;span class="p"&gt;}&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Here, &lt;code&gt;filter&lt;/code&gt; keeps matching items in their existing order. It returns a new array, meaning a separate list.&lt;br&gt;
The ready-job order is J2, then J3. The original queue stays unchanged.&lt;/p&gt;

&lt;p&gt;The screen currently uses that order in &lt;code&gt;queue-screen.js&lt;/code&gt;:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight javascript"&gt;&lt;code&gt;&lt;span class="kd"&gt;function&lt;/span&gt; &lt;span class="nf"&gt;visibleJobIds&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="nx"&gt;jobs&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt;
  &lt;span class="k"&gt;return&lt;/span&gt; &lt;span class="nf"&gt;readyJobs&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="nx"&gt;jobs&lt;/span&gt;&lt;span class="p"&gt;).&lt;/span&gt;&lt;span class="nf"&gt;map&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="nx"&gt;job&lt;/span&gt; &lt;span class="o"&gt;=&amp;gt;&lt;/span&gt; &lt;span class="nx"&gt;job&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nx"&gt;id&lt;/span&gt;&lt;span class="p"&gt;);&lt;/span&gt;
&lt;span class="p"&gt;}&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Here, &lt;code&gt;map&lt;/code&gt; turns each job into its ID. The screen therefore lists J2 before J3.&lt;br&gt;
It needs the opposite order for this input.&lt;/p&gt;
&lt;h2&gt;
  
  
  A small shared edit changes the order
&lt;/h2&gt;

&lt;p&gt;The requested change is simple: show shorter ready jobs first on the screen.&lt;br&gt;
One possible edit adds sorting to the shared function:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight diff"&gt;&lt;code&gt; function readyJobs(jobs) {
&lt;span class="gd"&gt;-  return jobs.filter(job =&amp;gt; job.ready);
&lt;/span&gt;&lt;span class="gi"&gt;+  return jobs.filter(job =&amp;gt; job.ready)
+    .sort((a, b) =&amp;gt; a.minutes - b.minutes);
&lt;/span&gt; }
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;The comparison puts smaller minute estimates first. The function still returns both ready jobs.&lt;br&gt;
Its new order is J3, then J2.&lt;/p&gt;

&lt;p&gt;That satisfies the screen's requirement. The edited lines alone leave other callers unverified.&lt;br&gt;
We still need to know whether another caller depends on the old order.&lt;/p&gt;
&lt;h2&gt;
  
  
  Read the caller that chooses a job
&lt;/h2&gt;

&lt;p&gt;The relevant code in &lt;code&gt;runner.js&lt;/code&gt; chooses the first item:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight javascript"&gt;&lt;code&gt;&lt;span class="c1"&gt;// jobs arrive in queue order.&lt;/span&gt;
&lt;span class="c1"&gt;// Choose the earliest ready job.&lt;/span&gt;
&lt;span class="kd"&gt;function&lt;/span&gt; &lt;span class="nf"&gt;nextJobId&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="nx"&gt;jobs&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt;
  &lt;span class="k"&gt;return&lt;/span&gt; &lt;span class="nf"&gt;readyJobs&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="nx"&gt;jobs&lt;/span&gt;&lt;span class="p"&gt;)[&lt;/span&gt;&lt;span class="mi"&gt;0&lt;/span&gt;&lt;span class="p"&gt;]?.&lt;/span&gt;&lt;span class="nx"&gt;id&lt;/span&gt; &lt;span class="o"&gt;??&lt;/span&gt; &lt;span class="kc"&gt;null&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;
&lt;span class="p"&gt;}&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;The &lt;code&gt;[0]&lt;/code&gt; reads the first item. The remaining expression returns its ID, or null when no item exists.&lt;/p&gt;

&lt;p&gt;Before the edit, this caller returns J2. After shared sorting, it returns J3.&lt;br&gt;
J2 arrived earlier and was ready. Choosing J3 violates the runner's stated rule.&lt;/p&gt;

&lt;p&gt;The caller makes the ordering change meaningful. We can now name the defect and its consequence.&lt;br&gt;
A list with the same items can still produce different behavior.&lt;/p&gt;
&lt;h2&gt;
  
  
  Keep sorting in the screen
&lt;/h2&gt;

&lt;p&gt;Leave the original shared function unchanged. Sort its returned list inside the screen's caller:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight javascript"&gt;&lt;code&gt;&lt;span class="kd"&gt;function&lt;/span&gt; &lt;span class="nf"&gt;visibleJobIds&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="nx"&gt;jobs&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt;
  &lt;span class="k"&gt;return&lt;/span&gt; &lt;span class="nf"&gt;readyJobs&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="nx"&gt;jobs&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;
    &lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;sort&lt;/span&gt;&lt;span class="p"&gt;((&lt;/span&gt;&lt;span class="nx"&gt;a&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="nx"&gt;b&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt; &lt;span class="o"&gt;=&amp;gt;&lt;/span&gt; &lt;span class="nx"&gt;a&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nx"&gt;minutes&lt;/span&gt; &lt;span class="o"&gt;-&lt;/span&gt; &lt;span class="nx"&gt;b&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nx"&gt;minutes&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;
    &lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;map&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="nx"&gt;job&lt;/span&gt; &lt;span class="o"&gt;=&amp;gt;&lt;/span&gt; &lt;span class="nx"&gt;job&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nx"&gt;id&lt;/span&gt;&lt;span class="p"&gt;);&lt;/span&gt;
&lt;span class="p"&gt;}&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;The screen gets J3, then J2. The runner still gets J2.&lt;br&gt;
Sorting this separate filtered list leaves the input queue unchanged.&lt;/p&gt;

&lt;div class="table-wrapper-paragraph"&gt;&lt;table&gt;
&lt;thead&gt;
&lt;tr&gt;
&lt;th&gt;Version&lt;/th&gt;
&lt;th&gt;Screen order&lt;/th&gt;
&lt;th&gt;Runner chooses&lt;/th&gt;
&lt;/tr&gt;
&lt;/thead&gt;
&lt;tbody&gt;
&lt;tr&gt;
&lt;td&gt;Original&lt;/td&gt;
&lt;td&gt;J2, J3&lt;/td&gt;
&lt;td&gt;J2&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;Sort in shared function&lt;/td&gt;
&lt;td&gt;J3, J2&lt;/td&gt;
&lt;td&gt;J3&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;Sort in screen only&lt;/td&gt;
&lt;td&gt;J3, J2&lt;/td&gt;
&lt;td&gt;J2&lt;/td&gt;
&lt;/tr&gt;
&lt;/tbody&gt;
&lt;/table&gt;&lt;/div&gt;

&lt;p&gt;This correction meets both stated requirements for the supplied input.&lt;br&gt;
Empty input and a list without ready jobs return no selected job.&lt;br&gt;
One ready job remains the runner's choice.&lt;br&gt;
These simple cases do not establish behavior for every possible input.&lt;/p&gt;

&lt;h2&gt;
  
  
  Ask what the extra file explains
&lt;/h2&gt;

&lt;p&gt;The useful question here is whether another caller depends on order.&lt;br&gt;
The runner answers it. Its requirement explains why that dependency matters.&lt;/p&gt;

&lt;p&gt;Relevant context can therefore change a finding. Other context might confirm an assumption and strengthen confidence.&lt;br&gt;
This example cannot tell us how often either happens. It supplies no measured verdict-flip rate.&lt;/p&gt;

&lt;p&gt;There was no earlier AI approval or later AI rejection. The example follows the code's stated behavior.&lt;br&gt;
Reading unrelated files adds no demonstrated benefit here.&lt;/p&gt;

&lt;p&gt;For your next review, pair the changed code with its intended behavior.&lt;br&gt;
Find the callers that use the changed result. Include a focused test when it demonstrates that dependency.&lt;/p&gt;

&lt;p&gt;If a file answers no relevant question, explain why you want it included.&lt;br&gt;
More input alone does not establish a better review.&lt;/p&gt;

&lt;p&gt;One supporting example comes from Robin, my code-review project. &lt;a href="https://github.com/antongulin/robin/releases/tag/v2.12.2" rel="noopener noreferrer"&gt;Version 2.12.2&lt;/a&gt; omits encoded binary payloads, meaning non-text file contents.&lt;br&gt;
This applies only to native fallback patches, Robin's backup lists of file changes.&lt;br&gt;
The later &lt;a href="https://github.com/antongulin/robin/releases/tag/v2.12.3" rel="noopener noreferrer"&gt;v2.12.3&lt;/a&gt; keeps the model's private reasoning details when reusing earlier conversation messages.&lt;br&gt;
That is a different correction. These release notes provide no measurements of speed, cost or review quality.&lt;/p&gt;

&lt;h2&gt;
  
  
  Give the reviewer a specific question
&lt;/h2&gt;

&lt;p&gt;Ask what behavior could change, then read the code that depends on it.&lt;br&gt;
For this example, the question is whether sorting changes the runner's next choice.&lt;br&gt;
The caller provides the missing connection.&lt;/p&gt;

&lt;p&gt;The original reader discussion is &lt;a href="https://www.linkedin.com/feed/update/urn:li:share:7519125521562103808/" rel="noopener noreferrer"&gt;on LinkedIn&lt;/a&gt;.&lt;/p&gt;

&lt;p&gt;&lt;em&gt;I'm Anton. I build AI tools and measure how fast they really run. Former Apple engineer. I make &lt;a href="https://ollamatps.com" rel="noopener noreferrer"&gt;ollamatps.com&lt;/a&gt; and write about building and measuring AI at &lt;a href="https://www.anton.qa" rel="noopener noreferrer"&gt;anton.qa&lt;/a&gt;.&lt;/em&gt;&lt;/p&gt;

</description>
      <category>ai</category>
      <category>testing</category>
      <category>javascript</category>
      <category>codequality</category>
    </item>
    <item>
      <title>Select one cell per row with Playwright’s new shortcut</title>
      <dc:creator>Anton Gulin</dc:creator>
      <pubDate>Sat, 24 Oct 2026 15:02:08 +0000</pubDate>
      <link>https://dev.to/aiwithanton/select-one-cell-per-row-with-playwrights-new-shortcut-2i2g</link>
      <guid>https://dev.to/aiwithanton/select-one-cell-per-row-with-playwrights-new-shortcut-2i2g</guid>
      <description>&lt;p&gt;Originally published at &lt;a href="https://www.anton.qa/blog/posts/playwright-within-table-cells" rel="noopener noreferrer"&gt;anton.qa&lt;/a&gt;.&lt;/p&gt;

&lt;p&gt;Playwright 1.64 adds &lt;code&gt;within()&lt;/code&gt;, a shortcut for selecting inside each chosen row.&lt;br&gt;
A locator (finds page elements) describes which cells or rows to use.&lt;br&gt;
Here, the task is checking one item name from every stock row.&lt;/p&gt;

&lt;p&gt;Use &lt;code&gt;nth(2)&lt;/code&gt; to choose the third matching cell. Counting starts at zero.&lt;br&gt;
With &lt;code&gt;within(rows)&lt;/code&gt;, Playwright makes that choice separately inside each row.&lt;/p&gt;

&lt;p&gt;That helps when your check should include every displayed row.&lt;br&gt;
A table-wide &lt;code&gt;nth(2)&lt;/code&gt; checks just one cell.&lt;/p&gt;
&lt;h2&gt;
  
  
  Run the complete example
&lt;/h2&gt;

&lt;p&gt;The &lt;a href="https://github.com/antongulin/anton-qa-resources/tree/main/posts/playwright-within-table-cells" rel="noopener noreferrer"&gt;public example&lt;/a&gt; contains the table, tests, and setup instructions.&lt;br&gt;
All data is synthetic, meaning made-up sample data.&lt;br&gt;
The tests load local HTML, the page's structure, without application network requests.&lt;/p&gt;

&lt;p&gt;Use Node.js 24, which runs JavaScript locally, and npm, which installs project packages.&lt;br&gt;
The project pins Playwright to 1.64.1.&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;git clone https://github.com/antongulin/anton-qa-resources.git
&lt;span class="nb"&gt;cd &lt;/span&gt;anton-qa-resources/posts/playwright-within-table-cells
npm ci
npx playwright &lt;span class="nb"&gt;install &lt;/span&gt;chromium
npm run verify
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;On Linux, missing browser system packages may require this installation command:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;npx playwright &lt;span class="nb"&gt;install&lt;/span&gt; &lt;span class="nt"&gt;--with-deps&lt;/span&gt; chromium
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Installation creates a local package folder and downloads the Chromium browser.&lt;br&gt;
The runner may also create local test-result files.&lt;/p&gt;
&lt;h2&gt;
  
  
  Start with three rows
&lt;/h2&gt;

&lt;p&gt;The third cell contains the item name:&lt;/p&gt;

&lt;div class="table-wrapper-paragraph"&gt;&lt;table&gt;
&lt;thead&gt;
&lt;tr&gt;
&lt;th&gt;SKU&lt;/th&gt;
&lt;th&gt;Bin&lt;/th&gt;
&lt;th&gt;Item&lt;/th&gt;
&lt;/tr&gt;
&lt;/thead&gt;
&lt;tbody&gt;
&lt;tr&gt;
&lt;td&gt;T-101&lt;/td&gt;
&lt;td&gt;North&lt;/td&gt;
&lt;td&gt;Apricot&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;T-202&lt;/td&gt;
&lt;td&gt;West&lt;/td&gt;
&lt;td&gt;Blueberry&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;T-303&lt;/td&gt;
&lt;td&gt;East&lt;/td&gt;
&lt;td&gt;Coconut&lt;/td&gt;
&lt;/tr&gt;
&lt;/tbody&gt;
&lt;/table&gt;&lt;/div&gt;

&lt;p&gt;SKU means product code. Bin names the stock location.&lt;br&gt;
This is the complete &lt;code&gt;table.html&lt;/code&gt; fixture, the example's page:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight html"&gt;&lt;code&gt;&lt;span class="cp"&gt;&amp;lt;!doctype html&amp;gt;&lt;/span&gt;
&lt;span class="nt"&gt;&amp;lt;html&lt;/span&gt; &lt;span class="na"&gt;lang=&lt;/span&gt;&lt;span class="s"&gt;"en"&lt;/span&gt;&lt;span class="nt"&gt;&amp;gt;&lt;/span&gt;
&lt;span class="nt"&gt;&amp;lt;meta&lt;/span&gt; &lt;span class="na"&gt;charset=&lt;/span&gt;&lt;span class="s"&gt;"utf-8"&lt;/span&gt;&lt;span class="nt"&gt;&amp;gt;&lt;/span&gt;
&lt;span class="nt"&gt;&amp;lt;title&amp;gt;&lt;/span&gt;Synthetic stock table&lt;span class="nt"&gt;&amp;lt;/title&amp;gt;&lt;/span&gt;
&lt;span class="nt"&gt;&amp;lt;table&amp;gt;&lt;/span&gt;
  &lt;span class="nt"&gt;&amp;lt;caption&amp;gt;&lt;/span&gt;Synthetic stock&lt;span class="nt"&gt;&amp;lt;/caption&amp;gt;&lt;/span&gt;
  &lt;span class="nt"&gt;&amp;lt;thead&amp;gt;&lt;/span&gt;
    &lt;span class="nt"&gt;&amp;lt;tr&amp;gt;&amp;lt;th&amp;gt;&lt;/span&gt;SKU&lt;span class="nt"&gt;&amp;lt;/th&amp;gt;&amp;lt;th&amp;gt;&lt;/span&gt;Bin&lt;span class="nt"&gt;&amp;lt;/th&amp;gt;&amp;lt;th&amp;gt;&lt;/span&gt;Item&lt;span class="nt"&gt;&amp;lt;/th&amp;gt;&amp;lt;/tr&amp;gt;&lt;/span&gt;
  &lt;span class="nt"&gt;&amp;lt;/thead&amp;gt;&lt;/span&gt;
  &lt;span class="nt"&gt;&amp;lt;tbody&amp;gt;&lt;/span&gt;
    &lt;span class="nt"&gt;&amp;lt;tr&amp;gt;&amp;lt;td&amp;gt;&lt;/span&gt;T-101&lt;span class="nt"&gt;&amp;lt;/td&amp;gt;&amp;lt;td&amp;gt;&lt;/span&gt;North&lt;span class="nt"&gt;&amp;lt;/td&amp;gt;&amp;lt;td&amp;gt;&lt;/span&gt;Apricot&lt;span class="nt"&gt;&amp;lt;/td&amp;gt;&amp;lt;/tr&amp;gt;&lt;/span&gt;
    &lt;span class="nt"&gt;&amp;lt;tr&amp;gt;&amp;lt;td&amp;gt;&lt;/span&gt;T-202&lt;span class="nt"&gt;&amp;lt;/td&amp;gt;&amp;lt;td&amp;gt;&lt;/span&gt;West&lt;span class="nt"&gt;&amp;lt;/td&amp;gt;&amp;lt;td&amp;gt;&lt;/span&gt;Blueberry&lt;span class="nt"&gt;&amp;lt;/td&amp;gt;&amp;lt;/tr&amp;gt;&lt;/span&gt;
    &lt;span class="nt"&gt;&amp;lt;tr&amp;gt;&amp;lt;td&amp;gt;&lt;/span&gt;T-303&lt;span class="nt"&gt;&amp;lt;/td&amp;gt;&amp;lt;td&amp;gt;&lt;/span&gt;East&lt;span class="nt"&gt;&amp;lt;/td&amp;gt;&amp;lt;td&amp;gt;&lt;/span&gt;Coconut&lt;span class="nt"&gt;&amp;lt;/td&amp;gt;&amp;lt;/tr&amp;gt;&lt;/span&gt;
  &lt;span class="nt"&gt;&amp;lt;/tbody&amp;gt;&lt;/span&gt;
&lt;span class="nt"&gt;&amp;lt;/table&amp;gt;&lt;/span&gt;
&lt;span class="nt"&gt;&amp;lt;/html&amp;gt;&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;h2&gt;
  
  
  Make the choice inside each row
&lt;/h2&gt;

&lt;p&gt;The table's body is &lt;code&gt;tbody&lt;/code&gt;. Selecting its rows leaves out the header row.&lt;br&gt;
&lt;code&gt;getByRole('cell')&lt;/code&gt; finds ordinary table cells.&lt;/p&gt;

&lt;p&gt;This is the first complete test from &lt;code&gt;tests/table.spec.js&lt;/code&gt;:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight javascript"&gt;&lt;code&gt;&lt;span class="k"&gt;import&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt; &lt;span class="nx"&gt;readFileSync&lt;/span&gt; &lt;span class="p"&gt;}&lt;/span&gt; &lt;span class="k"&gt;from&lt;/span&gt; &lt;span class="dl"&gt;'&lt;/span&gt;&lt;span class="s1"&gt;node:fs&lt;/span&gt;&lt;span class="dl"&gt;'&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;
&lt;span class="k"&gt;import&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt; &lt;span class="nx"&gt;test&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="nx"&gt;expect&lt;/span&gt; &lt;span class="p"&gt;}&lt;/span&gt; &lt;span class="k"&gt;from&lt;/span&gt; &lt;span class="dl"&gt;'&lt;/span&gt;&lt;span class="s1"&gt;@playwright/test&lt;/span&gt;&lt;span class="dl"&gt;'&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;

&lt;span class="nf"&gt;test&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="dl"&gt;'&lt;/span&gt;&lt;span class="s1"&gt;P1: select the third cell within each row, compared with global nth&lt;/span&gt;&lt;span class="dl"&gt;'&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="k"&gt;async &lt;/span&gt;&lt;span class="p"&gt;({&lt;/span&gt; &lt;span class="nx"&gt;page&lt;/span&gt; &lt;span class="p"&gt;})&lt;/span&gt; &lt;span class="o"&gt;=&amp;gt;&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt;
  &lt;span class="k"&gt;await&lt;/span&gt; &lt;span class="nx"&gt;page&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;setContent&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="nf"&gt;readFileSync&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="k"&gt;new&lt;/span&gt; &lt;span class="nc"&gt;URL&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="dl"&gt;'&lt;/span&gt;&lt;span class="s1"&gt;../table.html&lt;/span&gt;&lt;span class="dl"&gt;'&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="k"&gt;import&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nx"&gt;meta&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nx"&gt;url&lt;/span&gt;&lt;span class="p"&gt;),&lt;/span&gt; &lt;span class="dl"&gt;'&lt;/span&gt;&lt;span class="s1"&gt;utf8&lt;/span&gt;&lt;span class="dl"&gt;'&lt;/span&gt;&lt;span class="p"&gt;));&lt;/span&gt;

  &lt;span class="kd"&gt;const&lt;/span&gt; &lt;span class="nx"&gt;rows&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="nx"&gt;page&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;locator&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="dl"&gt;'&lt;/span&gt;&lt;span class="s1"&gt;tbody&lt;/span&gt;&lt;span class="dl"&gt;'&lt;/span&gt;&lt;span class="p"&gt;).&lt;/span&gt;&lt;span class="nf"&gt;getByRole&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="dl"&gt;'&lt;/span&gt;&lt;span class="s1"&gt;row&lt;/span&gt;&lt;span class="dl"&gt;'&lt;/span&gt;&lt;span class="p"&gt;);&lt;/span&gt;
  &lt;span class="kd"&gt;const&lt;/span&gt; &lt;span class="nx"&gt;cells&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="nx"&gt;page&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;getByRole&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="dl"&gt;'&lt;/span&gt;&lt;span class="s1"&gt;cell&lt;/span&gt;&lt;span class="dl"&gt;'&lt;/span&gt;&lt;span class="p"&gt;);&lt;/span&gt;
  &lt;span class="kd"&gt;const&lt;/span&gt; &lt;span class="nx"&gt;thirdInEachRow&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="nx"&gt;cells&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;nth&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="mi"&gt;2&lt;/span&gt;&lt;span class="p"&gt;).&lt;/span&gt;&lt;span class="nf"&gt;within&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="nx"&gt;rows&lt;/span&gt;&lt;span class="p"&gt;);&lt;/span&gt;
  &lt;span class="kd"&gt;const&lt;/span&gt; &lt;span class="nx"&gt;thirdInTable&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="nx"&gt;cells&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;nth&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="mi"&gt;2&lt;/span&gt;&lt;span class="p"&gt;);&lt;/span&gt;

  &lt;span class="k"&gt;await&lt;/span&gt; &lt;span class="nf"&gt;expect&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="nx"&gt;rows&lt;/span&gt;&lt;span class="p"&gt;).&lt;/span&gt;&lt;span class="nf"&gt;toHaveCount&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="mi"&gt;3&lt;/span&gt;&lt;span class="p"&gt;);&lt;/span&gt;
  &lt;span class="k"&gt;await&lt;/span&gt; &lt;span class="nf"&gt;expect&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="nx"&gt;thirdInEachRow&lt;/span&gt;&lt;span class="p"&gt;).&lt;/span&gt;&lt;span class="nf"&gt;toHaveCount&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="mi"&gt;3&lt;/span&gt;&lt;span class="p"&gt;);&lt;/span&gt;
  &lt;span class="k"&gt;await&lt;/span&gt; &lt;span class="nf"&gt;expect&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="nx"&gt;thirdInEachRow&lt;/span&gt;&lt;span class="p"&gt;).&lt;/span&gt;&lt;span class="nf"&gt;toHaveText&lt;/span&gt;&lt;span class="p"&gt;([&lt;/span&gt;&lt;span class="dl"&gt;'&lt;/span&gt;&lt;span class="s1"&gt;Apricot&lt;/span&gt;&lt;span class="dl"&gt;'&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="dl"&gt;'&lt;/span&gt;&lt;span class="s1"&gt;Blueberry&lt;/span&gt;&lt;span class="dl"&gt;'&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="dl"&gt;'&lt;/span&gt;&lt;span class="s1"&gt;Coconut&lt;/span&gt;&lt;span class="dl"&gt;'&lt;/span&gt;&lt;span class="p"&gt;]);&lt;/span&gt;
  &lt;span class="k"&gt;await&lt;/span&gt; &lt;span class="nf"&gt;expect&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="nx"&gt;thirdInTable&lt;/span&gt;&lt;span class="p"&gt;).&lt;/span&gt;&lt;span class="nf"&gt;toHaveCount&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="mi"&gt;1&lt;/span&gt;&lt;span class="p"&gt;);&lt;/span&gt;
  &lt;span class="k"&gt;await&lt;/span&gt; &lt;span class="nf"&gt;expect&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="nx"&gt;thirdInTable&lt;/span&gt;&lt;span class="p"&gt;).&lt;/span&gt;&lt;span class="nf"&gt;toHaveText&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="dl"&gt;'&lt;/span&gt;&lt;span class="s1"&gt;Apricot&lt;/span&gt;&lt;span class="dl"&gt;'&lt;/span&gt;&lt;span class="p"&gt;);&lt;/span&gt;

  &lt;span class="nx"&gt;console&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;log&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="s2"&gt;`within each row: &lt;/span&gt;&lt;span class="p"&gt;${&lt;/span&gt;&lt;span class="nx"&gt;JSON&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;stringify&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="k"&gt;await&lt;/span&gt; &lt;span class="nx"&gt;thirdInEachRow&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;allTextContents&lt;/span&gt;&lt;span class="p"&gt;())}&lt;/span&gt;&lt;span class="s2"&gt;`&lt;/span&gt;&lt;span class="p"&gt;);&lt;/span&gt;
  &lt;span class="nx"&gt;console&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;log&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="s2"&gt;`global nth(2): &lt;/span&gt;&lt;span class="p"&gt;${&lt;/span&gt;&lt;span class="nx"&gt;JSON&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;stringify&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="k"&gt;await&lt;/span&gt; &lt;span class="nx"&gt;thirdInTable&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;allTextContents&lt;/span&gt;&lt;span class="p"&gt;())}&lt;/span&gt;&lt;span class="s2"&gt;`&lt;/span&gt;&lt;span class="p"&gt;);&lt;/span&gt;
&lt;span class="p"&gt;});&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;&lt;code&gt;cells.nth(2).within(rows)&lt;/code&gt; selects Apricot, Blueberry, and Coconut.&lt;br&gt;
The test checks both the number of selected cells and their text.&lt;br&gt;
It compares the same table with &lt;code&gt;cells.nth(2)&lt;/code&gt;, which selects only Apricot.&lt;/p&gt;

&lt;p&gt;Both choices work. They answer different questions about the page.&lt;br&gt;
Use the per-row choice when every row belongs in your check.&lt;/p&gt;
&lt;h2&gt;
  
  
  Read the actual result
&lt;/h2&gt;

&lt;p&gt;The verified run used Node.js 24.21.0, Playwright 1.64.1, and Chromium.&lt;br&gt;
Both tests passed, with these printed values:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;within each row: ["Apricot","Blueberry","Coconut"]
global nth(2): ["Apricot"]
varied rows: ["Coconut","Apricot","Coconut"]
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;The second test changes row order and repeats an item name.&lt;br&gt;
Its rows contain five, three, and four ordinary cells.&lt;br&gt;
The result still follows each row's third cell, in document order.&lt;br&gt;
The &lt;a href="https://github.com/antongulin/anton-qa-resources/blob/main/posts/playwright-within-table-cells/tests/table.spec.js" rel="noopener noreferrer"&gt;full test file&lt;/a&gt; includes that second case.&lt;/p&gt;

&lt;h2&gt;
  
  
  Keep the limits in view
&lt;/h2&gt;

&lt;p&gt;These checks cover Chromium and rows with at least three ordinary cells.&lt;br&gt;
Merged cells need a separate check. This example does not measure speed.&lt;/p&gt;

&lt;p&gt;The number &lt;code&gt;2&lt;/code&gt; still depends on the cell's position.&lt;br&gt;
If the table changes, review whether the third cell still means the same thing.&lt;/p&gt;

&lt;p&gt;Earlier Playwright versions could select columns through other patterns.&lt;br&gt;
&lt;code&gt;within()&lt;/code&gt; makes this per-row choice explicit. It does not always mean less code.&lt;/p&gt;

&lt;p&gt;Try the &lt;a href="https://github.com/antongulin/anton-qa-resources/tree/main/posts/playwright-within-table-cells" rel="noopener noreferrer"&gt;complete example&lt;/a&gt; with your table's structure.&lt;br&gt;
The &lt;a href="https://playwright.dev/docs/api/class-locator#locator-within" rel="noopener noreferrer"&gt;official documentation&lt;/a&gt; explains the selection rule.&lt;br&gt;
The &lt;a href="https://github.com/microsoft/playwright/releases/tag/v1.64.0" rel="noopener noreferrer"&gt;1.64 release notes&lt;/a&gt; introduce the shortcut.&lt;/p&gt;

&lt;p&gt;&lt;em&gt;I'm Anton. I build AI tools and measure how fast they really run. Former Apple engineer. I make &lt;a href="https://ollamatps.com" rel="noopener noreferrer"&gt;ollamatps.com&lt;/a&gt; and write about building and measuring AI at &lt;a href="https://www.anton.qa" rel="noopener noreferrer"&gt;anton.qa&lt;/a&gt;.&lt;/em&gt;&lt;/p&gt;

</description>
      <category>playwright</category>
      <category>testing</category>
      <category>javascript</category>
      <category>tutorial</category>
    </item>
    <item>
      <title>Playwright 1.64 adds WebMCP. What changes for your tests?</title>
      <dc:creator>Anton Gulin</dc:creator>
      <pubDate>Sat, 17 Oct 2026 15:01:14 +0000</pubDate>
      <link>https://dev.to/aiwithanton/playwright-164-adds-webmcp-what-changes-for-your-tests-35gl</link>
      <guid>https://dev.to/aiwithanton/playwright-164-adds-webmcp-what-changes-for-your-tests-35gl</guid>
      <description>&lt;p&gt;Originally published on &lt;a href="https://www.anton.qa/blog/posts/test-page-tools-with-playwright" rel="noopener noreferrer"&gt;anton.qa&lt;/a&gt;.&lt;/p&gt;

&lt;p&gt;This release matters when your website offers actions for AI agents to call. WebMCP lets a page offer those actions. Playwright 1.64 adds experimental support for listing and calling them.&lt;/p&gt;

&lt;p&gt;If your website offers no WebMCP actions, there are none to test yet. If your team is adding them, you can check them alongside the normal page journey.&lt;/p&gt;

&lt;p&gt;Keep your normal browser tests. The extra checks concern what these website actions return and change.&lt;/p&gt;

&lt;h3&gt;
  
  
  A delivery-date example
&lt;/h3&gt;

&lt;p&gt;Imagine your website offers AI an action to find an order's delivery date. A tool is the callable action your website provides.&lt;/p&gt;

&lt;p&gt;Suppose test order 1043 has a saved delivery date of October 16. Call the lookup with that order number. Compare the reply with the saved date, and confirm the records stayed unchanged.&lt;/p&gt;

&lt;p&gt;This is an illustrative example, not a recorded test run. Your website must register the action, and your browser needs WebMCP enabled.&lt;/p&gt;

&lt;h3&gt;
  
  
  Start with a supported page and browser
&lt;/h3&gt;

&lt;p&gt;Your application must register tools through the browser's experimental WebMCP interface. The browser also needs WebMCP enabled. Chromium needs &lt;code&gt;--enable-features=WebMCP&lt;/code&gt; when the browser starts. Firefox needs both &lt;code&gt;dom.modelcontext.enabled&lt;/code&gt; and &lt;code&gt;dom.modelcontext.testing.enabled&lt;/code&gt; preferences. WebKit does not implement the feature.&lt;/p&gt;

&lt;p&gt;The &lt;a href="https://playwright.dev/docs/api/class-webmcp" rel="noopener noreferrer"&gt;Playwright API&lt;/a&gt; calls the main frame's instance &lt;code&gt;page.webmcp&lt;/code&gt;. A frame is one page area with its own content. A tool inside a child frame belongs to that frame's &lt;code&gt;frame.webmcp&lt;/code&gt; instance. Choose the frame that actually registers the tool.&lt;/p&gt;

&lt;p&gt;These prerequisites matter before you diagnose a missing tool. A page without registered tools does not establish that your test setup failed. An empty list can be correct for a page without tools.&lt;/p&gt;

&lt;h3&gt;
  
  
  List what the page offers
&lt;/h3&gt;

&lt;p&gt;&lt;code&gt;tools()&lt;/code&gt; returns tools currently registered in the chosen frame. Compare the names with the actions your application intended to offer. Check the description and input shape too. An input schema describes the values a tool expects.&lt;/p&gt;

&lt;p&gt;The page supplies names, descriptions, input rules, and annotations, which are hints about behavior. Treat those page-provided details as untrusted input. An annotation saying an action is read-only is a page-provided hint. It does not prove the action cannot change data.&lt;/p&gt;

&lt;p&gt;If a tool is missing, first check the chosen frame and registration timing. Then check whether your application registered it. &lt;code&gt;tools()&lt;/code&gt; can also throw when the browser lacks WebMCP support.&lt;/p&gt;

&lt;h3&gt;
  
  
  Call one tool and check its effect
&lt;/h3&gt;

&lt;p&gt;&lt;code&gt;callTool()&lt;/code&gt; invokes a named tool in the chosen frame. Select an action with a known expected result in your own application. Supply the input that matches its schema. The call returns the result supplied by the page's tool.&lt;/p&gt;

&lt;p&gt;Check both the returned content and the application result. For our order lookup, compare the reply with the known delivery date. For an update, read the saved record after the call. Check the intended change and confirm other records stayed unchanged. Follow the app's documented save timing. A returned value only tells you that the tool answered. It does not prove the answer is correct or the update persisted.&lt;/p&gt;

&lt;p&gt;Use a controlled record for actions that change data. Keep purchases and customer notifications outside this check. A callback is the code that runs the tool.&lt;/p&gt;

&lt;div class="table-wrapper-paragraph"&gt;&lt;table&gt;
&lt;thead&gt;
&lt;tr&gt;
&lt;th&gt;Situation to exercise&lt;/th&gt;
&lt;th&gt;What Playwright exposes&lt;/th&gt;
&lt;th&gt;What the tester should check&lt;/th&gt;
&lt;/tr&gt;
&lt;/thead&gt;
&lt;tbody&gt;
&lt;tr&gt;
&lt;td&gt;Valid tool and input&lt;/td&gt;
&lt;td&gt;The page's returned result&lt;/td&gt;
&lt;td&gt;Expected content and the relevant application state&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;Tool returns &lt;code&gt;isError: true&lt;/code&gt;
&lt;/td&gt;
&lt;td&gt;A returned error result&lt;/td&gt;
&lt;td&gt;The reported failure and whether state stayed as expected&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;Name is not registered&lt;/td&gt;
&lt;td&gt;An exception, a reported execution failure&lt;/td&gt;
&lt;td&gt;The intended registration and the reported failure&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;Tool's callback throws&lt;/td&gt;
&lt;td&gt;An exception, a reported execution failure&lt;/td&gt;
&lt;td&gt;The reported failure and resulting application state&lt;/td&gt;
&lt;/tr&gt;
&lt;/tbody&gt;
&lt;/table&gt;&lt;/div&gt;

&lt;p&gt;The last two cases both fail through an exception. That failure alone does not identify its cause. Inspect the registered names and the controlled failure you exercised.&lt;/p&gt;

&lt;h3&gt;
  
  
  Keep the normal page journey
&lt;/h3&gt;

&lt;p&gt;A page-tool check tells you what an AI-facing action reports and changes. It does not replace a person's normal browser journey. Keep tests for visible controls, messages, and the complete user task. Those checks answer a different question: can a person finish the task through the page?&lt;/p&gt;

&lt;h3&gt;
  
  
  A short review list
&lt;/h3&gt;

&lt;p&gt;For your own tool-enabled page, ask:&lt;/p&gt;

&lt;ol&gt;
&lt;li&gt;Which frame registers the tool, and is WebMCP enabled in this browser?&lt;/li&gt;
&lt;li&gt;Does &lt;code&gt;tools()&lt;/code&gt; show the expected action and input shape?&lt;/li&gt;
&lt;li&gt;Does &lt;code&gt;callTool()&lt;/code&gt; return the expected content for a known input?&lt;/li&gt;
&lt;li&gt;Does the application state match that result?&lt;/li&gt;
&lt;li&gt;What happens for a returned error, an unknown name, and a callback failure?&lt;/li&gt;
&lt;li&gt;Do normal page controls still support the user's task?&lt;/li&gt;
&lt;/ol&gt;

&lt;p&gt;That list gives you a practical starting point for Playwright 1.64. Adapt each expected result to your application's actual contract.&lt;/p&gt;

&lt;p&gt;&lt;em&gt;I'm Anton. I build AI tools and measure how fast they really run. Former Apple engineer. I make &lt;a href="https://ollamatps.com" rel="noopener noreferrer"&gt;ollamatps.com&lt;/a&gt; and write about building and measuring AI at &lt;a href="https://www.anton.qa" rel="noopener noreferrer"&gt;anton.qa&lt;/a&gt;.&lt;/em&gt;&lt;/p&gt;

</description>
      <category>playwright</category>
      <category>testing</category>
      <category>ai</category>
      <category>webdev</category>
    </item>
  </channel>
</rss>
