bombadil browser shrink #

(EXPERIMENTAL) Shrink a trace with a property violation into a smaller one that still violates it (best-effort).

bombadil browser shrink [OPTIONS] <ORIGIN> [SPECIFICATION_FILE]

Arguments #

<ORIGIN>
Starting URL of the test. Without --allow-url, exploration stays on the origin’s scheme, host and port. For a file:// origin it stays on that exact file. With one or more --allow-url entries, those define the exploration boundary instead (include the origin there if it should remain allowed).
[SPECIFICATION_FILE]
A custom specification in TypeScript or JavaScript, using the @antithesishq/bombadil package on NPM.

Options #

--width <WIDTH>

Browser viewport width in pixels.

Default: 1024

--height <HEIGHT>

Browser viewport height in pixels.

Default: 768

--device-scale-factor <DEVICE_SCALE_FACTOR>

Scaling factor of the browser viewport, mostly useful on high-DPI monitors when in headed mode.

Default: 1

--instrument-javascript <INSTRUMENT_JAVASCRIPT>

What types of JavaScript to instrument for coverage tracking. Comma-separated list of: “files”, “inline”.

Default: files,inline

--chrome-grant-permissions <CHROME_GRANT_PERMISSIONS>

Comma-separated list of Chrome permissions to grant.

Default: local-network-access,local-network,loopback-network

--chrome-virtual-time-policy <CHROME_VIRTUAL_TIME_POLICY>
Optional virtual time policy for Chrome, used to speed up execution of timer-heavy applications. One of: Advance, Pause, PauseIfNetworkFetchesPending.
--header <KEY=VALUE>
Extra HTTP header to send with all browser requests, in KEY=VALUE format. Can be specified multiple times.
--cookie <SET-COOKIE>
Cookie to set in the browser before testing. Accepts plain NAME=VALUE (scoped to the origin) or Set-Cookie syntax with attributes such as Domain, Path, Secure, and HttpOnly. Unlike --header, these become real browser cookies. Can be specified multiple times.
--allow-url <MATCH_PATTERN>
Exploration boundary as Chrome extension match patterns, e.g. *://*.example.com/*. Replaces the implicit origin match pattern. For the pattern syntax, see Match patterns.
--trace <TRACE_PATH>
Trace to shrink (file path or directory containing trace.jsonl).
--property <PROPERTY>
Name of the property to shrink for. Required if the trace has violations of more than one property.
--output-path <OUTPUT_PATH>
Where to store the shrunk trace. Defaults to a fresh temporary directory.
--output-path-overwrite
Overwrite any existing trace at --output-path.
--time-limit <TIME_LIMIT>
Maximum time to shrink for, after which the smallest trace found so far is kept. Accepts a number with a unit suffix: s (seconds), m (minutes), h (hours), or d (days).
--parallelism <PARALLELISM>

Number of test runs to execute in parallel. Only use this if runs are isolated from each other (e.g. not sharing files or a backend).

Default: 1

--calibration-runs <CALIBRATION_RUNS>

Number of times to replay the original trace to measure how reliably it reproduces the violation.

Default: 3

--confirmation-runs-max <CONFIRMATION_RUNS_MAX>

Maximum number of runs used to confirm that a smaller trace reproduces reliably enough.

Default: 5

--headless
Whether the browser should run in a visible window or not.
--no-sandbox
Disable Chromium sandboxing.
-h, --help
Print help.

Examples #

Shrink the trace in my-test, which violates a single property:

bombadil browser shrink --headless --trace my-test https://example.com

Shrink for a specific property, using four parallel browsers:

bombadil browser shrink --headless --trace my-test --property noErrors --parallelism 4 https://example.com spec.ts