Skip to content
Back to skills

Mukhon Testing

ASecurity

Comprehensive testing standard for MUKHON. Covers end-to-end (E2E) browser testing with Playwright, component-level rendering tests, backend REST/WebSocket integration tests, Chrome DevTools auditing, and Test-Driven Development (TDD) red-green-refactor workflows.

  • 2 stars
  • 0 votes
  • 0 copies
  • 0 views
  • Added November 7, 2026
ai-agentstypescriptbashsqltestingdebuggingapidatabasefrontendbackendsecurity

Works with

  • api

Security analysis

A100/100

Pro scans all 4 files and shows the line behind each finding

Scanned November 7, 2026

npx -y skills add realshahriya/Mukhon-Skill-pack --skill mukhon-testing --agent claude-code

Installs into .claude/skills of the current project.

Are you the author of Mukhon Testing?

Add the live security badge to your README. It updates with every re-scan.

Security grade badge for Mukhon Testing
[![Security: A — Skills Directory](https://www.skillsdirectory.com/api/skills/realshahriya-mukhon-testing/badge)](https://www.skillsdirectory.com/skills/realshahriya-mukhon-testing)

More formats (shields.io, HTML) on the badges page. Keep it an A: scan every change in CI with Pro.

Download with Pro
SKILL.md
---
name: mukhon-testing
description: |
  Comprehensive testing standard for MUKHON. Covers end-to-end (E2E) browser testing with Playwright,
  component-level rendering tests, backend REST/WebSocket integration tests, Chrome DevTools auditing,
  and Test-Driven Development (TDD) red-green-refactor workflows.
license: MIT
metadata:
  version: v1.0.0
  publisher: mukhon-core
---

# MUKHON Testing & Quality Assurance Standard

This skill establishes the testing practices, frameworks, and verification protocols across the MUKHON platform.

---

## 1. Test Architecture & Directory Layout

```
apps/
├── api/
│   └── src/tests/               # Backend integration & security test suites
│       ├── integration.test.ts  # Core API, e-KYC, SafePay escrow, and auth integration
│       └── rls-stress-*.test.ts # PostgreSQL RLS security policy challenge harness
└── web/
    └── tests/                   # Frontend component and Playwright E2E suites
        ├── e2e/                 # Full browser user flow tests (Playwright)
        └── components/          # Component rendering and interaction tests
```

---

## 2. Playwright E2E Testing Guidelines

### Pinned Execution Commands
Always use pinned versions or project scripts to prevent supply-chain vulnerabilities:
```bash
# Recommended: Run via package.json script
npm run test:e2e --workspace=@mukhon/web

# Direct execution with pinned version
npx @playwright/test@1.49.0 test

# Run specific spec with UI or headed mode for debugging
npx @playwright/test@1.49.0 test tests/e2e/feed.spec.ts --headed
```

### Detailed Testing References
- [Page Object Models](references/page-objects.md): Clean abstraction classes for MUKHON Feed, SafePay Escrow, and Modals.
- [Network Mocking](references/network-mocking.md): Route interception (`page.route()`) for Porichoy NID e-KYC and courier webhooks.
- [Test Fixtures](references/fixtures.md): Reusable authenticated citizen test contexts.

### Core Testing Rules
1. **User-Facing Locators**: Always prioritize user-visible selectors over CSS structure:
   - `page.getByRole('button', { name: /পোস্ট|Post/i })`
   - `page.getByLabel('Search Mukhon')`
   - `page.getByText('24h Citizen Stories')`
   - Avoid brittle XPath or dynamic class chains (e.g. `div > div:nth-child(2)`).
2. **Web-First Assertions with Auto-Waiting**:
   - `await expect(page.getByRole('dialog')).toBeVisible();`
   - Never use arbitrary `page.waitForTimeout()` sleeps. Always wait for specific DOM states, network responses, or URL changes.
3. **Session & Auth State Storage**:
   - Save authenticated browser states (`storageState`) to avoid re-logging in before every individual test case.
4. **Responsive Testing**:
   - Test both desktop viewport (`1280x800`) and mobile viewport (`390x844` iPhone 14/15 equivalent) to verify mobile bottom navigation bar (`.mobile-bottom-nav`) and collapsible sidebars.

---

## 3. Backend & Security Testing Guidelines

1. **Dual-Mode Execution**:
   - Every backend test suite must cleanly run in both **In-Memory Store Mode** and **PostgreSQL Mode** without crashing when `DATABASE_URL` is omitted.
2. **Zero-PII Storage Validation**:
   - Verify that National ID numbers are strictly hashed with HMAC-SHA256 blind indexing and passwords use `scrypt`.
3. **Escrow & SafePay Invariants**:
   - Test that money transfers and escrow locks enforce double-entry ledger balance rules and 3-attempt OTP brute force limits.

---

## 4. Test-Driven Development (Red-Green-Refactor)

1. **Red**: Write a failing test capturing the exact bug or new capability.
2. **Green**: Implement the minimal, clean code change required to satisfy the assertion.
3. **Refactor**: Simplify and optimize while keeping the full test suite green.
4. **Gate**: Run `npm run typecheck` or `npx typescript@5.9.3 tsc --noEmit` across all workspaces before declaring any task complete.

Files in this skill

  • SKILL.md3.8 KB
  • references/fixtures.md1.7 KB
  • references/network-mocking.md2.2 KB
  • references/page-objects.md2.2 KB

Attribution

Is this your skill, or is something wrong with this listing? Request removal or report an issue. Author removals are honored within 72 hours.

View all in ai-agents →

Comments

Loading comments…

Newsletter

Get the weekly list of safe new skills, and the ones we pulled.