Skip to content

Latest commit

Β 

History

3 Commits

Folders and files

NameName
Last commit message
Last commit date
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 

Repository files navigation

πŸ§ͺ ForkableFullStackQASuite

Stack DB Frontend Forkable

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.

System under test

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.


🎯 What it is

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

πŸ› οΈ Stack

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)

πŸ“ Architecture

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}/

πŸ” Locator strategy (no data-testid in the app yet)

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.

🧱 Build order

  1. REST API β€” CRUD, auth, schema validation. Doubles as the test-data seeding mechanism for UI tests.
  2. 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.
  3. MSSQL validation β€” ground-truth assertions (utilization %, available hours, project history) independent of what the UI renders.
  4. UI E2E β€” Page Object Model, storageState/storage_state reuse to skip login-via-UI on every test.
  5. Chart.js validation β€” reads the live Chart.getChart(canvas) instance data and asserts it against API truth, instead of pixel snapshotting.
  6. 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.

πŸš€ Getting started

TypeScript suite

cd ts-suite
npm install
npx playwright install --with-deps
cp .env.example .env   # fill in real values
npm test

Python suite

cd py-suite
pip install -r requirements.txt
playwright install --with-deps
cp .env.example .env   # fill in real values
pytest

🀝 Open to

Feedback 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

About

πŸ§ͺ Dual-language Playwright suite (TypeScript + Python) for an employee CRM β€” REST API, role-based visibility, MSSQL validation, Chart.js data checks. Two independent teams, one shared test plan.

Topics

Resources

Code of conduct

Contributing

Security policy

Stars

0 stars

Watchers

0 watching

Forks

Used by

Contributors

Languages