E2E testing for pricing console
Playwright on the internal pricing console plus Jest on marketplace flows where a regression is expensive.
01 — Case study
Public productOne logic layer powering both web views, with thin presentation layers on top.
Role
Frontend Lead
Context
Caroline.id marketplace, Cartalog consumer app, Cartalog pricing console
Period
March 2022 – present
Stack
Next.js, TypeScript, Zustand, React Hook Form
Logic layer
Headless hooks
View
Desktop
Thin presentation layer
View
Mobile
Thin presentation layer
01 — Problem
Desktop and mobile web followed the same business rules, but each view carried its own copy of the logic.
On Caroline.id, the sell-car funnel was the clearest pain point: desktop used a multi-section form while mobile used a full-screen drawer, yet both needed the same price lookup, inspection scheduling, and validation. Buy listing filters and vehicle detail split across desktop and mobile routes while sharing product rules. On Cartalog’s consumer app, market search kept one submit and limit-check pipeline but mounted different desktop and mobile form shells. On the pricing console, watchlist and search filters repeated dependent dropdown logic that had to stay aligned whenever API shapes changed.
02 — Approach
Caroline: sell flow in a wizard hook; listing in a Zustand store with hooks for URL sync and soft navigation. Cartalog consumer: search orchestration, captcha, and limit handling in the parent filter module; give-to-get submit in a dedicated mutation hook; step UI only receives callbacks. Console: filter option loading and path sync in shared hooks consumed by desktop filter chrome.
Caroline desktop and mobile sell views import the same wizard. Cartalog lazy-loads separate FormDesktop and FormMobile while sharing one react-hook-form instance and submit handlers. Give-to-get steps only differ by layout props such as mobile sheet styling. Console search reuses FormDesktop with device-aware layout where mobile access is intentionally blocked, without forking filter data logic.
One cross-platform form would have forced a single layout and hurt mobile drawer UX on Caroline and Cartalog. Headless hooks and stores plus view-specific components kept parity across three codebases without merging unlike surfaces.
// Logic only: step state, field setters, submit handlers — no markup.
export function useSellWizard() {
const [activeStep, setActiveStep] = useState(0);
const [modalOpen, setModalOpen] = useState(false);
const handleCarDataSubmit = () => setActiveStep(1);
const handleOpenModal = () => setModalOpen(true);
return {
activeStep,
modalOpen,
handleCarDataSubmit,
handleOpenModal,
// field state, price estimate, reset, …
};
}
// Desktop form and mobile drawer both call useSellWizard():
const wizard = useSellWizard();03 — Where AI helped
I used AI for boilerplate and first drafts of unit tests around sell inspection payloads and filter path parsing. I kept hook boundaries and which fields freeze across wizard steps myself—the same discipline applied when splitting Cartalog search from its mobile modal wrapper.
04 — Result
From March 2022 onward, sell, listing, search, and watchlist filter changes land once in the logic layer across Caroline and Cartalog surfaces; desktop and mobile stay aligned without copy-pasting validators or API calls. I will add measured share-of-logic metrics when those numbers are cleared for public use.
Next project
Playwright on the internal pricing console plus Jest on marketplace flows where a regression is expensive.