Skip to main content
Version: Next

Command-Line-Interface (CLI)

The happo command provides all the functionality you need for running Happo tests, including CI integration. The following documentation covers all available commands and options to help you configure Happo for your specific needs.

Installation

The commands listed come from the happo npm library.

npm install --save-dev happo

You'll also need to add a script to package.json:

{
"scripts": {
"happo": "happo"
}
}

Commands

Default command

Run happo tests to generate screenshots and upload them to the remote happo.io service.

npm run happo

Wrapping command

Use happo as a wrapping command when using Cypress or Playwright. This allows Happo to coordinate test execution and collect results from parallel test runs.

npm run happo -- playwright test

Use the same --nonce when using with the finalize command:

npm run happo --nonce [NONCE] -- playwright test

Finalize command

Finalize a Happo report for Cypress or Playwright tests running in parallel. This command is used after parallel test execution completes to aggregate results and finalize the report. It's used in combination with the --nonce argument.

npm run happo finalize
npm run happo finalize --nonce [NONCE]

Options

--config

Specify a custom path to the Happo configuration file. By default, Happo looks for configuration files in the following order:

  • happo.config.ts
  • happo.config.js
  • happo.config.mjs
  • happo.config.cjs
npm run happo --config path/to/happo.config.ts

--version

Display the version number of the Happo CLI.

npm run happo --version

--help

Display help text with available commands and options.

npm run happo --help