Visual tests compare rendered appearance under controlled conditions. Fonts, viewport, data and animation can affect consistency.
Before you start
You should understand inputs, expected outputs and the boundaries of the component under test. State the risk a test should detect before choosing a tool or mock. Distinguish controlled dependencies from real integrations so the result does not imply more coverage than the test actually provides.
The practical goal is to reason through this situation: Capture a card with fixed data and a known viewport after fonts are ready. Read the walkthrough first, then try the interview exercise before opening its answer. The important part is explaining the decision and its consequences, rather than remembering a definition alone.
Step-by-step walkthrough
Step 1: Stabilize rendering conditions
Set viewport, data, fonts and animation policy deliberately.
Step 2: Wait for intended readiness
Capture after the state being compared is actually available.
Step 3: Review meaningful differences
A baseline update should acknowledge design intent, not silence unexplained drift.
Worked scenario
Capture a card with fixed data and a known viewport after fonts are ready.
A screenshot is taken before a web font loads and differs from the baseline only in text metrics. Waiting for font readiness addresses instability. A genuine wrapping change at a narrow breakpoint still requires review, so test representative responsive states rather than validating only the desktop screenshot.
Common mistake
A screenshot difference can reflect unstable input rather than a genuine design regression.
Verify the behavior
Compare known intended changes and deliberately unstable captures under controlled conditions.
Interview exercise
Review a changed screenshot.
Answer and reasoning
Determine whether the difference is intended and inspect relevant responsive states before updating the baseline.
Continue learning
Compare the scenario with the Software Testing interview questions and test your understanding with the Software Testing MCQs. For terminology and implementation details, consult the reference material.