Hunt Getting started Docs GitLab Hub

Test the product you actually deployed

Write what a user does as plain Scenarios, run them against your staging or production site, and see every screen they reach in one map. When the product allows it, Hunt also stubs the payment provider and jumps the clock past a trial, so the cases that are hard to reach become Scenarios too.

Hunt 0.1.0 is published as a Linux binary and as the npm SDK @slopkit/hunt. It is early, and runs on your machine and in your CI. Source in the product repo. Part of SlopKit.

features/cart.featureGherkin
Feature: Cart

  @smoke
  Scenario: Adding two items
    Given an empty cart
    When I add 2 items at 5 euros each
    Then the cart total is 10 euros
$ hunt run --tags @smokeexit 0
✓ Cart › Adding two items  (6 ms)
    ✓ Given an empty cart
    ✓ When I add 2 items at 5 euros each
    ✓ Then the cart total is 10 euros

1 scenarios: 1 passed, 0 failed, 0 undefined, 0 ambiguous
Output of the Scenario on Getting started, run with hunt 0.1.0.

What a team gets

Why Hunt instead of a hosted browser-testing service

You can test cases a hosted browser can only watch from outside
In a Controlled Environment a Scenario can register a Stub for the payment provider and shift the clock. The Stub and the shift end with the Scenario. In an Observed Environment you still get the browser, HTTP and read-only data checks.
The Baseline is files, not a vendor account
Snapshots live in your repository in the Jest __snapshots__ format. Hunt writes a new Snapshot the first time it sees one. After that a mismatch fails the run until someone accepts the update, and the update is reviewed in a merge request.
An agent can try a Step before you commit it
hunt explore runs inline Steps against your real Step definitions and records nothing. When the Steps work, an Exploration can be promoted into a Scenario.

Why Hunt instead of assembling your own runner

Clock Shifts, Stubs and code mapping come from sibling SlopKit products that Hunt drives from the same Step context, so you do not glue them together yourself. Hunt does not reimplement them.

A Scenario run, end to end

  1. You tag a Scenario @controlled and write Steps that sign up, shift the clock past a trial, and upgrade with a declined card and then an accepted one.
  2. Hunt runs it through your Step Host. Every Step sends trace context with the run, Scenario and Step ids.
  3. Steps declare Screens. Hunt takes the screenshot Snapshots and compares them with the Baseline.
  4. When the Scenario ends, Hunt removes its Stubs and resets the clock.

Words used here

Scenario
A named, saved example of one behavior, written as Given, When and Then lines.
Step
One reusable Given, When or Then line, backed by a browser or HTTP action or an assertion.
Step Host
The process, in the JavaScript runtime you choose, where your Step definitions run.
Environment
A deployed instance of the product under test, such as staging or production. You provision it. Hunt does not.
Observed Environment
One Hunt can only reach from the outside, through a browser and HTTP.
Controlled Environment
One that cooperates, so Scenarios can also use Stubs and Clock Shifts.
Stub
A stand-in for a third-party service such as payments, email, SMS or OAuth. A Scenario registers it for that Scenario only.
Clock Shift
A forward jump or freeze of the time seen by the whole Controlled Environment. It holds the Environment until it is reset, so a Scenario that uses it is tagged @controlled and runs alone.
Screen
A named place in the product that a Step says it has reached. Screens are the nodes of the Experience Map.
Snapshot
A recorded value that later runs must match: a Screen's screenshot, or data a Step asked to capture.
Baseline
All of a product's Snapshots as committed on its main branch. A change to it is accepted by approving and merging the merge request that changes it.
Experience Map
A browsable atlas of the product's user-facing journeys, compared against the Baseline.
Exploration
An unsaved run of inline Steps, put together by an agent or a person during a working session. It never changes the Baseline and can be promoted into a Scenario.
Mapping Run
A dedicated run that records which code each Step touched, so a code change can be traced to the Scenarios and Screens it affects.

Limits today

Run your first Scenario

Getting started builds hunt from the 0.1.0 tag, writes a Scenario and runs it. The docs cover the commands, hunt.toml, the Step API and the glossary. The repo README also lists the release binary and the npm SDK.