CLI

The spectest command runs suites and manages the test environment. All options correspond to configuration fields and may be supplied via the config file or the command line.

npx spectest [suiteFile] [options]

Options

FlagDescriptionDefault
--config=<file>Load additional configuration from filenone
--base-url=<url>Base URL for all requestshttps://localhost:8080
--test-dir=<dir>Directory containing test suites./test
--file-pattern=<regex>Pattern used to locate suite files\.spectest\.
--start-cmd=<cmd>Command used to start the servernpm run start
`–running-server=<reusefailkill>`
--tags=<list>Comma separated tags for filteringnone
--rps=<number>Requests per second limitInfinity
--timeout=<ms>Default per‑test timeout30000
--snapshot=<file>Write snapshot JSON to filenone
--randomizeShuffle execution orderfalse
--happyRun only tests expecting a 2xx statusfalse
--filter=<pattern>Regex or built‑in filter (happy, failures)none
--verbosePrint detailed logsfalse
--user-agent=<name>Override the User‑Agent headerchrome_windows
--ua=<name>Alias of --user-agent

Provide a file path without a flag to run just that suite.

See Test Suite and Test Case for details on the file format.

Examples

# Run every suite discovered in testDir
npx spectest

# Only run a specific file
npx spectest auth.spectest.js

# Run with mobile user agent and record snapshots
npx spectest --user-agent=chrome_android --snapshot=snap.json