A production-grade Playwright + TypeScript automation architecture for multi-tenant B2B SaaS platforms. Executes deterministic TypeScript in CI while pairing with structured IDE workflows for rapid test authoring, DOM locator diagnostics, and 1:1 Test Management traceability.
Every run executes a deterministic 3-stage project dependency chain:
auth-setup signs in once with retry resilience, seed-data verifies baseline dev records without blocking, and browser workers run in fresh contexts.
// Project dependency chain in playwright.config.ts
projects: [
{ name: 'auth-setup', testMatch: /auth\.setup\.ts/ },
{
name: 'seed-data',
testMatch: /seed-data\.setup\.ts/,
dependencies: ['auth-setup'],
use: { storageState: STORAGE_STATE_PATH },
},
{
name: 'chromium',
dependencies: ['seed-data'],
use: { storageState: STORAGE_STATE_PATH },
},
]
.agent/skills/).agent/skills/create-tests/SKILL.md)Turns a Jira/Linear/GitHub issue and developer PR diff into Test Management cases, a Page Object, and a verified Playwright spec.
Reads ticket description, comments, and developer PR diff to catch undocumented UI changes or feature flags.
Inspects the live page on dev to discover stable data-testid, data-qa, and ARIA role locators.
Designs happy-path, negative, and edge steps for user approval before writing code (1 TMS step = 1 test).
Extends BasePage, writes the spec with tmsCase() & isDevRun(), and runs lint + type-check.
.agent/skills/heal-locators/SKILL.md)Instead of brittle runtime AI calls that slow down CI, locator healing happens interactively in Antigravity with human confirmation.
Extracts the broken selector, Page Object method, and call site from test-results/.
Opens the target route and inspects the current accessibility tree and attributes.
Proposes 3 scored replacements ordered by data-testid/qa (98) → role (92) → label (85).
Patches the Page Object in src/pages/ after approval and re-runs the spec to confirm green.
.agent/skills/project-setup/SKILL.md)Executed immediately after clicking "Use this template" on GitHub for a new client engagement.
Asks for tenant names, base URL pattern, primary test attribute, timezone, and TMS URL in one prompt.
Presents a single confirmation table before touching any repository files.
Updates playwright.config.ts, environment.helper.ts, .env.example, and GitHub Actions.
Runs npm run lint && npm run type-check and lists all discovered Playwright projects.
.agent/skills/local-setup/SKILL.md)Gets any new QA engineer or developer ready to run tests locally in under 2 minutes.
Verifies Node.js 20+, npm, git, and GitHub CLI (gh auth status) on the machine.
Runs npm ci and installs Chromium for local execution.
Copies .env.example to .env and prompts for local test credentials.
Executes the smoke suite and prints the daily command cheat sheet.
Pins the execution timezone, enforces grep: /@prod-safe/ automatically when ENV=prod, and chains auth-setup → seed-data → browsers.
export default defineConfig({
timeout: 60_000,
expect: { timeout: 10_000 },
/* Automatic production safety lock */
grep: context.environment === 'prod' ? /@prod-safe/ : undefined,
use: {
baseURL: context.baseURL,
timezoneId: context.timezoneId,
trace: 'retain-on-failure',
},
});
BasePage & Helper ToolkitreadAllVirtualizedRows() Virtualized DOM
Scrolls bidirectional virtualized tables from top to bottom, indexing every row by data-index so rows unmounted at the top are preserved in order, and verifies the total against "Showing N entries".
fillSecure() Zero Secret Leaks
Wraps password and API token inputs in Fill secure field [Password] with ***REDACTED*** so sensitive credentials never appear in HTML or Allure step logs.
InMemoryTokenClient Hybrid UI + API
Intercepts the SPA's next outgoing network request to borrow its in-memory Bearer token, enabling authenticated GraphQL and REST backend assertions without storing tokens in localStorage.
FileDownloadInspector Deep File Verification
Parses downloaded streams to verify actual exported content: CSV headers/rows, PDF magic bytes (%PDF-), and ZIP/XLSX binary headers (PK\x03\x04).
ENV=dev npx playwright test tests/e2e/smoke/navigation.spec.ts --project=chromium
@prod-safe)ENV=stage npx playwright test --grep @prod-safe --project=chromium
CUSTOM_URL=https://preview.example.com npx playwright test --grep @smoke
npm run lint && npm run type-check