<?xml version="1.0" encoding="UTF-8"?><rss xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:content="http://purl.org/rss/1.0/modules/content/" xmlns:atom="http://www.w3.org/2005/Atom" version="2.0"><channel><title><![CDATA[QA Insights from a QA Lead]]></title><description><![CDATA[QA Insights from a QA Lead]]></description><link>https://muhammad-usman-sqa.hashnode.dev</link><generator>RSS for Node</generator><lastBuildDate>Fri, 04 Dec 2026 22:36:21 GMT</lastBuildDate><atom:link href="https://muhammad-usman-sqa.hashnode.dev/rss.xml" rel="self" type="application/rss+xml"/><language><![CDATA[en]]></language><ttl>60</ttl><item><title><![CDATA[Your AI-Written Tests Are Green. Would They Go Red?]]></title><description><![CDATA[A green test only means something if it can turn red. Real output from qa-core-verify 0.1.0.]]></description><link>https://muhammad-usman-sqa.hashnode.dev/your-ai-written-tests-are-green-would-they-go-red</link><guid isPermaLink="true">https://muhammad-usman-sqa.hashnode.dev/your-ai-written-tests-are-green-would-they-go-red</guid><category><![CDATA[AI]]></category><category><![CDATA[Testing]]></category><category><![CDATA[playwright]]></category><category><![CDATA[test-automation]]></category><category><![CDATA[TypeScript]]></category><dc:creator><![CDATA[Muhammad Usman]]></dc:creator><pubDate>Fri, 04 Dec 2026 11:30:06 GMT</pubDate><enclosure url="https://cdn.hashnode.com/uploads/covers/6b06c20d9d94cfcf1a51c657/eff88c62-152e-48de-b6c4-e65333c697d1.png" length="0" type="image/jpeg"/><content:encoded><![CDATA[<p><em>Originally published in my LinkedIn newsletter, <a href="https://www.linkedin.com/pulse/your-ai-written-tests-green-would-go-red-muhammad-usman-ob0nf/">QA Insights from a QA Lead</a>.</em></p>
<p>A green test only means something if it can turn red. That's the first question I'd ask about any Playwright suite an AI assistant wrote.</p>
<p>AI is fast at producing tests that look right. They pass on the first run. But passing tells you nothing about whether the test fails when the feature breaks. The patterns to look for:</p>
<ul>
<li>an assertion placed after a <code>return</code>, so it never runs</li>
<li><code>toBeTruthy()</code> on a locator object, which is always truthy</li>
<li>a <code>try/catch</code> that swallows the failed assertion</li>
<li>a check against a local string instead of the page</li>
<li><code>toBeHidden()</code> on a selector that was never on the page</li>
</ul>
<p>All of them stay green in CI, every day, even after the feature underneath is gone.</p>
<p>I'm Muhammad Usman, a Senior QA Automation Lead and SDET with 10+ years in test automation, and I'm ISTQB CTFL certified. At SprintSynergy, an AI-based QA automation company (AI testing agents plus our QA team), we built <strong>qa-core-verify</strong> to answer one question: will this green test go red when the feature breaks? It audits a Playwright suite, often one written by an AI, and gives each test one verdict: trusted, review, untrusted, baseline-red or not-run.</p>
<p>Repo: <a href="https://github.com/sprintsynergyio/qa-core-verify">https://github.com/sprintsynergyio/qa-core-verify</a></p>
<h2>The checker is not a model</h2>
<p>qa-core-verify has no LLM and needs no API key. If a model grades tests that a model wrote, the same kind of system is asked to agree with itself. I want evidence I can re-check by hand. Four checks:</p>
<ul>
<li><strong>Static rules</strong> (QCV-W001 to QCV-W010). The TypeScript compiler API reads each spec without running it. It flags a missing assertion, a generic matcher on a locator, an unawaited assertion, a value compared with itself, a swallowed failure and similar problems. No browser.</li>
<li><strong>Locator evidence</strong> (<code>--only locator</code>). It runs the suite and records how many elements each locator matched.</li>
<li><strong>Assertion inversion</strong> (<code>--only inversion</code>). For every assertion in a green test, it writes one mutant that adds or removes <code>.not</code>, then runs that test. If the inverted test still passes, the assertion cannot fail.</li>
<li><strong>Fault injection</strong> (<code>--only faults</code>). It changes the page in the browser (blanks the app, changes a text, swaps the user) and records which tests stay green.</li>
</ul>
<p>Runtime checks work in a temp copy, so your suite is never modified. Exit codes 0, 1 and 2 let it gate CI.</p>
<h2>What I ran today</h2>
<p>On 4 Dec 2026 I cloned the repo, built version 0.1.0 and ran all four checks on the demo suite in <code>example-project/saucedemo</code>. It has 19 Playwright tests against SauceDemo, a free practice app. Four are honest tests. The rest are deliberately weak, modelled on the mistakes above. Each one is marked with a <code>SEEDED</code> comment and listed in <code>expected-findings.json</code>, so the right answer is known in advance. To be clear: we seeded these by hand. This is not a measurement on a client suite.</p>
<p>Playwright's own baseline: <strong>18 passed, 0 failed, 1 skipped</strong>. By the usual standard, the suite is healthy.</p>
<h3>Static pass: the obvious ones, no browser</h3>
<pre><code class="language-text">Summary: 9 trusted, 3 review, 6 untrusted, 0 baseline-red, 1 not-run.
6 errors, 3 warnings, 3 info findings.
</code></pre>
<p><code>opens the login page and stops</code> has no <code>expect</code> at all (QCV-W001). <code>literal compared with literal</code> asserts <code>expect(true).toBe(true)</code> (QCV-W004). <code>truthy locator</code> does <code>expect(page.getByText('Products')).toBeTruthy()</code> (QCV-W002). That passes whether the element exists or not.</p>
<p>Now look at what the static pass called <strong>trusted</strong>: <code>assertion is never reached</code> and <code>does not read the page</code>. The first has its <code>expect</code> after a <code>return</code>. The second checks a local constant. The output says so itself: "Locator and cannot-fail checks did not run." A trusted verdict only means the checks that ran found nothing.</p>
<h3>Assertion inversion: 23 mutants, 3 survived</h3>
<pre><code class="language-text">Inversion: 23 mutants, 23 runs. 20 killed, 3 survived, 0 timeout, 0 error, 1 not-run, 0 skipped.
</code></pre>
<p>The three survivors were the <code>expect</code> after the <code>return</code>, the <code>expect</code> inside an <code>if</code> that never runs, and the <code>expect</code> inside a <code>try/catch</code>. Each got QCV-F001: "Assertion cannot fail." The run took 152 seconds.</p>
<p>One result surprised me at first. Inversion <strong>killed</strong> the mutant in <code>does not read the page</code>. The assertion is <code>expect(marker).toContain('seeded')</code>, and the string really does contain "seeded", so the inverted version fails. The assertion can fail. It just has nothing to do with the app.</p>
<h3>Fault injection: seven tests green on a blank page</h3>
<p><code>blank-app</code> replaces the page body with an empty element. The demo's faults file adds five more. Four change the text of a real element: the cart badge, the products title, the item total and the locked-out error. The fifth runs the suite as <code>problem_user</code>.</p>
<pre><code class="language-text">Fault blank-app: 11 fail, 7 pass, 1 skipped, 0 not-run.
Summary: 4 trusted, 7 review, 7 untrusted, 0 baseline-red, 1 not-run.
8 errors, 14 warnings, 0 info findings.
</code></pre>
<p><strong>Seven of the 18 tests that ran stayed green with nothing on the page.</strong> <code>does not read the page</code> finally got caught three ways: QCV-F002 (passes on a blank app), QCV-F003 (it was listed as expected to break under the cart-badge fault and stayed green) and QCV-F004 (green under every fault other than blank-app).</p>
<p>The honest tests behaved the way tests should. <code>locked out user sees the error</code> failed under <code>locked-out-error</code>. <code>checkout overview shows the backpack item total</code> failed under <code>item-total</code> and <code>problem-user</code>. They break when the thing they are about breaks.</p>
<p>My summary line matched the three fault runs recorded in the README on 14 Nov. Mine took 180 seconds; theirs took 174 to 176.</p>
<h3>Locator evidence: the invented banner</h3>
<p><code>#login-error-banner</code> was only used in <code>toBeHidden()</code> and matched 0 elements. QCV-L002 says: "This test stays green even if this element does not exist." That's the hallucinated-locator case: a plausible selector that was never on the page, kept green forever by an absence check. The locator run took 17 seconds.</p>
<h2>No single check is enough</h2>
<p>This was the most useful part of the exercise for me. Each check caught something the others missed:</p>
<ul>
<li><code>assertion is never reached</code>: trusted by static rules, untrusted under inversion and faults</li>
<li><code>does not read the page</code>: trusted by static rules <strong>and</strong> by inversion, untrusted only under faults</li>
<li><code>invented banner is hidden</code>: trusted by static rules, review under the locator check</li>
<li><code>literal compared with literal</code>: untrusted under static rules and faults, trusted under inversion</li>
</ul>
<p>All four honest tests were trusted under all four checks.</p>
<p>Lint alone misses the cannot-fail tests. Mutating assertions alone misses tests that assert on the wrong thing. The README's CI advice: the static check on every pull request, the slow ones on a schedule or a manual trigger.</p>
<h2>What it doesn't do yet</h2>
<p>I'd rather you hear this from me:</p>
<ul>
<li><strong>A clean report does not prove a suite is complete or correct.</strong> It only reports the checks that ran. Coverage gaps are not part of this build.</li>
<li>The static pass follows helpers and page objects only one import level deep.</li>
<li>Under a fault, the action timeout is 8 seconds and the navigation timeout is 15. A test that needs longer fails under every fault and counts as broken, and that can hide QCV-F002 and QCV-F004 for it.</li>
<li>On a live site, one slow response can make a baseline or control run fail. Repeating a SauceDemo run does not promise identical output.</li>
<li>Playwright is pinned to 1.60.0 and Node 22.6 or later is required. The repo's CI runs on Ubuntu 24.04, because Playwright 1.60.0 refuses Chromium on Ubuntu 26.04.</li>
<li>It's the first release, version 0.1.0.</li>
</ul>
<h2>How we'd use it on a project</h2>
<p>AI agents write and run tests. qa-core-verify marks which green tests could never go red, with the line, the evidence and a suggested fix. It does not rewrite tests. Our QA team decides whether to fix the assertion, add a fault the test should catch, or delete the test. The agent finds the problems. The people decide what to do about them.</p>
<p>If an AI helped write your suite, run the static pass first; it needs no browser. Then run <code>--only faults</code> once and count how many tests stay green on a blank page. Better to know that number before your next release.</p>
<p>When did you last watch one of your green tests fail on purpose, and how did you make it fail?</p>
<p><strong>Repo:</strong> <a href="https://github.com/sprintsynergyio/qa-core-verify">https://github.com/sprintsynergyio/qa-core-verify</a></p>
<p><strong>npm:</strong> <a href="https://www.npmjs.com/package/qa-core-verify">https://www.npmjs.com/package/qa-core-verify</a></p>
]]></content:encoded></item><item><title><![CDATA[AI Wrote the Glue Job. Who Proves the Data Is Right?]]></title><description><![CDATA[A row count can match while the data is wrong. I have seen that on ETL projects for years, and it matters more now that AI assistants write and migrate…]]></description><link>https://muhammad-usman-sqa.hashnode.dev/ai-wrote-the-glue-job-who-proves-the-data-is-right</link><guid isPermaLink="true">https://muhammad-usman-sqa.hashnode.dev/ai-wrote-the-glue-job-who-proves-the-data-is-right</guid><category><![CDATA[AI]]></category><category><![CDATA[ai agents]]></category><category><![CDATA[data-engineering]]></category><category><![CDATA[Testing]]></category><category><![CDATA[PySpark]]></category><dc:creator><![CDATA[Muhammad Usman]]></dc:creator><pubDate>Thu, 03 Dec 2026 11:00:14 GMT</pubDate><enclosure url="https://cdn.hashnode.com/uploads/covers/6b06c20d9d94cfcf1a51c657/94d90c25-e7bd-439f-831a-be6b05429ad4.png" length="0" type="image/jpeg"/><content:encoded><![CDATA[<p>A row count can match while the data is wrong. I have seen that on ETL projects for years, and it matters more now that AI assistants write and migrate Glue and PySpark jobs for us.</p>
<p>A model can produce a job that runs clean, finishes green and loads the same number of rows. It can still change a rounding rule, map a status column wrongly, or drop a date partition. Nothing fails. The job is "successful". The first person to notice is usually someone in finance.</p>
<p>I'm Muhammad Usman, a Senior QA Automation Lead and SDET with 10+ years in test automation, and I'm ISTQB CTFL certified. At SprintSynergy, an AI-based QA automation company (AI testing agents plus our QA team), we build agents for the checks that people skip under deadline pressure. This one is <strong>qa-core-recon</strong>. It proves that a target dataset matches its source after a Glue or PySpark job.</p>
<p>Repo: <a href="https://github.com/sprintsynergyio/qa-core-recon">https://github.com/sprintsynergyio/qa-core-recon</a></p>
<h2>Use AI to build the job. Don't use AI to grade it.</h2>
<p>This is the design decision I care about most. In qa-core-recon, <strong>no AI model decides pass or fail</strong>. The README says so in its first sentence.</p>
<p>I use AI heavily to write and review code. But if the thing that writes the job also judges its output, models can be talked into agreeing. A reconciliation check has to be boring and repeatable: the same two files and the same spec give the same answer every time, and I can explain that answer to an auditor without saying "the model felt it was fine".</p>
<p>So the checks are plain and deterministic:</p>
<ul>
<li>row counts, for the whole table and per group (for example per <code>txn_date</code>)</li>
<li>amount sums, as exact decimals at a scale you set (a float tolerance in the spec is rejected)</li>
<li>null keys and duplicate keys on each side</li>
<li>key diff: keys missing from the target, keys that appear only in the target, keys whose row differs</li>
<li>changed columns: for the keys that differ, which column differs and what the two values were</li>
</ul>
<p>Each run writes <code>report.json</code> and <code>report.md</code>. Neither has a timestamp, so two runs on the same input produce the same file. The exit code is made for CI: 0 is a match, 1 is a mismatch, 2 is a refusal or a read error.</p>
<h2>The demo: five target tables, one source</h2>
<p>The repo ships a made-up payments dataset of 200 rows (account, transaction type, amount, currency, date), generated with a fixed seed. No client data is involved.</p>
<p>I ran this in a fresh virtual environment: <code>pip install qa-core-recon==0.1.1</code> from PyPI, the example specs from a clone of the repo, and Java 17 (Spark needs it):</p>
<pre><code class="language-bash">git clone https://github.com/sprintsynergyio/qa-core-recon.git
cd qa-core-recon
pip install qa-core-recon==0.1.1

qa-core-recon run --spec examples/demo/specs/match.yaml --out /tmp/recon-match
echo $?
</code></pre>
<p>That prints <code>match</code> and exits 0. Source and target both hold 200 rows, and the amount sum is <strong>110,517.18</strong> on both sides, in every date group.</p>
<p>The interesting part is the four broken targets.</p>
<h3>1. Missing rows</h3>
<p><code>missing-rows.yaml</code> drops every target row dated 2024-03-01. The report:</p>
<pre><code class="language-text">Row Count   Mismatch   Source rows: 200. Target rows: 160.
  txn_date=2024-03-01  Source rows: 40. Target rows: 0. This group is missing on the target.
Amount Sum  Mismatch   Source sum: 110517.18. Target sum: 86428.96. Difference: 24088.22.
Key Diff    Mismatch   Missing keys: 40. The first 20 of 40 are listed.
</code></pre>
<p>A row count alone would catch this one. The useful part is that the report names the day that vanished and the 40 missing <code>txn_id</code> values, so you start at the partition filter.</p>
<h3>2. Extra rows</h3>
<p><code>extra-rows.yaml</code> adds three rows on 2024-03-06, a date that doesn't exist in the source. The report shows 203 target rows against 200, a new date group that is missing on the source, an amount difference of 80.75 and exactly three extra keys: <code>TXN900001</code>, <code>TXN900002</code>, <code>TXN900003</code>.</p>
<h3>3. Same row count, wrong data</h3>
<p>This is the one I built the article around. <code>changed-rows.yaml</code> keeps all 200 keys and changes five rows, <code>TXN000001</code> to <code>TXN000005</code>. The amount goes up and the transaction type becomes <code>adjustment</code>.</p>
<pre><code class="language-text">Row Count        Match      Source rows: 200. Target rows: 200.
Amount Sum       Mismatch   Source sum: 110517.18. Target sum: 110523.43. Difference: 6.25.
Key Diff         Mismatch   Missing keys: 0. Extra keys: 0. Changed keys: 5.
Changed Columns  Mismatch
  amount    TXN000001  Source: 143.06    Target: 144.31
  amount    TXN000002  Source: -562.37   Target: -561.12
  txn_type  TXN000001  Source: payment   Target: adjustment
  txn_type  TXN000002  Source: refund    Target: adjustment
</code></pre>
<p>Row count: match. If that were your only check, the job would pass. The amount sum is off by 6.25 out of more than 110,000, too small to notice on a dashboard. The changed-columns check names the columns and shows both values for each key. That's a bug report you can hand to a developer.</p>
<h3>4. A systematic shift</h3>
<p><code>sum-mismatch.yaml</code> adds 0.50 to every target amount. The row count matches. The report shows a difference of <strong>100.00</strong> overall, 20.00 in each of the five date groups, and <strong>200 changed keys</strong>. When every key changes by the same amount, you're not looking at bad rows. You're looking at a rule, a cast or a rounding step in the transformation.</p>
<p>All five runs behaved as expected: the match exits 0 and the four broken ones exit 1. A run takes about 8 seconds on my machine, including starting Spark locally.</p>
<h2>Where it refuses on purpose</h2>
<p>A checker that always answers is a trap. Exit code 2 means "I won't compare this", and a refusal still writes a report. Examples:</p>
<ul>
<li>An amount that can't be represented exactly at the scale you declared is refused as <code>inexact-amount</code>. It is not silently rounded.</li>
<li>A tolerance needs a written reason in the spec. If you want to allow a difference, you have to say why, and that reason is part of the file you commit.</li>
<li>A spec marked as sampled is refused. A sample can't prove a full table matches.</li>
<li>A source or target path outside the allowlist in the spec is refused.</li>
</ul>
<p>I like the refusals more than the checks. They stop the tool from giving a green result it hasn't earned.</p>
<h2>What it doesn't do yet</h2>
<p>I'd rather you hear it from me:</p>
<ul>
<li><strong>There has been no live AWS run.</strong> Reading CSV, Parquet and Iceberg from S3 is covered by tests that use a mock S3 (moto), and the demo is synthetic. I haven't yet run it against a real bucket and a real Glue output, so I won't claim it has.</li>
<li><strong>Key diff lists stop at 20 examples.</strong> The count is always the full number, but the list is capped.</li>
<li><strong>Columns you don't name in the spec aren't compared.</strong> If a job adds or changes an unlisted column, version 0.1.1 reports a match. I have a fix open for a schema-drift check, and it isn't released yet.</li>
<li>CSV is comma-separated UTF-8 only. There is no column rename mapping yet and no Glue Data Catalog reader.</li>
<li>CI runs on Linux with Python 3.11, 3.12 and 3.13 and Java 17. I haven't tested it elsewhere, so I won't tell you it works elsewhere.</li>
</ul>
<p>It's an early release, version 0.1.1.</p>
<h2>How we'd use it on a project</h2>
<p>The AI-assisted or hand-written job runs, the recon agent compares source and target in the pipeline, and the exit code gates the next step. A mismatch attaches <code>report.md</code> to the ticket, and our QA team finds the cause. The agent does the repetitive proving. The people do the judging.</p>
<p>If you migrate Glue or PySpark jobs, especially with AI help, try it on a table you know well. Break the target on purpose with a small change in amounts and see whether your current checks notice. If they don't, better to learn that before a release.</p>
<p>If it fails on your data, open an issue with the spec and the report.</p>
<p><strong>Repo:</strong> <a href="https://github.com/sprintsynergyio/qa-core-recon">https://github.com/sprintsynergyio/qa-core-recon</a></p>
<p><strong>PyPI:</strong> <a href="https://pypi.org/project/qa-core-recon/">https://pypi.org/project/qa-core-recon/</a></p>
]]></content:encoded></item><item><title><![CDATA[We Tested the AI Prompts Testers Use Most. Here's What Actually Made the Answers Better]]></title><description><![CDATA[Testers copy the same prompts again and again: "You are a senior QA engineer…", "Summarize these test results into a report…". We wanted to know two…]]></description><link>https://muhammad-usman-sqa.hashnode.dev/we-tested-the-ai-prompts-testers-use-most</link><guid isPermaLink="true">https://muhammad-usman-sqa.hashnode.dev/we-tested-the-ai-prompts-testers-use-most</guid><category><![CDATA[AI]]></category><category><![CDATA[Testing]]></category><category><![CDATA[Prompt Engineering]]></category><category><![CDATA[QA]]></category><category><![CDATA[llm]]></category><dc:creator><![CDATA[Muhammad Usman]]></dc:creator><pubDate>Tue, 01 Dec 2026 07:58:52 GMT</pubDate><enclosure url="https://cdn.hashnode.com/uploads/covers/6b06c20d9d94cfcf1a51c657/62715dea-4e34-4303-a005-1a92d77895a7.png" length="0" type="image/jpeg"/><content:encoded><![CDATA[<p>Testers copy the same prompts again and again: "You are a senior QA engineer…", "Summarize these test results into a report…". We wanted to know two things. Do the popular versions work? And can we get better answers with fewer tokens?</p>
<p>So we did it the way we test software. We collected the prompts, wrote better versions, ran both on the same inputs, and scored the output with real checks. Everything is public: 33 prompts, inputs, harness and raw results at <strong><a href="https://github.com/sprintsynergyio/qa-prompt-pack">https://github.com/sprintsynergyio/qa-prompt-pack</a></strong>, and on the pack page at <strong><a href="https://sprintsynergy.com/qa-prompt-pack">https://sprintsynergy.com/qa-prompt-pack</a></strong>.</p>
<h2>What's in the pack</h2>
<ul>
<li><strong>Manual testing (11):</strong> test cases from a story, bug report from rough notes, edge-case inputs, test data, test plan, security checks, exploratory charters, a regression checklist from a release change list, a test run summary with go/no-go, an acceptance-criteria review, and a cross-browser/device matrix.</li>
<li><strong>Automation testing (6):</strong> Playwright UI test from a journey, API tests, test-file review, flaky-test diagnosis, k6 load script, locator fix.</li>
<li><strong>Industry (16):</strong> four each for healthcare, financial, e-commerce and SaaS.</li>
</ul>
<p>The everyday tasks were ranked by how often they appear in 34 public prompt sources. For 16 of them we kept the popular wording as the "original," quoted with credit, and wrote our version next to it.</p>
<h2>What we changed</h2>
<p>The optimized prompts follow a few plain rules:</p>
<ol>
<li><strong>No role line.</strong> "You are a senior QA engineer" costs tokens and doesn't make structured output better.</li>
<li><strong>Input goes inside tags</strong> (<code>&lt;req&gt;</code>, <code>&lt;notes&gt;</code>, <code>&lt;results&gt;</code>), so instructions and data don't blur.</li>
<li><strong>"Output only…"</strong> with an exact table or code-block format. No intro, no recap.</li>
<li><strong>Hard caps</strong>: max 20 rows, max 5 questions. This stops near-duplicate cases.</li>
<li><strong>No guessing.</strong> Missing facts become "Unknown" or a question. Undefined behavior becomes <code>test.fixme</code> with a reason.</li>
<li><strong>Make the model check its own inputs.</strong> The run-summary prompt says "recompute every total from the module rows and flag any stated figure that doesn't match."</li>
</ol>
<p>Here is the bug-report prompt after the rewrite:</p>
<pre><code>Bug report from these notes. Facts from notes only; missing = "Unknown"; guessed steps tagged [unconfirmed].
Output only: Title (component - symptom), Severity H/M/L + 1-line reason, Environment, Steps, Expected, Actual, Questions (max 4, most blocking first).
&lt;notes&gt;
{{bug-notes.md}}
&lt;/notes&gt;
</code></pre>
<h2>How we scored it</h2>
<p>Every prompt ran <strong>3 times</strong> on the same input. <strong>Claude Haiku</strong> generated the answers. Scoring had two parts:</p>
<ul>
<li><strong>Deterministic checks.</strong><ul>
<li>Automation answers had to compile with <code>tsc</code> and pass against the live TodoMVC demo or JSONPlaceholder. k6 scripts had to pass <code>k6 inspect</code>, and locators had to match the right element on the real page.</li>
<li>Manual answers were checked against synthetic inputs with planted traps. In one, a lead's note counts blocked cases as executed ("112 executed, 95% pass rate"); the real numbers are 106 and 92.5%. In another, two acceptance criteria contradict each other ("notify immediately" vs "send in a batch every 15 minutes"). There is also a release with a docs-only change that shouldn't get regression tests.</li>
</ul>
</li>
<li><strong>A blind judge.</strong> <strong>Claude Sonnet</strong> compared each pair in random order, without knowing which prompt produced which answer.</li>
</ul>
<h2>The results</h2>
<p>Across the 16 prompts with a public original (48 blind pairs):</p>
<table>
<thead>
<tr>
<th></th>
<th>Original</th>
<th>Optimized</th>
</tr>
</thead>
<tbody><tr>
<td>Blind judge wins</td>
<td>3</td>
<td><strong>40</strong> (5 ties)</td>
</tr>
<tr>
<td>Mean judge score (1-10)</td>
<td>5.85</td>
<td><strong>7.77</strong></td>
</tr>
<tr>
<td>Deterministic check score (0-1)</td>
<td>0.865</td>
<td><strong>0.961</strong></td>
</tr>
<tr>
<td>Output tokens (all runs)</td>
<td>75,579</td>
<td><strong>40,071 (−47%)</strong></td>
</tr>
</tbody></table>
<p>The optimized version <strong>beat the original on 15 of 16 and matched on 1</strong> (the locator fix, where both were right every time). It <strong>lost on 0</strong>.</p>
<p>The biggest gains were where the original invited guessing:</p>
<ul>
<li><strong>UI script (judge 5 → 9 out of 10).</strong> In 2 of 3 runs the original's tests failed on the real page, because its locators didn't match it. The optimized version gets the page's aria snapshot, and its tests passed on every run.</li>
<li><strong>Regression checklist (judge 4.3 → 8.0).</strong> The original turned six changes into long generic lists, and in 2 of 3 runs it didn't say the docs-only change needs no testing. The optimized version maps every change ID to a check and adds a smoke pass of the critical paths.</li>
<li><strong>Acceptance-criteria review (checks 0.71 → 1.00).</strong> Both found the "immediately vs batched" contradiction. The original never asked who "the user" is (account owner? admins?) in any run.</li>
<li><strong>API tests (checks 0.69 → 1.0).</strong> The original asserted validation errors (400s) that JSONPlaceholder doesn't return, so 9 to 11 tests failed against the real service in two of the runs, and the third didn't compile.</li>
</ul>
<h2>The honest part: answers got better, prompts didn't get shorter</h2>
<p>We expected shorter prompts. That isn't what happened. Input tokens are roughly flat (+3%). Several popular originals are short because they leave things out. "Summarize this list of test results into a short test summary report" is one line, and it doesn't say how to count blocked cases.</p>
<p>The saving is on the other side. Answers came back <strong>47% smaller</strong> and more of them worked: fewer intros and recaps, fewer duplicate cases, fewer invented requirements. If you pay per output token, or you have to read every answer, that's where the cost is.</p>
<p>One exception: our run-summary prompt writes <em>longer</em> answers than the one-line original (about 2,100 vs 1,500 output tokens), because it reconciles every total. We think that's the right trade for a release decision, but it's not a token saving.</p>
<h2>Where our own eval was wrong</h2>
<p><strong>1. The judge was biased toward the original.</strong> In the first run, the judge saw the <em>original prompt</em> as the task description. It then graded both answers on how closely they followed the original's wording. For example, it marked down a correct Playwright locator because the original asked for "a Python CSS selector." In that setup the original won 31 of 36.</p>
<p>We changed the judge to see a <strong>neutral task statement plus the shared inputs</strong>, and never either prompt. Both judgments are in the repo. If you build your own LLM evals: <strong>don't give the judge one contestant's instructions</strong>.</p>
<p><strong>2. The first run showed real gaps in our prompts.</strong> Four of our prompts (edge cases, test plan, security, test data) lost on the deterministic checks at first. We fixed them and re-ran each 3 times. The test-data fix taught us the most: the model kept writing "200-character" titles that were really 120 to 320 characters, with either prompt. <strong>LLMs can't count characters</strong>, so give them the literal string or generate long strings in code.</p>
<p><strong>3. Our checker was wrong too.</strong> Two manual answers failed a check even though they were right: one said "do not match" where the regex only accepted "does not match". We fixed the regex, re-scored <em>both</em> variants, and wrote that down in the results.</p>
<h2>Industry packs: 16 more prompts</h2>
<p>Four prompts each for <strong>healthcare, financial, e-commerce and SaaS</strong>: PHI-safe test data, PHI leakage in logs, money rounding, payments and refunds, inventory races, discounts and tax, RBAC matrices, tenant isolation, billing proration and API contracts. All fixtures are synthetic. Card numbers are documented test numbers and SSNs come from reserved ranges.</p>
<p>There's no popular original for these, so they're scored on their own, with domain checks plus a judge rubric. <strong>48 of 48 runs passed</strong>, with a <strong>mean judge score of 7.5/10</strong>. The weakest is the audit-trail prompt (judge 6): its runs differ in how many refusal and correction rows they write. A stricter version used 60% more tokens with no better score, so we kept the shorter one and noted it. The browser/device-matrix prompt is also scored on its own: 3 of 3 runs passed, judge 8/10.</p>
<h2>What it cost</h2>
<p>The whole thing, including both judge setups and every re-run: <strong>$2.29</strong> on Claude. Haiku generated the answers and Sonnet judged. The harness has a budget stop, so you can re-run it yourself without surprises:</p>
<pre><code class="language-bash">export ANTHROPIC_API_KEY=...
BUDGET_USD=3 python eval/run_eval.py --runs 3              # automation + general
BUDGET_USD=1 python eval/run_eval.py --suite manual --runs 3
BUDGET_USD=1 python eval/run_eval.py --suite industry --runs 3
</code></pre>
<h2>Take it, break it, tell us</h2>
<p>The prompts are MIT-licensed and copy-paste ready. Replace the <code>{{file}}</code> slot with your own story, notes, results or snapshot. If one fails on your app, open an issue with the input. That's more useful to us than a star.</p>
<p>We're SprintSynergy, an AI-based QA automation company (AI testing agents plus our QA team). This is how we work on real projects too: measure first, then decide.</p>
<p><strong>Repo:</strong> <a href="https://github.com/sprintsynergyio/qa-prompt-pack">https://github.com/sprintsynergyio/qa-prompt-pack</a></p>
<p><strong>Pack page:</strong> <a href="https://sprintsynergy.com/qa-prompt-pack">https://sprintsynergy.com/qa-prompt-pack</a></p>
]]></content:encoded></item><item><title><![CDATA[Boundary Values Beyond Numbers: Strings, Dates and Money]]></title><description><![CDATA[Testers often stop at min and max. The bugs that ship are usually in names, calendars and currency.]]></description><link>https://muhammad-usman-sqa.hashnode.dev/boundary-values-beyond-numbers-strings-dates-and-money</link><guid isPermaLink="true">https://muhammad-usman-sqa.hashnode.dev/boundary-values-beyond-numbers-strings-dates-and-money</guid><category><![CDATA[Artificial Intelligence]]></category><category><![CDATA[Testing]]></category><category><![CDATA[playwright]]></category><category><![CDATA[automation testing ]]></category><category><![CDATA[QA]]></category><dc:creator><![CDATA[Muhammad Usman]]></dc:creator><pubDate>Fri, 27 Nov 2026 11:10:23 GMT</pubDate><enclosure url="https://cdn.hashnode.com/uploads/covers/6b06c20d9d94cfcf1a51c657/421d0247-9cde-4ecb-aec9-e32cbb68f220.png" length="0" type="image/jpeg"/><content:encoded><![CDATA[<p>Every QA lead I know has lived this moment.</p>
<p>A quantity field has a minimum of 1 and a maximum of 99. The team writes two tests. Both pass. The ticket is done.</p>
<p>And we tell ourselves the field is covered.</p>
<p>Then a customer pastes a name with a trailing space, a booking lands on 29 February, or a three-way split of a bill is off by a cent. The numbers were never the problem.</p>
<p>After 10+ years in Quality Assurance, I have learned that boundary-value analysis is one of the most useful techniques we have, and one of the most narrowly applied. We treat it as min and max for integers. The real boundaries sit in strings, dates and money.</p>
<p>The last two editions were about flaky tests and guessed heals. This one is about calling a field covered after two numeric tests.</p>
<h3>The mistake is stopping at the number</h3>
<p>Boundary-value analysis says defects cluster at the edges of a range. For a number, that still means min, min-minus-one, max and max-plus-one. That part is not wrong. It is incomplete.</p>
<p>A name field, a date picker and a price are also ranges. If you only test 0, 1, 99 and 100, you have not tested the field the user actually types into.</p>
<p>I also see this when people ask an AI chat for “boundary values.” The model is quick to return integers. It is much less useful unless you tell it what kind of edge you mean, and what the spec actually allows.</p>
<h3>Strings: empty is not the only edge</h3>
<p>Take a display name that is required, trimmed and limited to 50 characters. The edges I want, on the page and in the API, look like this:</p>
<ul>
<li>Empty, and whitespace only. <code>"   "</code> is not a name, even if <code>length</code> is 3.</li>
<li>Untrimmed input. <code>"  Ada  "</code> should become <code>"Ada"</code> if the spec says trim. If it does not say, that is a question, not a guess.</li>
<li>Length 1, 50, 51, and a very long paste.</li>
<li>Unicode, emoji and right-to-left text. A family-emoji sequence can look like one character and count as many.</li>
<li>Newlines and tabs, if the field is supposed to be a single line.</li>
<li>In edit mode, whether a saved 50-character value can be opened and saved again without being rejected.</li>
</ul>
<p>A passing test that types “John” and hits Save does not cover any of that. One bug I watch for: the UI counts characters one way, the API another. The form accepts 50 graphemes. The server rejects the request because it counted code units.</p>
<p>When I write this in Playwright, I assert the message and the stored value, not just that the click succeeded:</p>
<pre><code class="language-js">test('display name rejects whitespace-only input', async ({ page }) =&gt; {
  await page.getByLabel('Display name').fill('   ');
  await page.getByRole('button', { name: 'Save' }).click();
  await expect(page.getByRole('alert')).toHaveText('Enter a display name');
});
</code></pre>
<p>Send the same payload to the API. If the UI trims and the API does not, you have two products.</p>
<h3>Dates: the calendar is not a straight line</h3>
<p>Dates look like numbers. They are not. If a booking can be made on a calendar day, I want:</p>
<ul>
<li>29 February on a leap year, accepted. 29 February on a common year, rejected.</li>
<li>The last day of the month, and the day after. Adding one month to 31 January is not “31 February.” The product has to define it, and the test has to use that definition.</li>
<li>Time zones. A meeting booked at 11:30 PM in Karachi is a different calendar day in New York. If the server stores UTC and the UI shows local time, midnight is a boundary.</li>
<li>DST. In a zone that springs forward, 2:30 AM may not exist. In a zone that falls back, 1:30 AM may exist twice.</li>
<li>End of day. Is 27 November inclusive at 23:59:59.999, or does “through 27 November” stop at midnight?</li>
</ul>
<p>Run the same booking in two time zones, and on a known DST transition for the market you ship to. An AI will often give you “min date” and “max date,” and skip leap years, DST and time zones unless you ask. If the spec does not mention them, the honest output is a question, not a made-up rule.</p>
<h3>Money: rounding is a product decision</h3>
<p>Money is where a green test can still be wrong. Do not use a floating-point type for currency if you can avoid it. Totals still drift this way:</p>
<pre><code class="language-js">(0.1 + 0.1 + 0.1) === 0.3  // false
</code></pre>
<p>The boundaries I want:</p>
<ul>
<li>Zero, the smallest unit (one cent, or zero-decimal currencies like JPY), and a very large amount that still has to stay precise.</li>
<li>Rounding. How does a half-cent become a cent? Half-up, half-even (banker’s rounding), or always away from zero? Use the rule the product claims, not the rule the language uses by default.</li>
<li>Splits and tax. Three ways of $10.00 is not three times $3.33. One of those shares is $3.34, or the product is leaking or inventing a cent.</li>
<li>Currency precision. USD has two decimal places. Some currencies have zero. Some have three. A form that always allows two decimals is already a boundary bug for those.</li>
<li>Conversion and display. A stored integer of 1000 cents must still show as 10.00, not 10, and not 10.0000000002.</li>
</ul>
<p>Assert against the stored minor units, not only the formatted string on the screen. If you only test “price = 10” and “price = 0,” you will not see this class of defect.</p>
<h3>How I use AI on this, without trusting it</h3>
<p>I use AI tools every week. They are fast at drafting a table of cases. They are also confident when the spec is silent.</p>
<p>A weak prompt looks like this:</p>
<blockquote>
<p>Give me boundary values for this form.</p>
</blockquote>
<p>You will get minimums and maximums, mostly for numbers.</p>
<p>A better prompt is specific, and it forbids invention:</p>
<blockquote>
<p>From this spec only, list boundary cases for every field. Include strings (empty, whitespace, trim, length 1 / max / max+1, unicode, emoji, newline), dates (leap years, end of month, time zones, DST, inclusive end dates), and money (zero, smallest unit, rounding, splits, currency precision). Expected results must be observable in the spec. If the spec does not say what should happen, write it as a Question, not as a rule. Do not invent limits.</p>
</blockquote>
<p>Then I review it the way I would any junior tester’s list: drop cases that are not in the spec, add the ones the model missed, and keep only expected results you can see: a message, a count, a stored value, a URL.</p>
<p>The prompt is the easy part. The judgment is deciding what “trim,” “end of month” and “round half-up” actually mean in this product.</p>
<h3>What still needs human judgment</h3>
<p>A model can draft the table. It cannot own the release.</p>
<p>Someone still has to say whether a trailing space is a typo or a different name. Someone still has to define what happens when you add a month to 31 January. Someone still has to pick a rounding rule and live with it in tax, refunds and payouts.</p>
<p>That is the same point I keep coming back to in this newsletter. Tools can scale the mechanical work. Quality remains a human responsibility.</p>
<h3>The takeaway</h3>
<p>The next time you test a field, resist the urge to stop at min and max.</p>
<p>Write the empty string and the untrimmed one. Write 29 February, in a leap year and out of one. Write the split that does not divide cleanly, and the currency that has no cents. If you use an AI to draft the list, ask for those edges by name, and keep the questions the spec does not answer.</p>
<p>SprintSynergy is an AI-based QA automation company: AI testing agents plus our QA team. We use prompts like this so our QA team can spend less time inventing the obvious numeric cases, and more time judging the edges that actually break.</p>
<p>Which field in your product has a passing min and max, and a bug waiting in a string, a date or a currency?</p>
]]></content:encoded></item><item><title><![CDATA[When a Self-Healing Locator Should Say No]]></title><description><![CDATA[Why AI "fixes" need guardrails, and how a deterministic healer refuses a wrong green test.]]></description><link>https://muhammad-usman-sqa.hashnode.dev/when-a-self-healing-locator-should-say-no</link><guid isPermaLink="true">https://muhammad-usman-sqa.hashnode.dev/when-a-self-healing-locator-should-say-no</guid><category><![CDATA[Artificial Intelligence]]></category><category><![CDATA[Testing]]></category><category><![CDATA[playwright]]></category><category><![CDATA[automation testing ]]></category><category><![CDATA[QA]]></category><dc:creator><![CDATA[Muhammad Usman]]></dc:creator><pubDate>Thu, 26 Nov 2026 13:45:11 GMT</pubDate><enclosure url="https://cdn.hashnode.com/uploads/covers/6b06c20d9d94cfcf1a51c657/fe1afbd6-e1de-4884-8eb6-64ea03befe24.png" length="0" type="image/jpeg"/><content:encoded><![CDATA[<p>Every QA lead I know has lived this moment too.</p>
<p>A locator is broken. The id was renamed, or someone typo’d <code>#quantiy</code>. A teammate pastes a new selector from an AI chat. The test goes green. The pull request moves on.</p>
<p>And we tell ourselves the test is healed.</p>
<p>After 10+ years in Quality Assurance, I have learned that a wrong locator that passes is more dangerous than a red test you can still see. A failing test asks a question. A guessed heal answers a different one. You didn’t learn whether the new locator still points at the same element. You only learned that the next run passed.</p>
<p>The last edition was about not naming a failure “flaky” too early. This one is about the next habit that hides the truth: letting a “fix” rewrite a locator without proving it.</p>
<h3>An AI rewrite is a suggestion, not a proof</h3>
<p>I use AI tools every week. They are fast at proposing a <code>getByRole</code> or a CSS selector. They are also confident when they should not be.</p>
<p>A model can invent a locator that matches something else on the page: a nearby button with a similar name, a decoy heading, a link that looks like a button. If the only check is “did the test pass?”, a wrong heal looks like a success. That is how a test stops verifying the thing you thought it was verifying.</p>
<p>This is why I do not want a healer that always says yes. I want one that will refuse, and tell me why.</p>
<h3>A heal has to earn its keep</h3>
<p>A safe heal is not “find anything that makes the test green.” It has to clear a short list.</p>
<p>The failure has to be a locator problem, from the error evidence, not from a hunch. An assertion that failed because the text was wrong, or because a resolved element was the wrong count, is an app problem. Healing will not fix it, and it should not try.</p>
<p>The replacement has to still carry the original element’s identity. A candidate that only looks similar is not enough.</p>
<p>The previously failing test has to pass on a re-run. If that re-run fails, the file should go back to what it was, byte for byte.</p>
<p>And if the match is ambiguous, if the kind is wrong, if a <code>.first()</code> or <code>.nth()</code> was deleted, or if the failure is not a locator problem at all, the honest output is a refusal with a reason.</p>
<p>The principle is simple. A wrong locator that passes today is worse than a red test you can see.</p>
<h3>When it should say no</h3>
<p>A kind mismatch. The original selector said what kind of element it meant. <code>#register-button</code> is a button. A <code>.fill()</code> target is a text input. A candidate of a conflicting kind should be refused, however well the name matched:</p>
<blockquote>
<p>kind mismatch: expected button, candidate is link</p>
</blockquote>
<p>Ambiguity. Nothing should be picked from a set of close matches. The refusal should name them:</p>
<blockquote>
<p>ambiguous on route /: several close matches (#contact-email, #backup-email), refusing to guess</p>
</blockquote>
<p>A deleted positional disambiguator. If a locator now matches three elements, a guessed <code>.first()</code> might pass the re-run and silently change what the test checks. The tool should refuse, and tell you what distinguishes the matches, instead of inventing a position.</p>
<p>And failures that are not locator problems. If the element resolved, and the assertion is what failed, healing the selector will not help:</p>
<blockquote>
<p>shows the done status — not a locator problem, healing won't fix this
    Error: expect(locator).toHaveText(expected) failed</p>
</blockquote>
<p>That last case is easy to miss when you are staring at a red test and an AI chat is already offering a new locator.</p>
<h3>This is slow to do by hand. That’s where a tool helps.</h3>
<p>Our QA team does this work on broken locators in Playwright, Cypress, and Selenium tests, written in JavaScript or TypeScript. The method is the same whether you do it yourself or with help: classify the failure from the evidence, probe the page the test actually failed on, propose a replacement only when the identity holds, re-run the previously failing test, and refuse when a guess would be required.</p>
<p>That is why we built <a href="https://github.com/sprintsynergyio/qa-core-heal">qa-core-heal</a>, an open-source CLI on npm. It is not a model guessing at your selectors. There is no LLM and no API key. The engine is deterministic: same page, same broken locator, same replacement, every time.</p>
<p>If you already have a failing Playwright spec, this is the command:</p>
<pre><code class="language-sh">npm i -D qa-core-heal
npx qa-core-heal tests/login.spec.ts
</code></pre>
<p>Zero config. If everything already passes, it prints <code>All tests passing. Nothing to heal.</code> and exits, with no scanning, no probing, and no browser.</p>
<p>On a locator typo, the current README run looks like this. The broken id is <code>#quantiy</code>. It climbs the heal ladder, starting with role and accessible name, and proposes a semantic locator:</p>
<pre><code class="language-text">  tests/login.spec.ts:
    → broken: page.locator('#quantiy')
    ✓ healed to page.getByRole("textbox", {"name":"quantity"})  (level=role)

Proposed heals (1):

  tests/login.spec.ts:6
    - page.locator('#quantiy')
    + page.getByRole("textbox", {"name":"quantity"})

Apply 1 heal(s)? [y/N] y
▸ Verifying: re-running 1 previously failing test(s)
  ✓ re-run passed
</code></pre>
<p>It asks before it writes. <code>--dry-run</code> never writes. It never commits. Applying approved diffs to your working tree is the maximum action. You review, you commit.</p>
<p>The page comes from the Playwright trace, so a locator that breaks three clicks deep is probed on the page it actually failed on, not on the homepage. Only the previously failing tests are re-run to verify. Every applied heal lands in <code>.qa-core/heal-log.jsonl</code> with a verified flag. A failed re-run reverts the file byte for byte.</p>
<p>On the 16 public eval suites in the repo (168 locators, 104 of them deliberately broken), measured under Playwright 1.60, that discipline holds: 72 of 72 healable breaks were fixed and verified by a passing re-run, 32 of 32 unhealable breaks were refused instead of guessed, 10 of 10 intact locators were left untouched, no valid locator was wrongly rewritten, and no heal pointed at the wrong element. Two full runs produced byte-identical results. That is a pinned suite in the repo, not a promise about every app you will ever point it at. You can run the same harness with <code>npm run evals</code>.</p>
<p>It also has limits I will not hide. A heal is correct against today’s page; a later redesign can invalidate it, which is why the default is to re-verify on every run. It cannot see silent positional drift: if a list reorders, <code>li:nth-child(2)</code> still resolves, to a different row, and is reported intact. Hash-suffixed generated ids heal only when the element offers a second identity. And it will not heal a state-dependent element from a static scan of the page as it first loads. The run-first default closes most of the URL side of that gap, because it probes the page the test actually failed on.</p>
<h3>What still needs human judgment</h3>
<p>A tool can classify the error, walk the heal ladder, and refuse a guess. It cannot own the release.</p>
<p>Someone still has to read the diff and decide whether the new locator is the contract you want. Someone still has to decide whether the element was renamed, or whether the button is genuinely gone. Someone still has to say whether the change is safe to commit.</p>
<p>A verified heal is still a change to what the test targets. Treat it like any other patch.</p>
<p>That is the same point I keep coming back to in this newsletter. Tools can scale the mechanical work. Quality remains a human responsibility.</p>
<h3>The takeaway</h3>
<p>The next time a locator breaks, resist the urge to paste the first AI suggestion and ship it.</p>
<p>Read the error. Ask whether this is even a locator failure. If a replacement is offered, ask whether it still carries the original element’s identity, and whether the previously failing test passed on a re-run. If the match is messy, say no, and keep the red test visible.</p>
<p>If you want help doing that on a real spec, try qa-core-heal. It is free, open source, and it will refuse when a guess would be required:</p>
<p><a href="https://github.com/sprintsynergyio/qa-core-heal">github.com/sprintsynergyio/qa-core-heal</a></p>
<p><a href="https://www.npmjs.com/package/qa-core-heal">npmjs.com/package/qa-core-heal</a></p>
<p>SprintSynergy is an AI-based QA automation company: AI testing agents plus our QA team. We use tools like this so our QA team can spend less time guessing at broken locators, and more time judging the risk.</p>
<p>When did a “fixed” locator last pass for your team while pointing at the wrong element?</p>
]]></content:encoded></item><item><title><![CDATA[A Flaky Test or a Real Bug? Start With the Evidence]]></title><description><![CDATA[How to tell a flaky Playwright test from a real bug using evidence, with qa-core-flaky, SprintSynergy's open-source triage CLI.]]></description><link>https://muhammad-usman-sqa.hashnode.dev/a-flaky-test-or-a-real-bug-start-with-the-evidence</link><guid isPermaLink="true">https://muhammad-usman-sqa.hashnode.dev/a-flaky-test-or-a-real-bug-start-with-the-evidence</guid><category><![CDATA[Artificial Intelligence]]></category><category><![CDATA[Testing]]></category><category><![CDATA[playwright]]></category><category><![CDATA[automation testing ]]></category><category><![CDATA[QA]]></category><dc:creator><![CDATA[Muhammad Usman]]></dc:creator><pubDate>Wed, 25 Nov 2026 11:47:46 GMT</pubDate><enclosure url="https://cdn.hashnode.com/uploads/covers/6b06c20d9d94cfcf1a51c657/a31d6644-ffe7-4463-b855-742d1cd74671.png" length="0" type="image/jpeg"/><content:encoded><![CDATA[<h3>How to triage Playwright failures without guessing, rerunning blindly, or loosening the assertion</h3>
<p>Every QA lead I know has lived this moment.</p>
<p>CI goes red. Someone says, “It’s probably flaky.” Someone hits rerun. The job goes green. The pull request moves on.</p>
<p>And we tell ourselves we handled it.</p>
<p>After 10+ years in Quality Assurance, I have learned that this habit is more dangerous than a failing test. A red build asks a question. A blind rerun answers a different one. You didn’t learn whether the product broke, whether the test is unstable, or whether the environment hiccupped. You only learned that the next attempt passed.</p>
<p>In January I wrote that I have seen teams spend more time fixing tests than finding defects, and delay a release not because of a bug, but because the automation itself was broken. Flaky Playwright tests are often how that starts.</p>
<p>So this edition is practical. Not another argument about automation. A way to triage a failure before you decide what it is.</p>
<h3>The mistake is naming it too early</h3>
<p>“Flaky” is a verdict. It is not a starting point.</p>
<p>A test that failed once and passed once might be unstable. It might also be a real defect that only appears under load, a race in the app, shared test data, or a network drop. If you label it flaky too early, you stop looking.</p>
<p>A useful first question is not “should we rerun it?” It is this:</p>
<p>Did this test pass and fail on the same code?</p>
<p>If it failed on every attempt, and the error is the same, you may be looking at a likely real bug, a broken locator, or an environment issue. If you only have one failed attempt, you do not have a diagnosis yet. You need more runs.</p>
<p>The second question is: what does the error actually say?</p>
<p>Not the summary line. The words in the log.</p>
<h3>Read the evidence, then put it in a bucket</h3>
<p>When I sit with a Playwright failure, I try to put it into one of a few buckets, using the error text, not a hunch:</p>
<ul>
<li><strong>Selectors.</strong> The locator never found the element, found zero elements, or hit a strict mode violation. A typo in a role name lives here.</li>
<li><strong>Timing.</strong> The test ran out of time, a wait was too short, or the page was still loading. A locator that did resolve, but the element was still hidden, is often timing, not a missing selector.</li>
<li><strong>Environment.</strong> A disconnected network, a connection refused, a 5xx from the server. Infrastructure, not the assertion.</li>
<li><strong>Test data.</strong> The record already existed, the fixture was dirty, or two tests shared state.</li>
<li><strong>Unknown, for now.</strong> The expected value and the received value don’t match, and the error doesn’t point to a locator or a timeout. That can still be a real product bug. It can also be a bad assumption in the test.</li>
</ul>
<p>Two rules save a lot of pain.</p>
<p>Don’t loosen the assertion just to make the test pass. If the page said “Ready” and the test expected a different heading, the interesting work is to decide which one is wrong.</p>
<p>And don’t hide the first failure behind retries. Playwright retries are useful, but a retry that turns a fail into a pass can bury the original error. If you collect more attempts, keep that first failure visible.</p>
<p>Prefer a Playwright JSON report when you can. It keeps every retry attempt. A default JUnit report usually does not.</p>
<h3>This is slow to do by hand. That’s where a tool helps.</h3>
<p>Our QA team does this work on Playwright reports. The method is the same whether you do it yourself or with help: parse every attempt the report contains, quote the evidence, name a likely cause, and only then suggest a next step.</p>
<p>That is why we built <a href="https://github.com/sprintsynergyio/qa-core-flaky">qa-core-flaky</a>, an open-source CLI on npm. It is not a model guessing at your tests. The likely causes are deterministic rules. The verdict engine does not call a model. It reads a Playwright JSON report or a JUnit XML report and writes a triage report you can share.</p>
<p>If you already have a JSON report from Playwright, this is the command:</p>
<pre><code class="language-sh">npm i -D qa-core-flaky
npx qa-core-flaky triage &lt;report.json&gt; --out-dir out --html
</code></pre>
<p>It writes <code>triage.json</code>, <code>triage.md</code>, and a self-contained HTML report. Passed tests are not listed. Home usernames and token-like strings are hidden by default, so the HTML file is the one I would send to a colleague.</p>
<p>I ran the published package, version 0.1.2, against its own Playwright fixture report. Three failures came back as three different verdicts.</p>
<p><code>always fails</code> was a <strong>likely real bug</strong>, with medium confidence. Every attempt failed with the same signature. The evidence was plain:</p>
<blockquote>
<p>Expected: "a different heading"
Received: "Ready"</p>
</blockquote>
<p>The suggested fix was to compare those values with what the user sees, and not loosen the assertion. “Likely” is the right word. The report does not say the bug is confirmed, and neither should we.</p>
<p><code>flaky by retry</code> was <strong>flaky</strong>, with low confidence, because there were only two attempts: one pass and one fail on the same code. The report also added a sentence I agree with: “A flaky test can still point to a real app defect. Check the app behavior too.”</p>
<p><code>times out</code> was <strong>needs more runs</strong>. The locator <code>getByRole('button', { name: 'Never Appears' })</code> never resolved, and the test timed out at 1000ms. That is a signal, not a final verdict. The next step is more attempts, with the first failure still visible.</p>
<p>On a recorded run against the public SauceDemo practice app, the same kind of report is easier to show a team. One test, “login page loads after a network drop,” was marked flaky with high confidence. The evidence was a single line:</p>
<blockquote>
<p>Error: page.goto: net::ERR_INTERNET_DISCONNECTED at <a href="https://www.saucedemo.com/">https://www.saucedemo.com/</a></p>
</blockquote>
<p>The suggested fix was to check the network and the base URL, and to keep retries only for infrastructure errors. That is a very different conversation from “the login test is flaky.”</p>
<p>If you want more attempts, <code>rerun</code> will collect them. It defaults to <code>--retries 0</code>, so a retry inside the rerun cannot hide the first failure.</p>
<h3>What still needs human judgment</h3>
<p>A tool can quote the error and apply a decision table. It cannot own the release.</p>
<p>Someone still has to decide whether the locator is wrong or the button is genuinely missing. Someone still has to decide whether to fix the test, fix the app, or fix the environment. Someone still has to say whether the build is safe to ship.</p>
<p>A flaky verdict can still be an app defect that only appears sometimes. Shared state, a race in the UI, a slow API: those are product problems that show up as unstable tests.</p>
<p>That is the same point I keep coming back to in this newsletter. Tools can scale the mechanical work. Quality remains a human responsibility.</p>
<h3>The takeaway</h3>
<p>The next time a Playwright test fails, resist the urge to start with a rerun.</p>
<p>Open the report. Look at every attempt. Ask whether a pass and a fail share the same code. Quote the error. Put it in a bucket. If you only have one failure, say so, and collect more evidence without burying the first one.</p>
<p>If you want help doing that on a real report, try qa-core-flaky. It is free, open source, and takes a JSON or JUnit file you already have:</p>
<p><a href="https://github.com/sprintsynergyio/qa-core-flaky">github.com/sprintsynergyio/qa-core-flaky</a></p>
<p><a href="https://www.npmjs.com/package/qa-core-flaky">npmjs.com/package/qa-core-flaky</a></p>
<p>SprintSynergy is an AI-based QA automation company: AI testing agents plus our QA team. We use tools like this so our QA team can spend less time guessing at red builds, and more time judging the risk.</p>
<p>What’s the last failure your team reran without reading the error?</p>
]]></content:encoded></item></channel></rss>