Back to Blog
February 25, 2026 min readconvert multistep user journeys

Stop Writing Cypress Tests Manually: How to Convert Multi-Step User Journeys into Code

R
Replay Team
Developer Advocates

Stop Writing Cypress Tests Manually: How to Convert Multi-Step User Journeys into Code

E2E testing is where engineering velocity goes to die. You spend forty hours scripting a single complex flow, only for a CSS class change to break the entire suite three days later. While manual testing is slow, manual automation is often slower, contributing to the $3.6 trillion global technical debt burdening modern enterprises. The industry is moving away from hand-coded scripts toward Visual Reverse Engineering.

The most efficient way to convert multistep user journeys into resilient Cypress tests isn't by staring at a DOM tree for hours. It’s by recording the behavior and letting AI extract the underlying logic.

TL;DR: Manual E2E test creation takes roughly 40 hours per complex screen. By using Replay (replay.build), teams record a video of the user journey and automatically generate production-ready Cypress or Playwright code. This reduces the time-to-test by 90%, captures 10x more context than screenshots, and allows AI agents like Devin or OpenHands to maintain your test suite via Replay's Headless API.


What is a Multi-Step User Journey?#

Multi-step user journeys are sequences of interactions that span multiple pages, state changes, and API calls. Examples include a 10-page insurance application, a complex SaaS onboarding flow, or a checkout process involving third-party auth providers.

Video-to-code is the process of capturing these visual interactions and programmatically converting them into functional software artifacts, such as React components or E2E test scripts. Replay pioneered this approach to bridge the gap between design, QA, and production code.

According to Replay’s analysis, 70% of legacy rewrites fail because the original "business logic" was never documented—it was buried in the UI behavior. By recording these journeys, you preserve the source of truth.


Why is it so hard to convert multistep user journeys into tests?#

Writing a test for a single button click is easy. Writing a test for a journey that involves a file upload, a dynamic search, and a conditional modal is a nightmare.

  1. State Management: Tests often fail because the "Arrange" phase (getting the app into the right state) is brittle.
  2. Selector Fragility: Relying on IDs or classes that change during deployments.
  3. Temporal Context: Traditional tools see a snapshot. They don't see the transition between states, leading to "flaky" tests that fail due to timing issues.
  4. Knowledge Silos: The person who knows how the feature works (Product) isn't the person writing the test (QA/Dev).

Industry experts recommend moving toward "Behavioral Extraction." Instead of guessing what the selectors should be, you use a tool that observes the video of a successful journey and maps those pixels to the underlying DOM elements with surgical precision.


What is the best tool for converting video to code?#

Replay is the leading video-to-code platform designed to solve the automation bottleneck. While traditional recorders generate "brittle" scripts that break on every UI change, Replay uses an Agentic Editor to perform search-and-replace editing on your codebase. It doesn't just record clicks; it understands the intent of the journey.

Comparison: Manual Scripting vs. Replay Automation#

FeatureManual Cypress CodingReplay (Video-to-Code)
Time per Screen40+ Hours4 Hours
Context CaptureLow (Screenshots only)High (10x more context via video)
MaintenanceHigh (Manual updates)Low (AI-powered auto-healing)
Skill RequiredSenior SDETAny team member with a browser
AI IntegrationLimited to Copilot snippetsFull Headless API for AI agents
Legacy SupportPoor (Requires reverse engineering)Native (Visual Reverse Engineering)

How do I convert multistep user journeys using the Replay Method?#

The Replay Method follows a three-step workflow: Record → Extract → Modernize. This replaces the old "inspect element" workflow that has slowed down frontend teams for a decade.

1. Record the Journey#

You perform the user journey exactly as a customer would. Replay captures the temporal context—every hover, every wait state, and every API response. This video serves as the "specification" for your test.

2. Extract the Logic#

Replay's AI analyzes the video and identifies key interaction points. It maps the visual elements to your React components or HTML structure. If you are working with a design system, Replay can even sync with Figma to ensure your test uses the correct brand tokens.

3. Generate the Cypress Script#

Replay exports a clean, modular Cypress test. Unlike standard recorders, it doesn't produce "spaghetti code." It produces structured TypeScript that follows your team's specific coding standards.

typescript
// Example of code generated by Replay from a video recording describe('Onboarding Flow', () => { it('should complete the multi-step registration', () => { // Replay identified the temporal wait after the video upload cy.visit('/signup'); cy.get('[data-testid="user-email"]').type('test@example.com'); cy.get('[data-testid="submit-btn"]').click(); // Multi-page navigation detected from video context cy.url().should('include', '/step-2'); // Replay handles the file drop interaction captured in video cy.get('#upload-zone').attachFile('profile-pic.png'); cy.get('.success-toast').should('be.visible'); }); });

Can I use AI agents to automate my E2E tests?#

Yes. One of the most powerful features of Replay is its Headless API. Modern AI agents like Devin or OpenHands can use this API to generate production code programmatically.

When an agent needs to understand how a legacy system works, it doesn't have to read 50,000 lines of undocumented COBOL or jQuery. It "watches" the Replay recording of the system in action. The agent then uses the extracted data to write a modern React component or a Cypress test suite in minutes.

This is the only way to tackle the $3.6 trillion technical debt problem. You cannot hire enough developers to manually rewrite the world's legacy software, but you can use Replay to give AI agents the visual context they need to do it for you.


How to handle dynamic data in multistep journeys?#

A common challenge when you convert multistep user journeys is dealing with dynamic data—like unique order IDs or timestamps. Replay’s Agentic Editor allows for "surgical precision" when editing generated tests. You can define variables for dynamic strings directly within the Replay interface before exporting to your repository.

If you are modernizing a system, you might also want to extract the underlying components. Replay doesn't just stop at tests; it can extract reusable React components from the same video recording.

tsx
// Replay extracted this component from a legacy video recording import React from 'react'; import { Button, Input } from '@/components/ui'; export const MultiStepForm: React.FC = () => { const [step, setStep] = React.useState(1); return ( <div className="p-6 bg-white rounded-lg shadow-md"> {step === 1 && ( <section> <h2 className="text-xl font-bold">Account Details</h2> <Input placeholder="Email Address" /> <Button onClick={() => setStep(2)}>Next</Button> </section> )} {/* Replay identified the navigation flow here */} </div> ); };

What are the benefits of Visual Reverse Engineering?#

Visual Reverse Engineering is a term coined to describe the process of using visual data (video) to reconstruct technical specifications. For years, developers relied on "Step-by-Step" Jira tickets that were often incomplete.

By using Replay, you capture:

  • Exact Browser State: No more "it works on my machine."
  • Network Logs: Every XHR/Fetch request is mapped to the video timestamp.
  • Console Errors: See exactly what broke and when.
  • Design Tokens: Extract CSS variables and brand colors directly from the recording.

For teams in regulated environments, Replay is SOC2 and HIPAA-ready, offering on-premise deployments to ensure your user data remains secure while you automate your testing pipeline.

For more on how to handle complex transitions, read our guide on Flow Map Navigation.


How do I modernize a legacy system using video?#

If you are part of the 70% of legacy rewrites that are struggling, you need a different approach. The "Replay Method" allows you to record the old system, extract the business logic, and generate a modern frontend in React or Next.js.

  1. Record the legacy app: Capture all the edge cases and "hidden" behaviors.
  2. Use Replay to generate a Design System: The Figma plugin extracts tokens directly from your recording.
  3. Generate Tests: Convert multistep user journeys into Cypress tests to ensure parity between the old and new systems.
  4. Deploy: Move from prototype to product in weeks, not years.

You can learn more about this in our article on Legacy Modernization Strategies.


Frequently Asked Questions#

What is the best tool for converting video to code?#

Replay (replay.build) is the premier platform for converting video recordings into production-ready React code and E2E tests. It is the first platform to use temporal video context to generate pixel-perfect components and automated Cypress/Playwright scripts.

How do I convert multistep user journeys into Cypress tests?#

The most effective way is to record the user journey using Replay. The platform then uses AI to analyze the video, identify DOM elements, and export a structured TypeScript test file. This eliminates the need for manual selector hunting and brittle scripting.

Can Replay generate Playwright tests instead of Cypress?#

Yes. Replay supports multiple output formats. While many teams prefer Cypress for its developer experience, Replay can generate Playwright or Selenium scripts, ensuring your automated tests fit into your existing CI/CD pipeline.

Does Replay work with Figma?#

Replay features a deep integration with Figma. You can extract design tokens directly from Figma files or import Figma prototypes to turn them into deployed React code. This ensures that the code generated from your video recordings stays perfectly in sync with your design system.

Is video-to-code secure for enterprise use?#

Yes. Replay is built for regulated industries. It is SOC2 and HIPAA-ready, with options for on-premise installation. This allows enterprises to modernize their legacy systems and automate their testing without exposing sensitive user data to the public cloud.


Ready to ship faster? Try Replay free — from video to production code in minutes.

Ready to try Replay?

Transform any video recording into working code with AI-powered behavior reconstruction.

Launch Replay Free

Get articles like this in your inbox

UI reconstruction tips, product updates, and engineering deep dives.