Dual-language (TypeScript + Python) Playwright automation scaffold for an app built on React/Next.js, Node.js, MSSQL, REST APIs, and Chart.js dashboards. Clone it, run it, keep it or throw it away β see suryakulshreshtha/SuryaKulshreshtha for the rest of the index.
An internal CRM tracking employees: current position, utilization over
the year, projects assigned (current + previous), available work hours, and
qualifications/skills β with role-based visibility, so different users
see an appropriate (not necessarily full) view of another employee's data.
That visibility requirement is treated as a first-class, P0 test surface
here (VIS-* rows in the test plan), not an afterthought.
Two independent Playwright suites (ts-suite/, py-suite/) testing the
same application, built by design to catch different blind spots rather than
share code. They're kept honest by three shared artifacts only:
| Shared artifact | Purpose |
|---|---|
shared-test-plan.md |
Canonical test-case matrix β every row implemented in both suites |
shared-test-data/ |
Common fixtures so "expired-subscription user" means the same DB row everywhere |
| Locator strategy (below) | Same semantic locators picked independently in both suites, no shared code |
Automation Β· Playwright (TypeScript + Python) Β· Pytest Under test Β· React Β· Next.js Β· Node.js Β· REST APIs Β· MSSQL Β· Chart.js CI Β· GitHub Actions (matrix: TS + Python in parallel)
ForkableFullStackQASuite/
βββ shared-test-plan.md # canonical test case matrix
βββ shared-test-data/ # JSON fixtures used by both suites
βββ .github/workflows/ci.yml # matrix CI: ts-suite + py-suite in parallel
βββ ts-suite/ # Playwright + TypeScript
β βββ src/api/ # typed REST client (zod schema validation)
β βββ src/db/ # MSSQL helper (mssql) β Users vs Employees kept distinct
β βββ src/pages/ # Page Object Models
β βββ tests/
β βββ auth.setup.ts # generates src/.auth/user.json β runs before authenticated projects
β βββ api/ # auth, employee visibility (RBAC)
β βββ ui/ # login.spec.ts runs unauthenticated (see playwright.config.ts)
β βββ charts/ # employee utilization chart
βββ py-suite/ # Playwright + Python + pytest
βββ src/api/ # REST client (pydantic schema validation)
βββ src/db/ # MSSQL helper (pyodbc) β Users vs Employees kept distinct
βββ src/pages/
βββ tests/{api,ui,charts}/
Priority order: getByRole β getByLabel β getByPlaceholder β getByText.
CSS/XPath fallback lives inside the Page Object only, never inline in a test.
Elements where semantic locators genuinely don't work (icon-only buttons,
repeated rows, chart legend items) get tracked and requested incrementally
in shared-test-data/testid-requests.md
β small, specific asks to the dev team rather than a blanket sweep.
- REST API β CRUD, auth, schema validation. Doubles as the test-data seeding mechanism for UI tests.
- Role-based visibility β treated as its own priority layer, not folded
into generic API tests: assert what a standard user vs. a manager/admin
can see on the same employee record (
VIS-*). Get this early; it's the requirement most likely to regress silently. - MSSQL validation β ground-truth assertions (utilization %, available hours, project history) independent of what the UI renders.
- UI E2E β Page Object Model,
storageState/storage_statereuse to skip login-via-UI on every test. - Chart.js validation β reads the live
Chart.getChart(canvas)instance data and asserts it against API truth, instead of pixel snapshotting. - Composite E2E β seed via API β act via UI β verify UI + DB + chart
agree, and that visibility rules still hold after the action (
E2E-003). Fewest tests, highest confidence, top of the pyramid.
TypeScript suite
cd ts-suite
npm install
npx playwright install --with-deps
cp .env.example .env # fill in real values
npm testPython suite
cd py-suite
pip install -r requirements.txt
playwright install --with-deps
cp .env.example .env # fill in real values
pytestFeedback on the shared-test-plan model for multi-team suites, and on the
Chart.js data-read pattern (page.evaluate + Chart.getChart) vs. visual
snapshotting β happy to compare notes.
π¬ Β· π suryakulshreshtha.in Β· index at suryakulshreshtha/SuryaKulshreshtha