Skip to main content
Skip to Content

A suite is a named list of tests that run together, in order, against one target. Use suites for journeys that build on each other, for a smoke set you run on every deploy, or to run the same tests against another environment.

An example

suite-id: s_dice-ego-veer-warp-ionic-trying-tur-cal-stride-battle
name: Komazon examples
target: komazon
tests:
  - test: tests/examples/komazon-checkout.yaml
    id: t_packer-staff-asha-lak-spill-usher-pele-allen-bid-done
  - test: tests/examples/komazon-cart-total-bug.yaml
    id: t_reduce-eva-elding-reset-lai-iban-rum-hin-parent-chang

Each entry names a test file, relative to the config file, and that test's test-id. Suites live wherever workspace.suiteMatch points, suites/**/*.suite.yaml by default. The suite file reference lists every field.

How a suite runs

  • Tests run one after another, on one browser or device.
  • The suite's target replaces each test's own target. Two suites can run the same tests against staging and against a preview build.
  • When a test fails or times out, the rest of the suite is skipped. Other suites in the same run carry on.
  • setup hooks run once before the first test and teardown hooks once after the last. Variables a setup hook writes are available to every test in the suite.
  • The suite's use and context apply to every test in it. A test's own use still wins over the suite's, except for where the suite runs: the suite's use.browser.remote and use.device apply to every test, and without them the tests must name the same remote and device, or the run is refused.

Run suites

npx agent-qa run suites/smoke.suite.yaml
npx agent-qa run --suite
npx agent-qa run --all

The first runs one suite. --suite runs every suite that workspace.suiteMatch finds, and --all runs every suite and then every test. A suite and plain test files cannot be mixed in one command.

Keeping IDs in step

The id next to each test must match that file's test-id. If they differ, the run stops with an ID mismatch error naming both. agent-qa validate does not catch this, so update the suite whenever you replace a test.

Signing in once

To sign in at the start of the suite and keep the session for later runs, use a saved login with capture: true in the suite's use. agent-qa saves the session after every test in the suite passes. See Saved logins.