Skip to content

Write your first test

This page takes you from signing in to a workflow that has run once. It takes about ten minutes. You need the Member or Admin role; a Viewer can read what others made but cannot create anything.

The examples use a bike shop. Use your own application’s pages and names in their place.

When you sign in and are in no organization, or your organization has no project yet, Belay asks one question: What’s the address of the app you want to test?

  1. Type the address under Address. myapp.com is enough: with no http:// or https://, Belay adds https://.
  2. Choose Make the project.

Belay opens the address to check that it answers. When you typed no http:// or https:// and the https:// address has no answer, Belay tries http:// once, and the environment keeps the one that answered. Then Belay makes:

  • a project, named from the site’s title, or from the address when the title says nothing about the site;
  • one environment in it, named Default, at that address;
  • the project’s icon, when the site has one.

If you are in no organization, Belay makes one for you with the project, and you are its Admin. It is named after you (“Robin Lee’s organization”), and you can rename it on the organization’s General page. To join a team that already uses Belay instead, ask one of its Admins to invite the email you signed in with; the invitation shows on the sign-in page when you reload it, and is answered there before anything else.

Don’t have one yet? Use our practice site fills the field with the address of Switchback Cycles, a demo bike shop.

The address stays in the field, and the reason is under it:

You see What to do
That isn’t an address Belay can open. Type one like myapp.com or https://staging.myapp.com.
Belay’s browsers run on Belay’s servers, so they can’t open an address on a private network or on your own computer. Use an address that is reachable from the internet, or the practice site.
Belay couldn’t reach that address. Check the address and try again. If you know it works, choose Use it anyway: Belay could not open the page this once, which does not mean a run will fail.
This organization holds as many projects as its plan allows, so no project was made. See what the plan allows opens the organization’s plan.
Too many tries just now. Wait a minute and try again. Belay takes only a few tries a minute from one person, and nothing was made. Wait a minute, then try again.

Belay opens the new project’s dashboard. It shows the project’s icon and name, and the address as a link. Click the name to rename it.

Under First test are two ways in:

  • Write it here: write the steps yourself in the editor, the way this page goes on.
  • Write it with my agent: connect your coding agent and give it a first prompt. See Write a test with an agent.

Both make the same kind of workflow, and you can switch at any time. The dashboard shows these two choices until the project has a workflow or a run.

Write it here opens the editor on a draft named “First test”, and a live page beside the steps: a real browser on your application, on the Default environment, at its address. It takes a few seconds. Click the name to give it one that says what the workflow proves, such as “A helmet can be added to the cart”. The name is what people read in lists.

Type the first step where the editor says Describe the first step… and press Enter. Belay reads the step and saves it. The draft becomes a workflow once it has a name and a step that Belay understands; until then it is yours alone, and Drafts on Workflows keeps it if you leave.

A short pause after you stop typing, Belay shows how it understood the step under the sentence: what kind of step it is and what it will act on or compare. Check this each time. If the reading says less than your sentence does, rewrite the sentence.

A step that Belay cannot use says what it needs, such as Does more than one thing, with a suggested rewrite you can apply. A workflow cannot run until every step is understood. See Steps that need a change.

The live page holds your application open before step 1. Select a step:

  • The page side shows what the step would act on, outlined on the page, and how sure Belay is of that choice.
  • Press Enter, or choose Perform, to perform the step. When it passes, the editor moves to the next one.
  • For a check, the preview says whether it would pass on the page as it is now.

If no live page opened, the page side says why, with Try again. See A new workflow.

Write each next step against the page you can see:

Go to the shop page.
Click the Add to cart button on the "Trail Helmet" card.
Check that the cart shows "Trail Helmet".

“The shop page” in the first of these is a route: a named page of your application. Add it under Routes in the sidebar (name shop, path /shop), or write the path in the step itself: Go to /shop. Without one or the other, the step needs a change. See Routes.

You don’t need to save by hand. The workflow saves when you finish a step and move on.

When you are done, choose End the live page. Nothing from the live page is kept; a run is the record. See The live page.

At the top of the editor, choose Run on Default (the button names the environment).

Each step in the list fills in as it finishes, and the editor shows what each one did. When the run ends you see its outcome, and for a step that did not pass, what it expected and what it found. The line under Steps links to the run’s own page. See Reading a run.