use. Select one or more targets with momentic run --target.
momentic.config.yaml
<test name> [<target>].
Select tests
object
A target name uses letters, digits, and hyphens and is case sensitive.
{} is
a valid target: it selects every test and changes no settings.string[]
Select tests that have at least one of these labels.
string[]
Select tests whose file path matches one of these globs. Paths are relative to
the project root.
string[]
Drop tests whose file path matches one of these globs. Exclusions apply after
labels and include.--labels,
--include, and --exclude on the command line narrow the target further; they
don’t replace its selectors. The CLI --include and --exclude flags take
regular expressions, while target include and exclude take globs.
If a selected target matches no tests, momentic run fails before any test
starts.
Override browser settings
string | object
Browser viewport, as
"<width>,<height>" or { width, height }.string | null
User agent string.
null uses the browser’s native user agent; the string
"null" is sent as a literal user agent.string
BCP 47 language tag such as
fr-FR. Sets the browser language,
navigator.language, number and date formatting, and the default
Accept-Language header. It doesn’t change the timezone, geolocation, or
URLs.browser settings, test settings, target use, then settings you
pass on the command line.
Inspect targets
List each target with its selectors, settings, and number of matching tests:--json to either command for machine-readable output.
Notes
- A run without
--targetignores targets and uses test settings, even when the project defines targets. --targetcan’t be combined with--ai-select,--ai-select-dry-run, or--from-snapshot.- A target that sets
use.localefails the run if anAccept-Languageheader is also set in test, environment, or project settings, or with--custom-headers. Remove one of the two. - Targets that set
useskip step cache reads and writes, since cached steps don’t record the viewport, user agent, or locale. - Targets that set
usekeep their own visual diff baselines under<goldenFileDir>/targets/<name>/. An explicit baseline path getstargets/<name>/inserted before the file name. - Target names appear in local output and in JUnit, JSON, Allure, Playwright JSON, and Buildkite reports. Run pages in the Momentic app don’t show the target yet.
- A target has no suite-level setup or teardown and can’t set environment
variables. Unknown keys under a target or its
usefail config validation.