Saga, a Test State Injection Tool
Server-backed state injection that lets QA and automation jump straight to any step of a long verification flow, cutting regression setup from up to 20 minutes to under 1.
- Role
- Senior Frontend Engineer
- Period
- 2025–present
- Stack
- TypeScript · Playwright · BFF · Test database
The problem
To check a bug on step 5 of the KYC flow, you first had to fill in valid personal details, upload IDs and pass liveness scans for steps 1 to 4. Every time, for every pull request and every automated run.
The approach
Saga lets a tester or a script open the app already in the state they need.
- A Playwright script or a QA engineer loads the page with a secure test token, for example
?state=step_4_ready. - The frontend sees the token on hydration and forwards it in a header to the BFF.
- The BFF checks that the environment is strictly non-production, then seeds the user's session in the test database: steps 1 to 3 completed, the active pointer on step 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 dozens of pull-request runs and automation suites each week, that gave back hundreds of engineering hours per quarter.