Skip to main content

Browser

The generator.browser section turns a replay into a browser journey replay: the generator runs Playwright specs in Chromium instead of sending recorded requests. Browser Journeys explains how to write, run and read them.

proxymock replay --browser, proxymock cluster replay start --browser and the dashboard's replay launcher fill this section in for you. Set it yourself to run journeys from your own test config.

{
"generator": {
"browser": {
"enabled": true,
"baseUrl": "http://shop-frontend.web:80",
"responderProxy": true,
"workers": 2,
"journeyTimeout": "60s",
"blockPatterns": ["**/www.googletagmanager.com/**"],
"storageState": {
"cookies": [
{ "name": "session", "value": "${{secret:shop-session/cookie}}", "domain": "shop-frontend.web" }
]
}
}
}
}

Fields​

FieldTypeDefaultDescription
enabledbooleanfalseRun browser journeys instead of the recorded requests.
journeysDirstringnoneA folder of Playwright specs on the generator's filesystem. Its node_modules, when present, supplies the journeys' dependencies and the @playwright/test version they run with. proxymock replay --browser sets it.
journeyFilesmap of string to stringnoneSpec files carried in the config, keyed by path relative to the journeys root, for a generator that cannot read the author's files. Merged over journeysDir when both are set. Without either, the journeys stored with the snapshot run.
baseUrlstringthe replay's default targetThe frontend URL relative URLs in the journeys resolve against.
workersinteger1How many journeys run at once, each in its own browser context.
journeyTimeoutdurationPlaywright's default (30 seconds)The longest one journey may run, such as "60s".
responderProxybooleanfalseSend the browser's traffic through a responder running beside it, which answers the calls the recording has and passes every other host through. In a cluster the operator adds the responder to the generator pod. See Mocks and real APIs.
observeRealApisbooleanfalseWith responderProxy, send every call to the real API instead of answering from the recording, and compare each answer with the recorded call it matches.
proxystringnoneSend the browser's traffic through this HTTP proxy instead, such as proxymock mock at http://localhost:4140. Wins over responderProxy.
proxyBypasslist of stringsnoneHosts that skip proxy, in Playwright's bypass format.
ignoreHttpsErrorsbooleanfalseAccept any TLS certificate, needed when a proxy intercepts HTTPS.
blockPatternslist of stringsnoneURL globs aborted in the browser, for analytics, chat and error-reporting scripts that make journeys nondeterministic.
storageStateobjectnoneCookies and local storage every journey starts with. See Storage state.
tokenslistnoneTokens minted once before the journeys start, for ${{token:<name>}} in the storage state. See Tokens.

A journey replay normally runs with cluster.replayMode set to generator-only: the responder it needs runs inside the generator pod, so a separate responder deployment has nothing to answer.

Storage state​

FieldDescription
cookies[].name, cookies[].valueThe cookie. The value can be or contain a ${{secret:name/key}} or ${{token:<name>}} reference.
cookies[].domainThe cookie's domain, such as shop.example.com or .example.com.
cookies[].pathDefaults to /.
cookies[].httpOnly, cookies[].secureThe cookie's flags.
cookies[].sameSiteStrict, Lax or None. Defaults to Lax.
origins[].originscheme://host[:port], such as https://shop.example.com.
origins[].localStorageLocal storage keys and values for that origin. Values can contain references like cookie values.

In a cluster the operator mounts the Kubernetes secrets the references name, and the generator fills the values in before the first journey starts. It writes the resolved state to a file only it can read and removes it after the run.

Tokens​

FieldDescription
tokens[].nameThe name ${{token:<name>}} refers to.
tokens[].fetchA token_fetch or oauth_client_credentials transform, as { "type": ..., "config": { ... } }. Values can reference ${{secret:name/key}}. Its prefix setting does not apply.

Each token is minted once, before the first journey starts, and is not refreshed during the run. Start signed in has a worked example.

Goals​

A journey replay reports the browserJourneyPassPct metric and web vitals metrics such as browserLcpP95, which goals can use. Read the results lists them all.