Set up environments and origins

Choose the addresses a test runs against, the addresses it may record on and a stored sign-in state.

In short

Site settings holds where a test runs (environments), where it may record (addresses it may record on), how it signs in, and who can open the site. In {{brand}} in the cloud a test runs in your own browser or with the CLI (see /help/ui-tester/running-and-schedules); where {{brand}} replays tests itself, an environment must be an address its server can reach.

Before you start

Add an environment

  1. Open the site's settings and press "New environment".
  2. Type the "Base URL", a Name and choose a Tier (Local to Production, or Custom).
  3. Save. Its address is added to the addresses it may record on at once. "Make default" on a row picks the one Run uses.
  4. When your organization's git connection or a pipeline reports deploys, "From your deploys" lists them under the table: "Add as environment" fills the form for you, and "Use this address" moves an environment of the same name to where it now answers. Nothing changes until you save.

Sign in before runs

  1. Record a test that signs in to the site.
  2. On the environment's row, choose "Sign in before runs".
  3. Under "Sign in with", choose that test, and type the password it needs.
  4. Press "Save sign-in". The row says Signs in with and the test's name.

The sign-in test runs before every run here; its session is used for that run only, then thrown away. The password is stored encrypted for this environment and never shown again. "Remove sign-in" makes runs start signed out again.

Test each pull request's preview

  1. On the environment's row, open its … menu and choose "Preview address".
  2. Under "Preview address", type where your pull-request previews answer, with {number} once in the path or query - for example https://preview.example.com/pr-{number}. The host stays the same for every pull request.
  3. Press "Save". The message says "Preview address saved."

When a card is given to a coding agent, {{brand}} replays the card's locked tests on each pull request's own preview, with {number} replaced by the pull request's number (see /help/boards/coding-agent-on-a-card). A preview run never colours a test and never counts toward flaky tests. To stop, clear the field and save.

Only where {{brand}} replays tests itself {{brand}} in the cloud does not drive a browser itself, so there a UI test on a preview is reported as not run. API tests on a preview still run.

Addresses it may record on

The addresses it may record on are where the recorder captures, and the only places a run may go besides the environment's own address. Add one by pasting an address; it is reduced to its origin. A site keeps between 1 and 25.

Who can open a site

Site settings shows "Who can open this site", with Share, the team it is filed under and the production switch, to the people who manage it.

Good to know

If something goes wrong

Related