---
title: "Why Playwright Test Repair Needs API Evidence | Speedscale"
description: "Journey Explorer builds Playwright tests from recorded API traffic. Journey Heal checks a locator repair against the last passing replay."
canonical: "https://speedscale.com/blog/why-playwright-tests-need-api-evidence/"
---

[Site index](https://speedscale.com/blog/llms.txt) | [Markdown](https://speedscale.com/blog/why-playwright-tests-need-api-evidence/index.md) | [Canonical page](https://speedscale.com/blog/why-playwright-tests-need-api-evidence/)

![A teal beam through a glass prism illuminates amber indicators on an optical bench.](https://speedscale.com/_astro/featured-image.DbJrXlKk_ZhqcHf.webp)

# Why Playwright Test Repair Needs API Evidence

Nov 24, 2026

[By Matt LeRay](https://speedscale.com/blog/author/matt-leray/)

[API Testing](https://speedscale.com/blog/category/api-testing/) [Developer tools](https://speedscale.com/blog/category/developer-tools/)

* * *

A Playwright test opens **Order #2** and checks that an order details panel appears. Then the product team renames the link to **Notebook details**. The old locator times out. A repair that clicks **Order #1** could make the test pass again if the assertion only checks for a panel. The test would now cover a different order, and the green check would hide the switch.

The same gap shows up when you write a test from scratch. A traffic recording can tell you that a shopper signed in and opened a particular order. It rarely tells you which visible controls to drive on today’s frontend. You have to reconstruct that sequence and decide what the spec should verify.

**Journey Explorer** and **Journey Heal** use recorded API calls to address both problems. Explorer finds the browser actions that produced the calls and writes a Playwright spec. Heal uses the calls from a passing replay to verify that a proposed selector change preserves the flow. [Explore and heal journeys](https://docs.speedscale.com/guides/browser-journeys/explore-and-heal/)

## Build a browser test from a recorded session

Journey Explorer starts with one session’s ordered API calls. It opens the current frontend in Chromium and tries links, buttons, or forms. When it tests another candidate action, it starts with a fresh browser context and repeats the steps it has found so far. That keeps an earlier attempt from changing the page state for the next one.

An action counts when it produces the target call and the mock answers that call from the recording. For example, if the recorded session opened `GET /api/orders/2`, Explorer looks for the action that leads there. It can also fill a form using the recorded values and list calls it could not reach.

Explorer writes a plain Playwright spec, with named steps and waits for the expected responses. That gives you a test tied to what the browser did over the network. Add assertions for the things that matter to the shopper, such as the order number and the items shown in the panel. The response waits and UI assertions cover different parts of the same journey. [Write browser journeys](https://docs.speedscale.com/guides/browser-journeys/write-journeys/)

## Verify a locator change against a passing replay

Journey Heal starts with a failed action whose locator can no longer find the element. It ranks candidate elements by similarity to the old locator’s text and role. For each candidate, two checks must pass. The entire Playwright journey has to succeed with its existing assertions, and it has to produce the same collection of API calls as the most recent passing replay, matching methods, paths, and query strings and counting repeats.

We reproduced the order example in a small shop fixture. Clicking **Order #1** left the test green but sent `GET /api/orders/1` in place of `GET /api/orders/2`. Heal rejected that candidate. Clicking **Notebook details** passed the journey and made the same calls as the baseline, so Heal proposed that locator in a patch.

Why check the whole journey? A click can start an asynchronous request after the next Playwright step has begun. Comparing requests step by step can assign the call to the wrong action. Comparing the whole journey keeps that request in the check. [How Heal chooses a replacement](https://docs.speedscale.com/guides/browser-journeys/explore-and-heal/#heal-a-journey-whose-element-moved)

## Run against recorded responses

Both commands load the frontend from its running server and route its API traffic through a mock backed by the recording. A missing response produces a mock miss. This lets Explorer try a checkout button or submit a form with the live API stopped. If the API shares the frontend’s host and port, run it on a separate origin first so its traffic can go through the mock.

Explorer and Heal run locally through the proxymock CLI or the `browser_journeys` MCP tool. Both entry points provide a locator diff for review. Use [the companion mock-lab walkthrough](https://speedscale.com/blog/generate-and-heal-playwright-tests/) to generate a spec, rename a control, and review a repair with the shop API stopped.

## Frequently asked questions

### How does proxymock generate a Playwright test from a recording?

Journey Explorer tries actions on the current frontend until they produce the recorded session's API calls and the mock answers those calls from the recording. It writes the actions and response waits into a Playwright spec.

### How does Journey Heal validate a locator repair?

The entire journey must pass and make the same API calls, including repeated calls, as the newest replay in which it passed. Heal proposes a locator patch for review.

### Does Journey Heal edit Playwright assertions?

Assertions stay untouched. Heal targets a failed action with an inline locator and needs a passing replay baseline to validate the proposed change.

## Table of Contents

## Stop writing API mocks by hand

proxymock records real traffic from your running app and replays it as mocks for HTTP, gRPC, Postgres, Kafka, and more. Install locally, activate once, and start recording.

[Install proxymock](https://docs.speedscale.com/proxymock/getting-started/installation/) [View the docs](https://docs.speedscale.com/proxymock/)
