Skip to main content
Clinford Jordano Valencia
All projects
Platform

A Test State Injection Tool

Server-backed state injection that lets QA and automation jump straight to any step of a long flow, cutting regression setup from many minutes to under one.

Stack
TypeScript · Playwright · BFF · Test database

The problem

To check a bug on step 5 of a long flow, you first had to complete steps 1 to 4 by hand: valid details, uploads, checks. Every time, for every pull request and every automated run.

The approach

The tool lets a tester or a script open the app already in the state they need.

  1. A Playwright script or a QA engineer loads the page with a secure test token, for example ?state=step_4_ready.
  2. The frontend sees the token on hydration and forwards it in a header to the BFF.
  3. The BFF checks that the environment is strictly non-production, then seeds the user's session in the test database: earlier steps completed, the active pointer on step 4.
  4. The BFF returns a real session token and the UI renders step 4 immediately.

I chose server-backed injection over mocking localStorage on the client. Modern apps validate sessions on the backend, so a client-only mock drifts from reality and produces tests that pass here and fail in production.

The result

Regression setup went from 10–20 minutes per cycle to under a minute. Across many pull-request runs and automation suites each week, that gave back hundreds of engineering hours per quarter.