State machines for multi-step forms
Explicit step models for sell, preorder, and limit-sharing flows instead of tangled conditionals.
02 — Case study
Anonymized client workPlaywright on the internal pricing console plus Jest on marketplace flows where a regression is expensive.
Role
Frontend Lead
Context
Cartalog pricing console, Caroline.id marketplace
Period
March 2022 – present
Stack
Playwright, Jest, CI/CD
01 — Problem
High-value navigation in the pricing console and fragile marketplace submits were easy to break without noticing until production.
The internal console moves analysts from the dashboard into watchlist and pricelab views through table and search interactions that depend on auth and client routing. On the public marketplace, the sell inspection submit path assembles a sensitive payload—wrong field mapping fails quietly in QA if nobody exercises the full wizard.
02 — Approach
Browser tests run against a logged-in storage state, use page objects for the dashboard, and target stable test-id attributes. Navigation specs wait for URL changes into watchlist and pricelab; a layout spec masks volatile charts and compares screenshots across Chromium, Firefox, and WebKit.
The consumer portal relies on Jest and React Testing Library for fast feedback on sell submission utilities and related hooks—no Playwright suite there. E2E depth sits on the console; the portal keeps regression coverage close to the payload builders.
Full Playwright coverage on every marketplace page would be slow and flaky for a large Next app. Splitting console E2E from portal unit tests matched where regressions actually hurt.
import type { Page, Locator } from '@playwright/test';
export class DashboardPage {
readonly tableRows: Locator;
readonly popularSearchItems: Locator;
constructor(private page: Page) {
this.tableRows = page.locator('[data-testid="dashboard-row"]');
this.popularSearchItems = page.locator('[data-testid="popular-search"]');
}
async goto() {
await this.page.goto('/');
}
async clickFirstTableRow() {
await this.tableRows.first().click();
}
}03 — Where AI helped
AI drafted initial Playwright boilerplate and selector lists; I tightened waits, auth setup, and screenshot masks so CI would not flake on chart data.
04 — Result
Dashboard-to-watchlist and dashboard-to-pricelab paths are guarded in CI on the console; sell inspection mapping stays covered in Jest on the portal. Test count and run-time metrics will be added when you confirm figures for publication.
Next project
Explicit step models for sell, preorder, and limit-sharing flows instead of tangled conditionals.