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
- Who: changing where an environment points, its tier, its sign-in and its secrets needs Manage on the site. Edit can change tests and record.
- Plan: UI Tester is part of every plan. Every run uses browser minutes from your plan's monthly allowance (Plan & usage shows how many are left).
- First: environments must be addresses the {{brand}} server can reach.
Add an environment
- Open the site's settings and press "New environment".
- Type the "Base URL", a Name and choose a Tier (Local to Production, or Custom).
- Save. Its address is added to the addresses it may record on at once. "Make default" on a row picks the one Run uses.
- 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
- Record a test that signs in to the site.
- On the environment's row, choose "Sign in before runs".
- Under "Sign in with", choose that test, and type the password it needs.
- 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
- On the environment's row, open its … menu and choose "Preview address".
- 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.
- 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
- General holds the name, the description, the viewport (1280 by 800 pixels by default, 320 to 4096) and Enabled: a disabled site cannot record or run.
- "Delete site" in the Danger zone removes its tests, runs and schedules; the web application itself is untouched.
- Run on an environment marked Production asks first, because the replay drives a real browser through that site. Staging and Preprod are marked in amber.
- By default runs refuse loopback and private addresses. A site that runs only on your machine needs an address the server can open.
- Runs against Production by people who may run it is off for a new site: only people who may change the site run its tests there. At the Run level only tests marked Ready run.
- A schedule runs as the person who made it, or who took it over last. "Take over" makes it run as you.
If something goes wrong
- "Only people who manage this site can change where an environment points, its tier, its sign-in and its secrets, or add or delete an environment."
- "The base URL must be an absolute http(s) URL."
- "The sign-in secrets of … can no longer be read - enter them again.": type the password again and save.
- A run says "Could not sign in, so the test did not run": press "Check the sign-in" and fix the sign-in test or its password.
- You deleted an environment by mistake: press "Undo" in the message that follows, within ten minutes. It comes back without its sign-in, because the delete removed its secrets for good; set the sign-in again from the row's menu.
Related
- /help/ui-tester/start-here
- /help/ui-tester/recording-a-track
- /help/ui-tester/running-and-schedules