zudo-test-wisdom

Type to search...

to open search from anywhere

The 5 Testing Levels

Introduction to the five testing levels for frontend verification.

Overview

Frontend testing is not a single activity — it is a spectrum of verification methods, each with different capabilities and blind spots. This section defines five distinct levels, ordered by the scope of what they can verify.

graph LR L1[Level 1<br/>Unit/Logic] --> L2[Level 2<br/>DOM Component] L2 --> L3[Level 3<br/>Build Output] L3 --> L4[Level 4<br/>E2E Browser] L4 --> L5[Level 5<br/>Visual Verify]

Summary Table

LevelNameToolsCan VerifyBlind Spots
1Unit/Logicvitest, jestPure functions, data transforms, state logicDOM, CSS, rendering
2DOM Componentvitest + jsdom, Testing LibraryComponent output, props, DOM structureVisual rendering, CSS
3Build Outputvitest on built filesSSG output, templates, bundler configRuntime behavior, visuals
4E2E BrowserPlaywright, headless-browserUser interactions, navigation, full pageSubtle visual details
5Deterministic + Visualverify-ui + headless-browserComputed styles, pixel-level renderingMinimal blind spots

The Escalation Rule

⚠️ Warning

When a test at the current level passes but the user reports the problem persists, do not re-run the same test. Escalate to the next level.

The levels are ordered by coverage breadth. Each higher level catches categories of bugs that lower levels structurally cannot detect. For example, a unit test cannot catch overflow: hidden hiding an element, because unit tests do not process CSS at all.

Choosing the Right Level

Not every task requires Level 5. The goal is to match the test level to the nature of the change:

  • Logic changes — Level 1 is sufficient
  • Component behavior — Level 2 covers it
  • Build configuration — Level 3 targets it
  • Interactive flows — Level 4 is needed
  • Visual/CSS bugs — Level 5 is required

See the Decision Guide for a detailed mapping table.

Revision History