idavidov13 /agentic-playwright

Production-grade Playwright + TypeScript Scaffold for Agentic Testing. Harness for all major AI coding agents baked in.

★ 298⑂ 88👁 11⑃ 38● 1▤ 6
PythonMITCreated 2026-08-13
下载:v2.0.5 — A Quarantine Convention for Flaky Testsv2.0.5 ↓2.0.52026-11-17
298
stars
88
forks
11
watchers
38
prs
1
issues
6
releases

README

Agentic Playwright


  Stop teaching your AI how to write tests. Hand it the rulebook.



  
  
  
  = 22"
  
  



  Production-grade Playwright + TypeScript Scaffold for Agentic Testing.
  A complete, running test framework — page objects, API contracts, data factories, CI —
  plus the AI rules your assistant picks up automatically, from the very first prompt.


 What it guarantees, and what it does not. The rules, the hook and the gates guarantee the form of a test: structure, selectors, schemas, data, tags. They do not guarantee its value. Which scenarios matter, and whether a test would catch a real bug, is decided in human review before the commit. Three questions for that review: would this test fail if the feature broke? Is every row left out recorded in a // SCOPE line? Does it pass on a rerun?

 See it

From the (empty) directory your project should live in — the . means "scaffold right
here, and name the project after this folder" (a fresh git clone of an empty repo
works too). Prefer a new subfolder? Pass a name instead of .:

bash
npm create agentic-playwright@latest . -- --demo


Zero questions. Scaffolds the framework, installs dependencies and a browser, and ends
by running the smoke test against a live demo application — you see green before
writing a line. Under 5 minutes on normal broadband.

 Without the rulebook vs with it

The same prompt — _"write a test for the product search"_ — to the same AI assistant:

ts
// ❌ Unsupervised: XPath, hard waits, any, magic timeouts, no structure
test('search', async ({ page }) = {
    await page.goto('https://practicesoftwaretesting.com');
    await page.locator('//input[@id="search-query"]').fill('pliers');
    await page.locator('//button[@type="submit"]').click();
    await page.waitForTimeout(5000);
    const cards: any = await page.$$('.card');
    expect(cards.length  0).toBe(true);
});


ts
// ✅ With Agentic Playwright: fixtures, steps, web-first assertions
import { expect, test } from '../../../fixtures/pom/test-options';

test(
    'should show only matching products when searching',
    { tag: '@regression' },
    async ({ homePage }) = {
        await test.step('GIVEN the user is on the home page', async () = {
            await homePage.open();
        });

        await test.step('WHEN the user searches for "pliers"', async () = {
            await homePage.searchFor('pliers');
        });

        await test.step('THEN every result matches the search term', async () = {
            await expect(homePage.searchCaption).toContainText('pliers');
            await expect(homePage.productNames.first()).toContainText('Pliers');
        });
    }
);


Dependency-injected page objects, Given/When/Then steps, web-first assertions, no hard
waits, no any, one tag per test — enforced by one AGENTS.md Constitution and 17 skills the
assistant loads automatically, a write-time hook that blocks the forbidden patterns
outright in Claude Code, and the same rules scanned at commit time for eve

Top issues

Latest release

v2.0.5 — A Quarantine Convention for Flaky Tests v2.0.5 2026-11-17
Rules layer

- A flaky test that cannot be fixed now is quarantined, never silently skipped. The agent investigates, then proposes a declaration-form test.fixme with a quarantine annotation (owner=@handle; until=YYYY-MM-DD); a human approves it and names the owner and the expiry. The procedure is debugging step 7 and references/quarantine.md.
- ESLint enforces it for every spec under tests/ (quarantine/annotation, lint/quarantine.mjs): a skip passes only with the annotation or, for a contract mismatch, test.skip with // FIXME:  on the line above. A bare skip, the in-body forms (test.skip(true,

Snapshot: 2026-11-17T21:58:29Z · Data license Apache-2.0 · JSON