<?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[Salekin Newaz]]></title><description><![CDATA[Salekin Newaz]]></description><link>https://salekinnewaz.hashnode.dev</link><generator>RSS for Node</generator><lastBuildDate>Sat, 05 Dec 2026 19:34:34 GMT</lastBuildDate><atom:link href="https://salekinnewaz.hashnode.dev/rss.xml" rel="self" type="application/rss+xml"/><language><![CDATA[en]]></language><ttl>60</ttl><item><title><![CDATA[API Contract Testing and k6 Load Testing in One Pipeline]]></title><description><![CDATA[How I pair a consumer-driven contract check with a k6 load test so a breaking API change or a capacity regression is caught before release, not after.]]></description><link>https://salekinnewaz.hashnode.dev/api-contract-and-k6-load-testing-playbook</link><guid isPermaLink="true">https://salekinnewaz.hashnode.dev/api-contract-and-k6-load-testing-playbook</guid><category><![CDATA[playwright]]></category><category><![CDATA[Testing]]></category><category><![CDATA[api]]></category><category><![CDATA[performance]]></category><dc:creator><![CDATA[Md Salekin Newaz]]></dc:creator><pubDate>Thu, 03 Dec 2026 17:07:37 GMT</pubDate><content:encoded><![CDATA[<h1>API Contract Testing and k6 Load Testing in One Pipeline</h1>
<p>How I pair a consumer-driven contract check with a k6 load test so a breaking API change or a capacity regression is caught before release, not after.</p>
<h2>Two failures, one shape</h2>
<p>A contract break and a capacity regression look nothing alike to a user, but they are the same kind of failure to a release process: a change that was fine in isolation and is not fine in combination.</p>
<p>The API team changed a field type. The field was optional in every test fixture, so nothing caught it — and the first consumer to read it crashed in production. Separately, a caching change took the service from three hundred to eleven hundred requests per second, and the p95 latency went from 40ms to 2.4s under the same load.</p>
<p>Both were caught after release in this case. This article is about the pipeline that catches them before.</p>
<ul>
<li>Contract breaks hide behind optional fields and untested default values</li>
<li>Capacity regressions hide behind load the staging environment never sees</li>
<li>Both are cheap to catch in CI and expensive to catch in production</li>
</ul>
<h2>The contract half: check the producer against what consumers actually use</h2>
<p>The mistake in most contract testing setups is testing the API against a document of what the API is supposed to be. That document is always slightly wrong, and it is wrong in the direction that hides breakage.</p>
<p>A consumer-driven contract records what each consumer actually depends on, and verifies the provider against those records. The consumer defines the contract, the provider is tested against it, and the provider publishes the contract it has agreed to.</p>
<p>The hard part is not the tooling, it is the discipline of not adding a field to the contract because "it might be useful". Every contract line is a promise to maintain, and a contract that promises everything promises nothing.</p>
<pre><code class="language-typescript">import { test, expect } from '@playwright/experimental-ct';
import { pact } from '@pact-foundation/pact';
import { orderService } from './order-service';

// The consumer states what it depends on. Not what the API could
// offer — what this client actually reads.
pact.given('an order with a pending payment')
  .uponReceiving('a GET request for /orders/42')
  .willRespondWith({
    status: 200,
    headers: { 'Content-Type': 'application/json' },
    body: {
      id: pact.integer(42),
      status: 'PENDING',
      // The consumer reads this field. It is the whole reason
      // this contract exists — if the type changes, this test fails
      // in the provider's build, not in production.
      total: pact.decimal(129.95),
      currency: 'USD',
    },
  });

test('the order page renders a pending order', async ({ page }) =&gt; {
  await page.goto('/orders/42');
  await expect(page.getByTestId('order-total')).toHaveText('$129.95');
});
</code></pre>
<ul>
<li>The contract is written from the consumer's side, so it captures real usage rather than aspiration</li>
<li>Only the fields the consumer actually reads belong in the contract</li>
<li>A provider change that breaks a contract fails the provider's pipeline, not the consumer's</li>
<li>Contracts are versioned — a breaking change is a new version, never an in-place edit</li>
</ul>
<h2>The load half: k6 measures what staging cannot</h2>
<p>Staging has the wrong shape for a load test. It is smaller than production, its data volume is a fraction, and its dependencies are stubs or lower environments. A test that passes against staging tells you the code path works, not that it holds.</p>
<p>k6 is useful here because the test script is plain JavaScript, it runs fast, and the thresholds are declarative — you write down the number that matters and the test fails when the number is missed.</p>
<p>The most important decision is what the thresholds actually are. Latency percentiles beat averages, and the p95 at a stated concurrency is a contract you can hold a release to.</p>
<pre><code class="language-javascript">import http from 'k6/http';
import { check, sleep } from 'k6';

export const options = {
  scenarios: {
    steady: {
      executor: 'ramping-vus',
      startVUs: 0,
      stages: [
        { duration: '30s', target: 50 },
        { duration: '1m', target: 50 },
        { duration: '30s', target: 0 },
      ],
    },
  },
  thresholds: {
    // A threshold is a contract the release is held to. p95, not
    // the average — an average hides the tail that hurts users.
    'http_req_duration{scenario:steady}': ['p(95)&lt;400'],
    'http_req_failed{scenario:steady}': ['rate&lt;0.01'],
    // The throughput the service has to sustain, asserted explicitly
    // so a silent capacity drop cannot pass.
    'http_reqs': ['count&gt;20000'],
  },
};

const BASE = __ENV.BASE_URL;

export default function () {
  const res = http.get(`${BASE}/api/orders/42`, {
    headers: { Authorization: `Bearer ${__ENV.TOKEN}` },
  });
  check(res, {
    'status is 200': (r) =&gt; r.status === 200,
    'body has total': (r) =&gt; r.body.includes('total'),
  });
  sleep(1);
}
</code></pre>
<ul>
<li>Write the threshold before you write the test — a threshold chosen after seeing the result is not a threshold</li>
<li>p95, not average: the average hides exactly the tail that hurts</li>
<li>Assert the request count, so a run that quietly did nothing cannot pass</li>
<li>Run against an environment shaped like production, or the numbers are fiction</li>
</ul>
<h2>Running both without making the pipeline unbearable</h2>
<p>A load test in every pull request is a way to guarantee your pipeline gets ignored. The load test is slow, it is sensitive to noisy neighbours on shared runners, and its failure mode is often environmental rather than a real regression.</p>
<p>So it runs on a schedule and on the release branch, not on every push. The contract check runs on every pull request, because it is fast and deterministic — a contract break is a real break and should be caught at the moment the change is proposed.</p>
<p>The division of labour is the whole design. Fast deterministic checks gate every merge; slow environment-sensitive checks gate the release. Splitting by that line is what keeps both of them credible.</p>
<pre><code class="language-yaml">name: contract-and-load

on:
  pull_request:
    branches: [main]
  schedule:
    - cron: '0 3 * * 1-5'
  workflow_dispatch:

jobs:
  contract:
    # Fast and deterministic — runs on every PR.
    runs-on: ubuntu-latest
    timeout-minutes: 10
    steps:
      - uses: actions/checkout@v4
      - run: npm ci
      - run: npm run test:contract

  load:
    # Slow and environment-sensitive — runs on a schedule and on
    # demand, never on every push.
    if: github.event_name != 'pull_request'
    needs: contract
    runs-on: ubuntu-latest
    timeout-minutes: 30
    steps:
      - uses: actions/checkout@v4
      - run: npm ci
      - run: k6 run --summary-export=load-summary.json load/api.js
      - uses: actions/upload-artifact@v4
        with:
          name: k6-summary
          path: load-summary.json
</code></pre>
<h2>Reading the results honestly</h2>
<p>Both tools will lie to you if you let them. The contract test passes against a provider that has not deployed the change yet. The load test passes against an environment with a warm cache or a quiet neighbour.</p>
<p>The guard against the first is ordering: the contract verification must run against the branch under test, and a green contract check means nothing if it ran against production. The guard against the second is repeating — a load number that only holds once is a measurement of the noise.</p>
<p>And both need a human to be willing to read the output when it fails in a new way. A gate that produces a number is easy to trust blindly; the failure modes worth catching are often the ones that show up as a threshold that was crossed for the wrong reason.</p>
<ul>
<li>A contract check must run against the branch under test, never against production</li>
<li>A load number that holds once is a measurement of the noise — repeat it</li>
<li>Keep the raw summary as a build artifact so a failure can be compared against the previous run</li>
<li>If a threshold is routinely flaky, the threshold is wrong; fix it or delete it</li>
</ul>
<h2>The takeaway</h2>
<p>Contract testing and load testing look like separate disciplines and are bought for separate reasons, but they defend against the same failure: a change that is fine alone and broken in company. The contract check defends the shape of the interface; the load check defends its behaviour under pressure.</p>
<p>The pipeline shape that makes both work is unglamorous: run the fast deterministic one everywhere, run the slow sensitive one on a schedule and on the release branch, and keep the thresholds written down before the numbers are known.</p>
<h2>Key takeaways</h2>
<ul>
<li>Test the provider against what consumers actually read, not against a spec that hides breakage.</li>
<li>A contract line is a maintenance promise — a contract that promises everything promises nothing.</li>
<li>p95 beats the average; the average hides exactly the tail that hurts users.</li>
<li>Assert the request count, so a load run that did nothing cannot pass.</li>
<li>Split by determinism: fast checks gate every merge, slow checks gate the release.</li>
<li>A green contract check against production proves nothing — run it against the branch.</li>
</ul>
]]></content:encoded></item><item><title><![CDATA[Playwright Quality Gates That Actually Block a Release]]></title><description><![CDATA[A CI pipeline that goes green is not the same as a pipeline that protects you. How I turned a Playwright suite into real release gates — and what it took…]]></description><link>https://salekinnewaz.hashnode.dev/playwright-ci-quality-gates-zero-rollback</link><guid isPermaLink="true">https://salekinnewaz.hashnode.dev/playwright-ci-quality-gates-zero-rollback</guid><category><![CDATA[playwright]]></category><category><![CDATA[CI/CD]]></category><category><![CDATA[Testing]]></category><category><![CDATA[QualityAssurance]]></category><dc:creator><![CDATA[Md Salekin Newaz]]></dc:creator><pubDate>Thu, 03 Dec 2026 15:14:20 GMT</pubDate><content:encoded><![CDATA[<h1>Playwright Quality Gates That Actually Block a Release</h1>
<p>A CI pipeline that goes green is not the same as a pipeline that protects you. How I turned a Playwright suite into real release gates — and what it took to reach zero rollbacks.</p>
<h2>A green build that protected nothing</h2>
<p>The pipeline I inherited reported green on every merge. The badge was green, the deploy went out, and the release still went wrong — three times in one quarter. Nothing in the pipeline had failed, which is exactly the problem: the pipeline had no opinion.</p>
<p>The tests were not few. There were several hundred of them and they mostly passed. But "mostly passed" is not a gate. A pipeline that cannot say no is a report, not a gate, and the distinction matters more than the number of tests.</p>
<p>This is the article about turning that pipeline into something that can actually block a release, and the two things that had to change before it could.</p>
<ul>
<li>The suite passed, but nothing was allowed to fail on it — there was no branch protection on the check</li>
<li>Tests ran on every push to every branch, including draft branches, so the signal was diluted</li>
<li>A failure cost a developer the full CI duration before they saw it</li>
<li>The suite ran in one browser on one platform, so "green" meant very little</li>
</ul>
<h2>Gate one: a failure must be able to block the merge</h2>
<p>Before anything else, the check had to be attached to a rule that actually stops a merge. That is a repository setting, not a test, and it is where most pipelines fail silently — the suite is green enough, but nothing requires it.</p>
<p>The rule I wanted was specific: the Playwright check must pass before the pull request can be merged, and it must not be skippable by a maintainer clicking through. That last part is the uncomfortable bit. A gate that a maintainer can override is fine for a hotfix at 2am; it is not a gate for the other ninety-nine merges a week.</p>
<pre><code class="language-yaml">name: e2e

on:
  pull_request:
    branches: [main]

jobs:
  e2e:
    runs-on: ubuntu-latest
    timeout-minutes: 20
    strategy:
      fail-fast: false
      matrix:
        browser: [chromium, firefox]
    steps:
      - uses: actions/checkout@v4
      - uses: actions/setup-node@v4
        with:
          node-version: 20
          cache: npm
      - run: npm ci
      - run: npx playwright install --with-deps ${matrix.browser}
      - run: npx playwright test --project=${matrix.browser}
      - uses: slackapi/slack-github-action@v1
        if: failure()
        with:
          payload: |
            {
              "text": "E2E failed on ${matrix.browser}: ${{ github.server_url }}/${{ github.repository }}/actions/runs/${{ github.run_id }}"
            }
</code></pre>
<ul>
<li>The check runs on pull requests to <code>main</code> only — not on every push to every branch</li>
<li><code>fail-fast: false</code> so one browser failing does not cancel the other; you want the full matrix</li>
<li>A hard <code>timeout-minutes</code> on the job, so a hung test run cannot sit in a queue for an hour</li>
<li>The reporter writes the triage summary, and the Slack step posts the link to the run</li>
</ul>
<h2>Gate two: the suite has to be trustworthy before it can block anything</h2>
<p>The second gate is less obvious, and it is the one that took longer. A blocking gate that is flaky is worse than no gate at all, because the team learns that red means "retry", and then the red genuinely stops meaning anything.</p>
<p>So before the suite was allowed to block, it had to become boring. Not fast — reliable is a different property from fast, and confusing the two is how teams end up with a gate that is quick and useless.</p>
<p>The work was mostly not in the tests. It was in three places: making failures deterministic, making the suite able to run in parallel without interfering with itself, and giving each failure a classification so a human could tell a product bug from an environment problem in one glance.</p>
<ul>
<li>Flaky tests were fixed or deleted, never retried into green — a quarantined test is a bug with extra steps</li>
<li>Each test provisions its own data; no test depends on another having run first</li>
<li>Timeouts were explicit per test, not a global default applied to every assertion</li>
<li>Failures were classified into categories so a signal failure could be dismissed without reading the log</li>
</ul>
<h2>Making the gate fast enough to keep</h2>
<p>A blocking gate has to return its verdict quickly. A twenty-minute wait is a twenty-minute wait in which a developer is blocked, and a blocked developer is a developer who starts merging around the gate rather than through it.</p>
<p>The single biggest win was not raw speed — it was running the suite in parallel shards, and splitting the run so the fast, high-signal tests finished first and reported immediately, while the slower end-to-end paths continued in the background.</p>
<p>That split gives two verdicts instead of one. A quick gate that blocks the obvious breakage, and a slower gate that blocks the subtler breakage. The quick one has to be trustworthy enough to block on its own, which is why it is a curated subset rather than a random sample.</p>
<pre><code class="language-yaml">jobs:
  smoke:
    # The quick gate. Runs the curated fast subset on every PR and
    # blocks the merge on its own.
    runs-on: ubuntu-latest
    timeout-minutes: 8
    steps:
      - uses: actions/checkout@v4
      - run: npm ci
      - run: npx playwright test --project=chromium --grep @smoke

  e2e:
    # The slow gate. Sharded so each shard is a few minutes.
    needs: smoke
    runs-on: ubuntu-latest
    timeout-minutes: 25
    strategy:
      fail-fast: false
      matrix:
        shard: [1, 2, 3, 4]
    steps:
      - uses: actions/checkout@v4
      - run: npm ci
      - run: npx playwright test --project=chromium --shard=${{ matrix.shard }}/4
</code></pre>
<h2>The part nobody expects: what the gate does about its own failures</h2>
<p>The gate will eventually be wrong. An environment will break, a dependency will be flaky in a way you did not predict, and the pipeline will block a merge that should have gone through. When that happens, the correct response is a documented, fast, visible escape hatch — not a silent retry.</p>
<p>I settled on a two-layer model. The normal path is a hard block. The escape path is an explicit, audited override: a label on the pull request that a maintainer applies, which re-runs the job against a quarantined path and posts a comment saying who bypassed what and why.</p>
<p>The important property is that the escape hatch is loud. It appears in the pull request, it leaves a trail, and the metric I actually watch is not the pass rate — it is the <em>override</em> rate. An override rate that climbs tells you the gate is miscalibrated, and that is a signal worth more than a perfect green pipeline.</p>
<ul>
<li>Never a silent retry — a retry turns a real signal into a coin flip</li>
<li>The override is a labelled, commented, attributable action, not a button</li>
<li>Track override rate alongside pass rate; it measures whether the gate fits the team</li>
<li>A failing gate is a signal to fix the gate, not a reason to delete the gate</li>
</ul>
<h2>What zero rollbacks actually required</h2>
<p>The outcome of this work was not a faster pipeline. It was three releases in a row with no rollback, and — more usefully — a pipeline that had opinions.</p>
<p>The thing that changed most was cultural rather than technical. Once red meant something, people stopped shipping on a "probably fine" judgement, and started asking the pipeline instead. That is the actual return on a quality gate: not the blocked merges, but the merges that stopped happening by assumption.</p>
<p>If you are starting from a green-but-useless pipeline, the order I would use is: attach the check to a real branch rule, fix the flakiness, split the suite into a fast gate and a slow gate, and only then add the override escape hatch. Doing the override first trains everyone that red is negotiable, and that is a habit you cannot unlearn cheaply.</p>
<h2>Key takeaways</h2>
<ul>
<li>A check that nothing depends on is a report, not a gate — branch protection is the part that actually blocks.</li>
<li>Fix flakiness before you let a suite block, or the team learns that red means retry.</li>
<li>Split the suite: a fast curated gate for immediate signal, a slow sharded gate for the deep paths.</li>
<li>A timeout on the job is not a nicety; a hung run otherwise burns the whole CI budget.</li>
<li>Make the override loud and attributable, and track the override rate — it tells you if the gate fits.</li>
<li>Zero rollbacks came from the team asking the pipeline instead of shipping on assumption.</li>
</ul>
]]></content:encoded></item><item><title><![CDATA[Building a Zero-Dependency Playwright Summary Reporter]]></title><description><![CDATA[Why I shipped a GitHub Actions summary reporter with no runtime dependencies — and the design decisions that kept it that way, plus what it looks like in a…]]></description><link>https://salekinnewaz.hashnode.dev/zero-dependency-playwright-summary-reporter</link><guid isPermaLink="true">https://salekinnewaz.hashnode.dev/zero-dependency-playwright-summary-reporter</guid><category><![CDATA[playwright]]></category><category><![CDATA[ci-cd]]></category><category><![CDATA[github-actions]]></category><category><![CDATA[Testing]]></category><category><![CDATA[TypeScript]]></category><category><![CDATA[open source]]></category><category><![CDATA[Devops]]></category><dc:creator><![CDATA[Md Salekin Newaz]]></dc:creator><pubDate>Thu, 03 Dec 2026 14:13:20 GMT</pubDate><content:encoded><![CDATA[<h1>Building a Zero-Dependency Playwright Summary Reporter</h1>
<p>Why I shipped a GitHub Actions summary reporter with no runtime dependencies — and the design decisions that kept it that way, plus what it looks like in a real CI log.</p>
<h2>The problem: the summary is where nobody looks</h2>
<p>Every CI pipeline has the same gap. The artifacts live, the logs are twelve thousand lines, and the one thing a human actually wants — did it pass, which specs failed, how long did it take — is buried in scroll.</p>
<p>GitHub solved the reading problem years ago with <code>GITHUB_STEP_SUMMARY</code>: write Markdown to a file in the environment and it renders at the top of the job. But the reporter that fills it is usually a dependency. And a dependency in a reporter is a dependency every consumer now inherits, audits, and eventually upgrades.</p>
<h2>The zero-dependency constraint</h2>
<p>I set the rule before writing a line: this reporter must add nothing to a consumer's dependency graph. No markdown library, no date library, no table renderer. Playwright is a peer dependency and is not installed.</p>
<p>It sounds like a constraint that costs a lot of convenience. In practice it costs one thing — the table has to be built by string concatenation — and it buys something much larger. A consumer can add this reporter to a locked, audited pipeline and know that the tree did not change.</p>
<pre><code class="language-typescript">import type { FullResult, Reporter } from '@playwright/test/reporter';
import { appendFile } from 'node:fs/promises';

// Resolve GITHUB_STEP_SUMMARY. Absent outside GitHub Actions, and the
// reporter simply becomes a no-op — it must never break a local run.
const summaryFile = process.env.GITHUB_STEP_SUMMARY;

// A minimal table builder. No dependency, no library — just pipes.
function table(headers: string[], rows: string[][]): string {
  const line = (cells: string[]) =&gt; `| ${cells.join(' | ')} |`;
  const sep = `| ${headers.map(() =&gt; '---').join(' | ')} |`;
  return [line(headers), sep, ...rows.map(line)].join('\n');
}

class SummaryReporter implements Reporter {
  private started = Date.now();

  onBegin(): void {
    this.started = Date.now();
  }

  async onEnd(result: FullResult): Promise&lt;void&gt; {
    if (!summaryFile) return;

    const duration = ((Date.now() - this.started) / 1000).toFixed(1);
    const rows = this.browsers.map((b) =&gt; [
      b.name,
      `${b.passed}/${b.total}`,
      `${b.failed} failed`,
      `${b.duration}s`,
    ]);

    const markdown = [
      '### Playwright Results',
      '',
      table(['Browser', 'Passed', 'Failed', 'Duration'], rows),
      '',
      `**Status:** ${result.status} · **Total:** ${duration}s`,
    ].join('\n');

    await appendFile(summaryFile, `${markdown}\n`, 'utf8');
  }
}

export default SummaryReporter;
</code></pre>
<h2>Reading the browser matrix without Playwright internals</h2>
<p>The interesting constraint is per-browser reporting. The reporter API gives you a flat list of test cases, each with a <code>projectName</code> — it does not give you a browser-by-browser breakdown for free.</p>
<p>So the reporter builds its own matrix: it buckets results by project name, tracks the first and last timestamp per bucket to derive duration, and renders a row per browser. It also handles the case where a browser did not run at all — that row still appears, marked skipped, because "Firefox never executed" is information a reviewer needs.</p>
<ul>
<li>Bucket test cases by <code>projectName</code> to reconstruct the browser matrix</li>
<li>Derive per-browser duration from first-to-last timestamp, not from sum of test times</li>
<li>Render rows for browsers that did not run — silence is not the same as success</li>
<li>Write to <code>GITHUB_STEP_SUMMARY</code> only when the env var is present, so local runs are unaffected</li>
</ul>
<h2>The part I would do differently</h2>
<p>I shipped v1 without a "rerun locally" hint in the summary. The single most common reaction from users was "how do I re-run just that failure?", and the answer was buried in CI logs.</p>
<p>The fix was one line in the summary output — a copyable command with the failing project and grep filter already applied. It turned the reporter from "a report" into "the first step of the next action".</p>
<h2>Key Takeaways</h2>
<ul>
<li>Zero runtime dependencies is a real constraint worth honouring — consumers inherit every dependency a reporter adds.</li>
<li><code>GITHUB_STEP_SUMMARY</code> is the right target: it puts the answer at the top of the job, not in the scroll.</li>
<li>A reporter must never break a local run — no-op cleanly when the CI env var is absent.</li>
<li>Reconstruct the browser matrix yourself; the reporter API gives you a flat case list, not a breakdown.</li>
<li>Put the re-run command in the summary. A report should be the first step of the next action.</li>
</ul>
<hr />
<p><em>Md Salekin Newaz is a Senior Software QA Engineer and ISTQB® Certified professional at Brain Station 23, based in Dhaka, Bangladesh and working with global clients on Playwright automation, AI-driven QA and CI/CD integration.</em> <a href="https://salekin-dev.vercel.app"><em>See his portfolio and case studies</em></a> <em>— or</em> <a href="https://salekin-dev.vercel.app/resume"><em>read his resume</em></a><em>.</em></p>
]]></content:encoded></item><item><title><![CDATA[Playwright Summary Reporter: Simplifying Playwright CI/CD Failure Analysis]]></title><description><![CDATA[How I built an open-source Playwright custom reporter to simplify CI/CD test result analysis, generate actionable failure summaries, and improve debugging…]]></description><link>https://salekinnewaz.hashnode.dev/playwright-summary-reporter</link><guid isPermaLink="true">https://salekinnewaz.hashnode.dev/playwright-summary-reporter</guid><category><![CDATA[playwright]]></category><category><![CDATA[Testing]]></category><category><![CDATA[ci-cd]]></category><category><![CDATA[github-actions]]></category><category><![CDATA[TypeScript]]></category><category><![CDATA[QA automation]]></category><category><![CDATA[Devops]]></category><dc:creator><![CDATA[Md Salekin Newaz]]></dc:creator><pubDate>Thu, 03 Dec 2026 14:12:13 GMT</pubDate><content:encoded><![CDATA[<h1>Playwright Summary Reporter: Simplifying Playwright CI/CD Failure Analysis</h1>
<p>A Playwright run produces everything you need to diagnose a failure — the assertion that broke, the locator that never resolved, the line number in the spec — but it scatters it across stdout, the HTML report, and the trace file. In CI, none of those are where anyone looks first.</p>
<p>This is the story of building <code>playwright-summary-reporter</code>: an open-source Playwright custom reporter that turns a test run into a readable Markdown dashboard, rendered directly in the GitHub Actions Job Summary. It is a zero-dependency package — the only imports are Node built-ins.</p>
<h2>The Problem with Playwright CI/CD Reporting</h2>
<p>The default <code>list</code> reporter prints one line per test. On a suite of 400 tests across three browsers, that is 400 lines of output, and the three lines that matter are buried somewhere in the middle. The <code>dot</code> reporter is worse for this — it compresses everything into characters precisely when you most want the detail.</p>
<p>The <code>html</code> reporter produces a genuinely useful report, but it is a file you have to download and open. A CI failure notification says "the job failed" and links to a log. The log is 12,000 lines. The reviewer has to scroll, or download an artifact, or re-run the suite locally to find out what broke.</p>
<p>The result is a familiar pattern: someone reads the failure out of the log by eye, copies the spec name, and re-runs it. The information needed to act is present, but it is not in the place where the decision gets made.</p>
<h2>Why I Built This Package</h2>
<p>I maintain CI pipelines for other people. When a pipeline fails, the first ten minutes are spent extracting the same four facts — which tests failed, where they live, what the error was, and what is the exact command to reproduce one of them. Doing that by hand, for every pipeline, is work that should not exist.</p>
<p>GitHub solved the rendering problem years ago with <code>GITHUB_STEP_SUMMARY</code>. Any process can append Markdown to the file named by that environment variable, and GitHub renders it at the top of the job summary. What was missing was a reporter that filled it with something worth reading.</p>
<p>The second constraint came from the consumers. A reporter is a dependency that every team inherits, audits, and eventually upgrades. So I set the rule before writing any code: this package must add nothing to a consumer's dependency graph. No Markdown library, no date library, no table renderer. Playwright itself is a peer dependency and is never installed.</p>
<h2>What is Playwright Summary Reporter?</h2>
<p><code>playwright-summary-reporter</code> is a Playwright custom reporter that implements the <code>Reporter</code> interface and writes a Markdown summary of the run. It renders a status card, a proportional health bar, a KPI table, a Mermaid pie chart, per-project breakdowns, classified failures, a copy-ready re-run command and an AI debugging prompt.</p>
<p>It ships on npm as MIT-licensed TypeScript, with type declarations included. The published package has no runtime dependencies at all — <code>fs</code> and <code>path</code> are the only imports.</p>
<pre><code class="language-bash"># install
npm install -D playwright-summary-reporter

# point Playwright at it
npx playwright test --reporter=playwright-summary-reporter
</code></pre>
<h2>Key Features</h2>
<p>Every section of the report is independently toggleable, so a consumer can strip the parts they do not want. The defaults are tuned for the common case: a CI run that needs to be read quickly.</p>
<ul>
<li>GitHub-Flavored alert card — a green <code>[!TIP]</code> for a clean run, a red <code>[!CAUTION]</code> otherwise, carrying status, pass rate and the full breakdown</li>
<li>Proportional 12-block health bar visualising the result mix at a glance</li>
<li>KPI summary table with the headline metrics in bold</li>
<li>Native Mermaid pie chart — GitHub renders it, no image generation needed</li>
<li>Deterministic failure badges: Assertion, Timeout, Locator or Runtime</li>
<li>Copy-ready re-run command targeting exactly the failed tests</li>
<li>Collapsible AI debugging prompt bundling every failure for Copilot, Claude or Cursor</li>
<li>Per-project breakdown across browsers</li>
<li>Flaky test list with retry counts, and a top-N slowest-tests list with relative duration bars</li>
<li>Zero runtime dependencies, with TypeScript declarations shipped</li>
</ul>
<h2>Installation</h2>
<p>The package is published on npm. Install it as a dev dependency, since it only runs at test time.</p>
<p>It requires Node.js 18 or newer and <code>@playwright/test</code> 1.40.0 or newer as a peer dependency. Playwright is never installed by this package — it is only imported as a type.</p>
<pre><code class="language-bash">npm install -D playwright-summary-reporter

# requirements
#   node            &gt;= 18.0.0
#   @playwright/test &gt;= 1.40.0   (peer dependency)
</code></pre>
<h2>Playwright Configuration</h2>
<p>Register the reporter in <code>playwright.config.ts</code>. It is normally added alongside the default <code>list</code> reporter so the terminal output is unchanged and the summary is written in parallel.</p>
<p>The reporter name resolves to the package's entry point. You can also point Playwright at the compiled file directly, which is useful when the package is installed outside the project.</p>
<pre><code class="language-typescript">import { defineConfig } from '@playwright/test';

export default defineConfig({
  reporter: [
    ['list'],
    ['playwright-summary-reporter', { outputFile: 'test-summary.md' }],
  ],
});
</code></pre>
<h2>GitHub Actions Integration</h2>
<p>This is the part that requires no wiring at all. The reporter detects <code>GITHUB_STEP_SUMMARY</code> from the environment, so a completely standard workflow is enough — the summary appears in the Job Summary tab of the run.</p>
<p>The Markdown file is still written to disk as usual, so you can archive it as an artifact or commit it if you want a history.</p>
<pre><code class="language-yaml">name: Playwright Tests

on: [push, pull_request]

jobs:
  test:
    runs-on: ubuntu-latest
    steps:
      - uses: actions/checkout@v4
      - uses: actions/setup-node@v4
        with:
          node-version: 20
      - run: npm ci
      - run: npx playwright install --with-deps chromium
      - run: npx playwright test
</code></pre>
<h2>Example Report Output</h2>
<p>Here is what a failing run renders. The alert card states the outcome, the health bar shows the mix, the KPI table carries the numbers, and the Mermaid chart gives the distribution in one glance.</p>
<p>The report is Markdown that goes straight into the GitHub Actions job summary, so the raw output looks like this:</p>
<pre><code class="language-markdown">## Playwright Test Summary

&gt; [!CAUTION]
&gt;
&gt; ### ❌ FAILED — 60% pass rate
&gt;
&gt; `🟩🟩🟩🟩🟩🟩🟥🟥🟥🟨⬜⬜` **Health Bar**
&gt;
&gt; ✅ **Passed:** 6 • ❌ **Failed:** 3 • ⚠️ **Flaky:** 1 • ⏭️ **Skipped:** 2
&gt;
&gt; 📊 **Total:** 12 • ⏱️ **Duration:** 12.4s
&gt;
&gt; ⏱️ **Timed Out:** 1 (counted within Failed)
</code></pre>
<p>The KPI table underneath it:</p>
<table>
<thead>
<tr>
<th>Metric</th>
<th>Value</th>
</tr>
</thead>
<tbody><tr>
<td>✅ Passed</td>
<td><strong>6</strong></td>
</tr>
<tr>
<td>❌ Failed</td>
<td><strong>3</strong></td>
</tr>
<tr>
<td>⚠️ Flaky</td>
<td><strong>1</strong></td>
</tr>
<tr>
<td>⏭️ Skipped</td>
<td><strong>2</strong></td>
</tr>
<tr>
<td>📊 Total</td>
<td><strong>12</strong></td>
</tr>
<tr>
<td>🎯 Pass Rate</td>
<td><strong>60%</strong></td>
</tr>
<tr>
<td>⏱️ Duration</td>
<td><strong>12.4s</strong></td>
</tr>
</tbody></table>
<p>And the failed tests, each with its project and the exact line to look at:</p>
<table>
<thead>
<tr>
<th>Type</th>
<th>Test</th>
<th>Project</th>
<th>Location</th>
<th>Error</th>
</tr>
</thead>
<tbody><tr>
<td>🎯 Assertion</td>
<td>authentication › should reject invalid password</td>
<td>firefox</td>
<td>tests/auth/login.spec.ts:24</td>
<td>Error: expect(received).toBe(expected)</td>
</tr>
<tr>
<td>⏱️ Timeout</td>
<td>payment › should validate expired card</td>
<td>chromium</td>
<td>tests/payment/card.spec.ts:55</td>
<td>Error: Test timeout of 5000ms exceeded.</td>
</tr>
</tbody></table>
<p>The Mermaid chart renders the distribution in one glance:</p>
<pre><code class="language-mermaid">pie showData
    title Test Results Distribution
    "Passed" : 6
    "Failed" : 3
    "Flaky" : 1
    "Skipped" : 2
</code></pre>
<h2>Failed Test Re-run Commands</h2>
<p>The report ends with the command that reproduces exactly the failures — no grep filter, no scrolling to find the right line. Each failed test contributes <code>file:line</code>, which is Playwright's native way of targeting a single test, and duplicates are removed so a file with three failures contributes one entry per distinct line.</p>
<p>This is the feature that turned the reporter from "a report" into "the first step of the next action".</p>
<pre><code class="language-bash">npx playwright test tests/auth/login.spec.ts:24 tests/payment/card.spec.ts:55
</code></pre>
<h2>AI-Ready Debugging Context</h2>
<p>The report includes a collapsible accordion containing a ready-to-paste debugging prompt. It bundles every failure with its category, project, location, duration, retry count and error message, so an assistant can triage the run without needing to re-read the log or open the trace.</p>
<p>The prompt asks for the most likely root cause of each failure, an explanation of what the assertion or locator actually observed, a concrete minimal fix, and a flag on anything that looks like a race condition or an unstable locator. The final instruction asks for a prioritised list of root causes and the exact code changes required.</p>
<pre><code class="language-text">You are triaging a failing Playwright test run ("Playwright Test Summary").

For each failing test below:
1. Identify the most likely root cause of the failure.
2. Explain what the assertion or locator actually observed.
3. Propose a concrete, minimal fix to the test or the application code.
4. Flag anything that looks like a race condition or an unstable locator.

---

### 1. authentication › should reject invalid password

- **Category:** 🎯 Assertion
- **Project:** firefox
- **Location:** tests/auth/login.spec.ts:24
- **Duration:** 3.1s
- **Retries:** 0
- **Error:**

Error: expect(received).toBe(expected)

---

Please respond with a prioritised list of root causes and the exact code changes required to fix each failing test.
</code></pre>
<h2>Technical Implementation</h2>
<p>The reporter implements three methods of the Playwright <code>Reporter</code> interface: <code>onBegin</code>, <code>onTestEnd</code> and <code>onEnd</code>. Results are accumulated in a <code>Map</code> keyed by test id, because a test emits one result per retry attempt and only the last attempt carries the final verdict — keying by id means each attempt replaces the previous one and every test is counted exactly once.</p>
<p>Outcomes are resolved from <code>test.outcome()</code>, which is the authoritative final verdict because it accounts for retries and for tests that were expected to fail. The reporter distinguishes five outcomes — passed, failed, flaky, skipped and timedOut — but only four are used as buckets in the totals.</p>
<p>That distinction is the most important design decision in the package. A timeout is a <em>kind of</em> failure, not a separate bucket, so <code>timedOut</code> is folded into <code>failed</code> for all arithmetic and surfaced separately only as a badge and a line in the alert card. This guarantees the invariant <code>total === passed + failed + flaky + skipped</code> holds in every table, in the chart and in the KPI strip.</p>
<pre><code class="language-typescript">onTestEnd(test: TestCase, result: TestResult): void {
  // A test emits one result per retry attempt. We key records by the test id
  // so each attempt replaces the previous one — the last attempt is the one
  // that carries the final verdict, and the test is counted exactly once.
  const key = test.id;
  const outcome = this.resolveOutcome(test, result);
  const error = this.resolveError(result);

  this.records.set(key, {
    title: this.resolveTitle(test),
    project: this.resolveProject(test),
    file: this.resolveFile(test),
    line: test.location?.line ?? 0,
    duration: result.duration,
    retries: result.retry,
    outcome,
    ...(error ? { error } : {}),
    ...(outcome === 'failed' || outcome === 'timedOut'
      ? { category: classifyFailure(error, outcome) }
      : {}),
  });
}
</code></pre>
<ul>
<li>The browser matrix is reconstructed by walking up the suite tree to the ancestor of type <code>project</code> — the reporter API gives a flat case list, not a breakdown</li>
<li>Test titles are joined with <code>›</code> and the spec filename segment is dropped, because the file is already shown in the Location column</li>
<li>Error messages are stripped of ANSI escapes, collapsed to one line and truncated at a word boundary</li>
<li>Markdown pipes are escaped in exactly one place — the table cell renderer — so a pipe in an error message cannot break the table</li>
<li>The health bar is always exactly 12 characters wide, with segments allocated by largest-remainder rounding so the counts sum back to the total</li>
</ul>
<h2>Future Improvements</h2>
<p>The package is at v2.1.2 on npm. The direction I want to take it is not more visual polish — it is more portability and more machine-readability.</p>
<ul>
<li>A JSON output mode alongside the Markdown one, for pipelines that want to diff or gate on the result programmatically</li>
<li>Support for other CI providers that expose a step-summary equivalent</li>
<li>A JUnit-style XML emitter for consumers whose dashboards already understand that format</li>
<li>Configurable failure-category patterns, so teams can map their own error vocabulary onto the badge set</li>
</ul>
<h2>Conclusion</h2>
<p>The reporter does not make Playwright faster, and it does not make failing tests pass. It makes the failure legible at the moment someone needs to read it.</p>
<p>The two ideas that made it work are unglamorous. First: put the answer where the decision happens, not where the detail lives. Second: a report should be the first step of the next action, not the last step of the previous one — which is why the re-run command and the AI prompt are first-class parts of the output rather than extras.</p>
<p>And the constraint that shaped everything else — zero runtime dependencies — turned out to be a feature rather than a cost. A consumer can drop this into a locked, audited pipeline and know the dependency tree did not change.</p>
<h2>About the Author</h2>
<p>Md Salekin Newaz is a Senior Software QA Engineer at Brain Station 23 and an ISTQB® Certified professional. He works across test automation, API and performance testing, and CI/CD integration.</p>
<p><code>playwright-summary-reporter</code> is MIT-licensed and open source. If it saves you time in your pipeline, or if you want to contribute a failure category or a CI provider adapter, the issue tracker is open.</p>
<hr />
<p><em>Md Salekin Newaz is a Senior Software QA Engineer and ISTQB® Certified professional at Brain Station 23, based in Dhaka, Bangladesh and working with global clients on Playwright automation, AI-driven QA and CI/CD integration.</em> <a href="https://salekin-dev.vercel.app"><em>See his portfolio and case studies</em></a> <em>— or</em> <a href="https://salekin-dev.vercel.app/resume"><em>read his resume</em></a><em>.</em></p>
]]></content:encoded></item><item><title><![CDATA[Playwright Fixtures That Scale Past the First Suite]]></title><description><![CDATA[The fixture pattern that stopped my suites from becoming a pile of beforeEach blocks — and why the teardown order matters more than the setup.]]></description><link>https://salekinnewaz.hashnode.dev/playwright-fixtures-that-scale</link><guid isPermaLink="true">https://salekinnewaz.hashnode.dev/playwright-fixtures-that-scale</guid><category><![CDATA[playwright]]></category><category><![CDATA[Testing]]></category><category><![CDATA[test-automation]]></category><category><![CDATA[TypeScript]]></category><category><![CDATA[QA automation]]></category><category><![CDATA[best practices]]></category><dc:creator><![CDATA[Md Salekin Newaz]]></dc:creator><pubDate>Thu, 03 Dec 2026 14:11:05 GMT</pubDate><content:encoded><![CDATA[<h1>Playwright Fixtures That Scale Past the First Suite</h1>
<p>The fixture pattern that stopped my suites from becoming a pile of <code>beforeEach</code> blocks — and why the teardown order matters more than the setup.</p>
<h2>The problem with beforeEach</h2>
<p>The first Playwright suite I inherited was 340 tests long and every one of them began with the same nineteen lines of setup. Auth token, tenant seeding, a clock stub, a feature flag, an uploaded fixture file. Copy-pasted, slightly different in each file, and impossible to reason about.</p>
<p>When a test failed, the first question was never "what broke?" but "what was different about this file's setup?". That question is the exact opposite of what test code should be asking.</p>
<ul>
<li>Setup lived in the test file, so it was duplicated and drifted</li>
<li>Teardown order was implicit — whichever file happened to clean up last won</li>
<li>A new engineer had to read 19 test files to learn the login flow</li>
</ul>
<h2>Fixtures push setup to the dependency graph</h2>
<p>A fixture is not a helper function. It is a declaration that a piece of state exists for the scope of a test, with a defined teardown. The runner builds the dependency graph, runs setup in dependency order, and unwinds teardown in exactly the reverse.</p>
<p>Once the tenant is a fixture rather than a line of code, the test body reads like the story it is actually testing. And because the dependency graph is explicit, teardown order stops being tribal knowledge.</p>
<pre><code class="language-typescript">import { test as base, expect } from '@playwright/test';

type Tenant = { id: string; authToken: string; featureFlags: string[] };

// A fixture that owns its own lifecycle. Playwright resolves the
// dependency graph: `user` depends on `tenant`, so `tenant` is set up
// first and torn down last.
export const test = base.extend&lt;{ tenant: Tenant }&gt;({
  tenant: async ({ request }, use) =&gt; {
    const res = await request.post('/api/test-tenants', {
      data: { plan: 'enterprise', region: 'eu-west' },
    });
    expect(res.ok()).toBeTruthy();
    const tenant = (await res.json()) as Tenant;

    await use(tenant);

    // Teardown runs in reverse dependency order, so children are already
    // gone by the time we delete the tenant.
    await request.delete(`/api/test-tenants/${tenant.id}`);
  },
});
</code></pre>
<h2>Scope is the design decision</h2>
<p>The mistake I made early was making everything worker-scoped because it was faster in the short run. Worker-scoped means one browser for the whole shard, one tenant for hundreds of tests, and state bleeding between tests you did not think about.</p>
<p>The rule I landed on: a fixture should be as wide as its lifetime, and no wider. If the state is needed for the whole worker, it is worker-scoped. If it is needed for a single test, it is test-scoped. If it is needed for a describe block, it is a describe-scoped fixture.</p>
<pre><code class="language-typescript">import { test, expect } from '../fixtures/tenant';

// `test` inherits the tenant fixture from the base, and each test gets
// its own — so tests never see each other's seeded data.
test.describe('Checkout', () =&gt; {
  test('completes a booking', async ({ page, tenant }) =&gt; {
    await page.goto('/booking/new');
    await page.getByTestId('pickup').fill(tenant.id);
    await page.getByRole('button', { name: 'Confirm' }).click();

    await expect(page.getByRole('heading', { name: 'Booked' })).toBeVisible();
  });

  test('rejects an expired promo code', async ({ page, tenant }) =&gt; {
    await page.goto('/booking/new');
    await page.getByTestId('promo').fill('EXPIRED');
    await page.getByRole('button', { name: 'Apply' }).click();

    await expect(page.getByText('This code has expired')).toBeVisible();
  });
});
</code></pre>
<h2>Make the fixture read like the assertion</h2>
<p>A fixture whose name matches what it guarantees is self-documenting. When I see <code>authenticatedUser</code> in a test signature, I know the request is already authorised and I do not need to read the fixture file. That single convention removed most of my onboarding questions.</p>
<p>The payoff shows up in maintenance rather than in the first week. When authentication changes, there is exactly one fixture to update, and every test that depends on it picks the change up automatically.</p>
<h2>Key Takeaways</h2>
<ul>
<li>A fixture is a lifecycle declaration, not a helper — the runner owns setup order and reverse-order teardown.</li>
<li>Match fixture scope to actual lifetime: test, describe, or worker — never wider than needed.</li>
<li>Name fixtures after the guarantee they provide, so the test signature documents itself.</li>
<li>One fixture to change when auth or tenant logic changes — that is where the maintenance win lives.</li>
</ul>
<hr />
<p><em>Md Salekin Newaz is a Senior Software QA Engineer and ISTQB® Certified professional at Brain Station 23, based in Dhaka, Bangladesh and working with global clients on Playwright automation, AI-driven QA and CI/CD integration.</em> <a href="https://salekin-dev.vercel.app"><em>See his portfolio and case studies</em></a> <em>— or</em> <a href="https://salekin-dev.vercel.app/resume"><em>read his resume</em></a><em>.</em></p>
]]></content:encoded></item><item><title><![CDATA[Release Readiness for IoT: Shipping a Maritime Safety Product]]></title><description><![CDATA[Three production releases, zero rollbacks — what release readiness actually required on a smart-boat app with automatic Man Over Board alerting.]]></description><link>https://salekinnewaz.hashnode.dev/norway-iot-release-readiness</link><guid isPermaLink="true">https://salekinnewaz.hashnode.dev/norway-iot-release-readiness</guid><category><![CDATA[qa-leadership]]></category><category><![CDATA[release management]]></category><category><![CDATA[iot]]></category><category><![CDATA[test strategy]]></category><category><![CDATA[Quality Engineering]]></category><category><![CDATA[uat]]></category><dc:creator><![CDATA[Md Salekin Newaz]]></dc:creator><pubDate>Thu, 03 Dec 2026 14:10:00 GMT</pubDate><content:encoded><![CDATA[<h1>Release Readiness for IoT: Shipping a Maritime Safety Product</h1>
<p>Three production releases, zero rollbacks — what release readiness actually required on a smart-boat app with automatic Man Over Board alerting.</p>
<h2>Why release readiness is not a checklist</h2>
<p>On a typical application, a release goes out, something breaks, and you roll back. On the product I worked on in Norway, the failure mode was not a broken screen. The app monitors temperature, humidity, water leaks and GPS on a boat, and on a Man Over Board event it cuts the engine and raises a distress alert.</p>
<p>A false negative there is not a UI bug. It is a safety event on a vessel. That changes what "ready" means, and it changes who gets to say it.</p>
<h2>Defining the sign-off criteria before the sprint</h2>
<p>The single highest-leverage thing I did was refuse to run a release cycle without written sign-off criteria agreed with the client before the sprint started. Not after. If the criteria are negotiated under release pressure, they will be negotiated down.</p>
<p>My criteria had four layers: functional correctness of the safety-critical paths, telemetry integrity end to end, non-functional behaviour under load, and an operational readiness check on alerting and escalation.</p>
<ul>
<li>Functional — the MOB path and geofencing exercised explicitly, not as incidental coverage</li>
<li>Integrity — telemetry confirmed ingested, not merely sent</li>
<li>Non-functional — behaviour under realistic marine connectivity</li>
<li>Operational — escalation and alerting verified with the client</li>
</ul>
<h2>Telemetry is not a delivery guarantee</h2>
<p>This was the bug class that surprised me most. A device sends a telemetry message, the broker accepts it, the pipeline reports success — and the data never reaches the application, because a subscription filter silently excluded it.</p>
<p>The fix was to assert on the far side of the pipeline, not the near side. The test waits for the application state to change, not for the publish call to return 200. That single change moved several "green" releases to genuinely covered.</p>
<pre><code class="language-typescript">import { test, expect } from '../fixtures/tenant';

// Assert on the FAR side of the pipeline. A successful publish does not
// prove the data arrived — only the application state proves that.
test('raises a distress alert and cuts the engine on MOB', async ({ page, request }) =&gt; {
  await page.goto('/fleet/vessel-77');
  await page.getByTestId('simulate-mob').click();

  // 1. The application received and rendered the alert.
  await expect(
    page.getByRole('alert').filter({ hasText: 'Man Over Board' }),
  ).toBeVisible();

  // 2. The engine was actually cut — not merely "requested".
  await expect(page.getByTestId('engine-state')).toHaveText('CUT OFF');

  // 3. The alert was persisted server-side, so it survives a reconnect.
  const alerts = await request.get('/api/vessels/vessel-77/alerts');
  expect(await alerts.json()).toEqual(
    expect.arrayContaining([expect.objectContaining({ type: 'MOB', ack: false })]),
  );
});
</code></pre>
<h2>UAT is a coordination problem</h2>
<p>UAT consumes the client's scarcest resource: their subject-matter experts. When their time is scheduled badly, the sign-off slips, the release slips, and everyone starts negotiating about scope instead of quality.</p>
<p>I scheduled UAT slots against a published criteria document, sent the evidence pack in advance so the review was about judgement rather than discovery, and set a hard cut-off for new cases — anything not in the criteria became a documented follow-up, not a release blocker.</p>
<ul>
<li>Publish criteria before the sprint so scope is not renegotiated under pressure</li>
<li>Send the evidence pack in advance — review time goes to judgement, not discovery</li>
<li>Hard cut-off for new cases; late findings become tracked follow-ups</li>
<li>Book client SME time as a scheduled, named commitment</li>
</ul>
<h2>Three releases, zero rollbacks</h2>
<p>The outcome was three production releases for the client with no rollbacks, and a sign-off process the client could point at in their own release governance.</p>
<p>The transferable lesson is not "release carefully". It is that readiness has to be argued in advance, with evidence, against criteria that everyone signed. The moment criteria exist in writing, a release conversation stops being about nerve and starts being about evidence.</p>
<h2>Key Takeaways</h2>
<ul>
<li>Agree release sign-off criteria before the sprint starts — never negotiate them under release pressure.</li>
<li>For safety-critical paths, assert on the far side of the pipeline; a successful send is not an arrival.</li>
<li>UAT fails on scheduling, not on testing. Book the client SME time and send evidence in advance.</li>
<li>Set a hard cut-off for late cases so they become tracked follow-ups instead of release blockers.</li>
<li>Written criteria turn a release decision from a judgement call into an evidence review.</li>
</ul>
<hr />
<p><em>Md Salekin Newaz is a Senior Software QA Engineer and ISTQB® Certified professional at Brain Station 23, based in Dhaka, Bangladesh and working with global clients on Playwright automation, AI-driven QA and CI/CD integration.</em> <a href="https://salekin-dev.vercel.app"><em>See his portfolio and case studies</em></a> <em>— or</em> <a href="https://salekin-dev.vercel.app/resume"><em>read his resume</em></a><em>.</em></p>
]]></content:encoded></item><item><title><![CDATA[GitHub Copilot + Azure Boards MCP: Where AI Actually Helps in QA]]></title><description><![CDATA[A practical look at AI-assisted test case ideation and MCP-driven defect reporting — including the parts that did not work, and what I would do…]]></description><link>https://salekinnewaz.hashnode.dev/copilot-and-azure-boards-mcp</link><guid isPermaLink="true">https://salekinnewaz.hashnode.dev/copilot-and-azure-boards-mcp</guid><category><![CDATA[AI]]></category><category><![CDATA[llm]]></category><category><![CDATA[mcp]]></category><category><![CDATA[Model Context Protocol]]></category><category><![CDATA[QA]]></category><category><![CDATA[test-automation]]></category><category><![CDATA[github copilot]]></category><dc:creator><![CDATA[Md Salekin Newaz]]></dc:creator><pubDate>Thu, 03 Dec 2026 14:08:52 GMT</pubDate><content:encoded><![CDATA[<h1>GitHub Copilot + Azure Boards MCP: Where AI Actually Helps in QA</h1>
<p>A practical look at AI-assisted test case ideation and MCP-driven defect reporting — including the parts that did not work, and what I would do differently.</p>
<h2>The honest starting point</h2>
<p>Most AI-in-QA conversations start with the weakest use case: "AI writes my tests." If your team struggles to maintain the tests it already has, adding a faster generator of tests makes the maintenance problem larger, not smaller.</p>
<p>I started from the other end. Where does a senior QA engineer spend time that a machine could genuinely do better? For me it was three places: expanding a requirement into edge cases, triaging a stack trace, and writing the same five sentences of defect description for the fortieth time.</p>
<h2>Test case ideation as a breadth problem</h2>
<p>When you read a requirement, the cases you forget are the boring ones — the empty field, the expired token, the request that arrives twice, the timezone that is not local. Asking an LLM for "edge cases for this requirement" produces a broad list cheaply, and broad is exactly what you want here.</p>
<p>The trick is giving it the requirement in its raw form. I paste the acceptance criteria, the API contract, and the domain rules, then ask for cases grouped by risk category rather than by feature area. Grouping by risk is what makes the output triageable — a list grouped by feature is just a longer list.</p>
<pre><code class="language-text">You are a senior QA engineer working on a payment API.

ACCEPTANCE CRITERIA
  1. A booking is created for a valid customer and vehicle.
  2. A booking for an overlapping time window is rejected with 409.
  3. A booking is idempotent on the same idempotency key.

DOMAIN RULES
  - Booking windows are 15 minutes.
  - A vehicle that is "in service" cannot be booked.

Produce test cases grouped by RISK CATEGORY, not by feature.
For each case give: id, precondition, steps, expected result.
Do not repeat the happy path across groups.
</code></pre>
<h2>MCP: connecting the model to the tracker</h2>
<p>The Model Context Protocol is the piece that makes AI useful beyond the chat window. An MCP server exposes a tool — "create a defect in Azure Boards", "read the sprint board" — and the model can call it.</p>
<p>The first practical win for me was defect reporting. Writing a good defect takes four things: a title, steps to reproduce, actual vs expected, and the environment. The model already has the failing test, the stack trace, and the run URL. With an Azure Boards MCP server, it can assemble those into a correctly-linked, correctly-labelled work item.</p>
<pre><code class="language-typescript">import { Server } from '@modelcontextprotocol/sdk/server/index.js';
import { StdioServerTransport } from '@modelcontextprotocol/sdk/server/stdio.js';

const server = new Server(
  { name: 'azure-boards-qa', version: '1.0.0' },
  { capabilities: { tools: {} } },
);

server.setRequestHandler(ListToolsRequestSchema, async () =&gt; ({
  tools: [
    {
      name: 'create_defect',
      description: 'Create a QA defect work item from a failed test run.',
      inputSchema: {
        type: 'object',
        properties: {
          title: { type: 'string' },
          reproSteps: { type: 'array', items: { type: 'string' } },
          actual: { type: 'string' },
          expected: { type: 'string' },
          runUrl: { type: 'string' },
        },
        required: ['title', 'reproSteps', 'actual', 'expected'],
      },
    },
  ],
}));

// The tool handler keeps Azure auth server-side. The model never sees
// a PAT — it only ever calls this function.
server.setRequestHandler(CallToolRequestSchema, async (req) =&gt; {
  if (req.params.name === 'create_defect') {
    const args = req.params.arguments as CreateDefectInput;
    const workItem = await azureBoards.createWorkItem({
      type: 'Bug',
      title: args.title,
      reproSteps: args.reproSteps.join('\n'),
      tags: ['qa-automation'],
    });
    return {
      content: [{ type: 'text', text: `Created work item ${workItem.id}` }],
    };
  }
  throw new Error(`Unknown tool: ${req.params.name}`);
});

await server.connect(new StdioServerTransport());
</code></pre>
<h2>Where it fell short</h2>
<p>Being specific here saves everyone time. The model was unreliable at triaging intermittent failures — it would confidently attribute a timeout to the wrong subsystem because the log did not contain the information needed to distinguish them.</p>
<p>It also needed a lot of guarding. A defect-creation tool that runs without validation will happily file duplicate work items on every CI retry, so I had to make the idempotency key the test run ID.</p>
<p>And the security boundary is the thing to get right early: the model should never hold a personal access token. The MCP server holds the credential and the model only calls the tool.</p>
<ul>
<li>Triage of intermittent failures stayed manual — the logs lacked the context</li>
<li>Idempotency had to be enforced server-side using the CI run ID</li>
<li>Credentials stayed in the MCP server; the model only ever calls tools</li>
</ul>
<h2>Key Takeaways</h2>
<ul>
<li>Start with breadth of edge cases, not speed of test generation — breadth is the case a machine wins.</li>
<li>MCP is what turns a chat assistant into a workflow tool: it can act in Azure Boards, not just advise.</li>
<li>Keep every credential server-side. The model calls tools; it never holds tokens.</li>
<li>Guard non-idempotent tools with a CI run ID or you will file duplicates on every retry.</li>
</ul>
<hr />
<p><em>Md Salekin Newaz is a Senior Software QA Engineer and ISTQB® Certified professional at Brain Station 23, based in Dhaka, Bangladesh and working with global clients on Playwright automation, AI-driven QA and CI/CD integration.</em> <a href="https://salekin-dev.vercel.app"><em>See his portfolio and case studies</em></a> <em>— or</em> <a href="https://salekin-dev.vercel.app/resume"><em>read his resume</em></a><em>.</em></p>
]]></content:encoded></item></channel></rss>