system-prompts-and-models-o.../salesflow-saas/frontend/tests/a11y/baseline.spec.ts
Claude 3ef62652aa
Phase 2 Execution Waves: 90-day plan + Verification Protocol scaffolding
Saves the DEALIX_PHASE2_EXECUTION_WAVES.md 90-day plan and scaffolds every
artifact the coding agent can produce. Wave A-E execution is explicitly
blocked until the Week-12 Phase Gate (§3) returns Green.

Added:
  §1 Verification Protocol (V001-V007)
    - scripts/v001_secret_scan.sh — trufflehog + gitleaks full-history scan
    - backend/tests/security/test_rls_fuzz.py — 10K cross-tenant fuzz
    - docs/verification/V003_pentest_engagement.md — vendor RFP + scope
    - docs/verification/V004_no_founder_demo_test.md — 3-tester protocol
    - scripts/v005_truth_registry_audit.py — independent audit tool
    - infra/load-tests/baseline.js — k6 perf baseline
    - frontend/tests/a11y/baseline.spec.ts — Playwright+axe baseline
    - docs/baselines/README.md + docs/verification/README.md

  §2 Founder Decision Sprint (FD001-FD005)
    - docs/internal/legal_entity_decision.md — MISA/DIFC/Delaware brief
    - docs/internal/trademark_status.md — SAIP filing kit tracker
    - docs/hiring/{design_engineer, backend_engineer, head_of_cs}.md

  §3 Customer Validation (CV001-CV004)
    - docs/customer_learnings/pilot_agreement_template.md
    - docs/customer_learnings/pilot_template/success_criteria.md
    - docs/customer_learnings/pilot_template/kickoff_checklist.md
    - docs/customer_learnings/friction_log.md + feature_requests.yaml
    - docs/customer_learnings/weekly_review_template.md

  Truth registry updates
    - docs/registry/TRUTH.yaml — new verification_protocol,
      founder_decision_sprint, customer_validation sections

Gates (post-change):
  architecture_brief.py     40/40
  release_readiness_matrix  94/94 (added 30 new scaffold checks)
  v005_truth_registry_audit 19/19 SUPPORTED
2026-04-17 11:13:27 +00:00

70 lines
1.9 KiB
TypeScript

/**
* V007 — Accessibility Baseline (Playwright + axe-core)
*
* Covers 5 critical routes in both LTR (en) and RTL (ar) locales.
* Writes a combined JSON report to docs/baselines/a11y_YYYYMMDD.json.
* Every future a11y claim references that file.
*
* Run:
* pnpm --filter frontend exec playwright test tests/a11y/baseline.spec.ts
*/
import { test, expect } from '@playwright/test';
import AxeBuilder from '@axe-core/playwright';
import fs from 'node:fs';
import path from 'node:path';
const ROUTES = [
'/',
'/login',
'/deals',
'/approvals',
'/executive-room',
];
const LOCALES = ['en', 'ar'] as const;
type Result = {
route: string;
locale: string;
violations: number;
critical: number;
serious: number;
};
const results: Result[] = [];
for (const locale of LOCALES) {
for (const route of ROUTES) {
test(`a11y: ${locale} ${route}`, async ({ page }) => {
await page.goto(`${route}?locale=${locale}`);
const accessibilityScanResults = await new AxeBuilder({ page })
.withTags(['wcag2a', 'wcag2aa', 'wcag21aa'])
.analyze();
const violations = accessibilityScanResults.violations;
const critical = violations.filter(v => v.impact === 'critical').length;
const serious = violations.filter(v => v.impact === 'serious').length;
results.push({
route,
locale,
violations: violations.length,
critical,
serious,
});
expect(critical, `Critical a11y violations on ${locale} ${route}`).toBe(0);
});
}
}
test.afterAll(async () => {
const date = new Date().toISOString().slice(0, 10).replace(/-/g, '');
const outDir = path.resolve(__dirname, '../../../docs/baselines');
fs.mkdirSync(outDir, { recursive: true });
const outFile = path.join(outDir, `a11y_${date}.json`);
fs.writeFileSync(outFile, JSON.stringify({ date, results }, null, 2));
// eslint-disable-next-line no-console
console.log(`V007 baseline written to ${outFile}`);
});