Testing Strategy & Suites
Relevant source files
The following files were used as context for generating this wiki page:
FusionOps employs a multi-layered testing strategy designed to ensure the reliability of its landing page factory, tracking systems, and deployment pipelines. The project utilizes a combination of unit, integration, and end-to-end (E2E) tests, with a strong emphasis on automated quality gates before deployment.
The strategy focuses on high-impact flows such as the LP Wizard, CloudFlare deployment, and tracking pixel functionality. A minimum code coverage requirement of 80% is established for unit and integration tests to maintain code quality standards.
Sources: CLAUDE.md:126-150, tests/e2e/README.md
High-Level Test Architecture
The testing ecosystem is split into three primary tiers: Unit/Integration tests using Vitest, E2E tests using Playwright, and specialized Quality Check pipelines that act as pre-deployment validators.
The architecture ensures that logic is verified at the lowest level before being integrated into full browser-based user journeys.
Sources: CLAUDE.md:126-150, src/services/quality-check/tests/quality-check-e2e.test.js:10-40
End-to-End (E2E) Testing
E2E tests verify the complete user journey from project creation to deployment. These tests run against a local dev server (typically port 4323 or 4321) and simulate real user interactions.
The LP Wizard Suite
The LP Wizard is the core feature of FusionOps, and its test suite is divided into several specialized files to cover its 7-step process.
| Test File | Focus Area | Description |
|---|---|---|
wizard-basic.spec.ts | Navigation | Verifies sidebar links and basic form rendering. |
wizard-flow.spec.ts | Multi-step | Tests the logic of moving through all 7 steps. |
wizard-complete.spec.ts | Comprehensive | Validates full data entry, edge cases, and final build. |
wizard-tracking.spec.ts | Integration | Specifically tests Voluum and Google Ads configuration. |
Sources: tests/e2e/FINAL_REPORT.md:25-38, tests/e2e/wizard/wizard-complete.spec.ts:10-30
Critical Path Sequence
The E2E suite verifies the following sequence for a standard "Smoke Test" to ensure application stability.
Unit & Integration Testing
Unit tests leverage Vitest for speed and isolation. These tests target individual utility functions, React components, and CloudFlare Worker handlers.
Test Coverage Requirements
- Minimum Coverage: 80% for unit and integration tiers.
- Key Target Areas: Campaign CRUD operations, template management, and lead handling.
- Worker Testing: Includes testing the API Worker, Pixel Worker, and Callback Worker in isolation.
Sources: CLAUDE.md:126-140
Pre-Deployment Quality Check Pipeline
A unique feature of the FusionOps testing strategy is the Quality Check E2E Pipeline. This service verifies that the built and fingerprinted HTML/CSS is "deploy-ready" by running a series of automated validators.
Validator Modules
The system runs several critical checks before allowing a deployment to proceed:
- Astro Leak Validator (QUAL-03): Ensures no
import.meta.envor sensitive VITE environment variables are leaked into the final client-side HTML. - Tracking Validator (QUAL-02): Verifies that tracking pixels (Voluum or Google Ads) are correctly injected.
- Viewport Validator (QUAL-01): Confirms the presence of essential mobile-responsive meta tags.
- Lighthouse Validator (QUAL-05): Checks performance, accessibility, and SEO scores against thresholds (typically 95+).
Sources: src/services/quality-check/tests/quality-check-e2e.test.js:80-140, scripts/alpha-verify-deployment.js:84-130
Quality Gate Logic Flow
Testing Tools and Commands
Developers are expected to run tests frequently during the TDD (Test-Driven Development) cycle.
| Command | Purpose |
|---|---|
npm test | Run Vitest unit/integration tests. |
npm run test:e2e | Run Playwright E2E tests in headless mode. |
npm run test:report | Display the HTML report from the last Playwright run. |
npx playwright test --debug | Debug E2E tests with a step-by-step inspector. |
npm run test:coverage | Generate a coverage report for the project. |
Sources: CLAUDE.md:126-160, tests/e2e/README.md:16-50
Environment Configuration
Testing requires specific environment variables to interact with backend services and local servers.
| Variable | Description | Default |
|---|---|---|
BASE_URL | The URL of the application under test. | http://localhost:4323 |
CI | Boolean flag for Continuous Integration environments. | false |
UPDATE_SNAPSHOTS | If true, updates visual regression baselines. | false |
Sources: tests/e2e/README.md:65-75
Conclusion
The FusionOps testing strategy provides a robust safety net by combining standard E2E browser testing with specialized build-time validators. By enforcing strict quality gates (QUAL codes) and high coverage requirements, the system prevents common deployment errors such as environment leaks or broken tracking pixels, ensuring that every landing page generated is production-ready.