Step 1: Get an API key:

You will need an API key to authenticate against Momentic’s servers.

Step 2: Install browsers:

This will download the latest version of Chrome, Firefox, and WebKit browsers to your local machine.

Step 3: Run tests:

Make sure this is in the same directory as your ./momentic directory.

Arguments

ArgumentDescriptionDefault
testsOne or more test identifiers.

To use tests stored on your local file system, pass ‘—local’ and specify file paths to Momentic YAML files or folders that exist locally: ‘npx momentic run —local momentic/hello-world.yaml’.

To use tests stored remotely on Momentic Cloud, pass ‘—remote’ and specify one or more test paths. A test path is a lowercased version of your test name where spaces are replaced with dashes: ‘npx momentic run —remote hello-world’.

Options

OptionDescriptionDefault
-r, --remoteRun tests remotely. The production version of this test will be queued for execution.true
-l, --localRun tests locally. Useful for accessing apps on localhost. This option does not control where tests are read from (see <tests> argument documentation).
--no-reportSkip reporting test results to Momentic Cloud when running with the --local flag.
--start <start>Arbitrary setup command that will run before Momentic steps begin.
--wait-on <waitOn>URL to wait to become accessible before Momentic tests begin.
--wait-on-timeout <waitOnTimeout>Max time to wait for the --wait-on URL to become accessible.One minute
--retries <retries>Number of retries to attempt when running tests locally. Defaults to each test’s own retry configuration.
-p, --parallel <parallel>When running with the --local flag, the number of tests to run in parallel. Defaults to 1.1
--env <env>Name of the environment to use when running tests.
--url-override <urlOverride>Fully qualified URL (e.g., https://www.google.com) to start all tests from. Overrides any default starting URL set from the test or environment.
--custom-headers HEADER-1=value HEADER-2=valueAdd or override HTTP headers to be sent on every network request that occurs during the test. If this option is provided, you must use -- to separate the options from the test names provided (e.g. npx momentic@latest run --custom-headers TEST=true -- my-test).