E2E Testing & Verification
Relevant source files
The following files were used as context for generating this wiki page:
The E2E Testing & Verification framework for Comply-Quick ensures the integrity of the compliance package generation pipeline, the security of paid tier entitlements, and the accuracy of technical site scans. The verification strategy combines automated unit/integration tests using Vitest with manual browser-based test flows and shell-verified endpoint checks.
The scope of testing covers the transition from anonymous site scanning to premium package generation, including Stripe integration, SEO metadata validation, and persistent storage of compliance projects.
Sources: test-plan-phase6.md:3-10, src/tests/ClauseEngine.test.ts:1-10
Testing Architecture and Tooling
The project utilizes a multi-layered testing approach to validate different system components.
Automated Test Suites
The core logic of the ClauseEngine and the Compliance API is validated through Vitest. These tests ensure that the conditional evaluation matrix correctly maps developer stacks (e.g., Shopify, Next.js, Wix) to protective legal text and generates accurate compliance scores.
Sources: src/tests/ClauseEngine.test.ts:15-50, src/tests/api-compliance.test.ts:13-35
Manual & Shell Verification
Critical infrastructure elements such as SEO and Stripe webhooks are verified via shell commands and browser-recorded sessions.
| Component | Verification Method | Derived Requirement |
|---|---|---|
| Sitemap/Robots | Shell GET requests | Must return valid XML/rules with correct priorities |
| Stripe API | Shell POST / Webhooks | Must handle dev-mode fallbacks (503) and grant entitlements |
| UI/UX Flow | Browser Recording | Navigation, Wizard completion, and Paywall rendering |
Sources: test-plan-phase6.md:12-20, test-report.md:5-15
Core Test Flows
The verification process is structured around key user journeys, primarily focusing on the "Scan-to-Premium" funnel.
User Journey: Compliance Generation and Purchase
This flow validates the transition from a free preview to a paid project.
The diagram shows the standard conversion funnel from initial scan to premium project persistence.
Sources: test-plan-phase6.md:31-50, test-report.md:34-45
Implementation Verification
The following table details specific pass/fail criteria for the Command Center and Wizard components during Phase 6 testing.
| Test Case | Step | Pass Criteria |
|---|---|---|
| Command Center Render | Navigate to /dashboard/home | Header shows "Compliance Command Center"; Renders empty state correctly |
| Premium Unlock | Complete Wizard + Purchase | URL contains ?status=success; No blur overlay on privacy sections |
| Data Persistence | Navigate to Home after purchase | Generated project appears in "Active Projects" list with correct framework |
| Export Integrity | Click Download Button | Browser triggers .md file download with valid content |
Sources: test-plan-phase6.md:26-64
Component Logic Verification
Clause Engine & API Validation
The ClauseEngine is tested to ensure it handles various framework and region combinations.
- Framework Specifics: Validation that WooCommerce-specific clauses (e.g., "Plugin & Extension Ecosystem Exclusion") appear only when WooCommerce is selected.
- Regional Disclosures: Verification that selecting
canada_pipedacorrectly includes the "Office of the Privacy Commissioner of Canada" disclosure. - API Response: The
POST /api/complianceendpoint must return a200status with valid JSON and metadata versioning (e.g.,2.0.0).
Sources: src/tests/ClauseEngine.test.ts:70-85, src/tests/api-compliance.test.ts:13-35
Site Scanner Analysis
The scanner pipeline is verified for its ability to detect tracking technologies both in static HTML and via headless rendering.
This diagram illustrates the data flow for deep tracker detection using a headless worker.
Sources: src/tests/scanner.test.ts:40-60, src/lib/scanner/pipeline.ts:43-55
Entitlement & Billing Verification
Verification of Stripe integration ensures that webhook events correctly update the database and UI state.
- Annual Billing: Verification that the annual toggle updates pricing correctly (e.g.,
$29/moto$290/yr) and that Stripe Checkout reflects this amount. - Webhook Processing: Verification that the
checkout.session.completedevent triggers a database update settingtier=agencyandstatus=active. - UI State Change: Ensuring the Command Center badge updates from "Free" to "Agency" immediately following a successful payment.
Sources: test-report.md:5-15, test-report.md:34-45
Summary
E2E Testing & Verification for Comply-Quick ensures that the technical mapping between a website's stack and its legal requirements is accurate and that the commercial funnel for premium features is secure. By combining rigorous Vitest suites for the logic engine with documented manual test plans for the UI and billing systems, the project maintains a verified path from site scanning to liability-shielded deployment.