Docs

Flows

A flow is one thing a customer does on your site, start to finish: buy a product, sign up, invite a teammate. Write it the way you would tell a new colleague, and the agent walks it on desktop and on a phone, then says whether a customer gets to the end.

The parts of a flow

  • Name and start page. Two to five words, and the path where the flow begins, like /products/oak-table.
  • What the agent should do and check. One or two sentences: what the flow is for, and what the customer should see when it worked.
  • Steps. One per line, in order, naming the buttons, links and fields as they read on the page. The agent follows them instead of finding its own way. Leave them out and it looks for the way itself, which is fine for simple flows.
  • What must be true at the end. One per line. Each one gets its own verdict in the report: passed, failed, or needs review when the agent could not tell. Write things a browser can check: a text, a page, a number. Not "the page looks good".
  • What the agent needs. One per line: a coupon code that works, a product in stock, a second account to invite. The test account and the test card are already given, so leave those out.
Name:       Checkout with a coupon
Start page: /products/oak-table

Steps
1. Pick the size "Large" and press Add to cart
2. Open the cart and enter the coupon code
3. Press Checkout, fill in the shipping address with test data
4. Pay with the test card WitnessQA gives you
5. Wait for the order confirmation

What must be true at the end
- The cart shows the discount from the coupon
- The confirmation page shows an order number
- The total on the confirmation equals the cart total

What the agent needs
- A coupon code that works

Test data

Each environment keeps a value for every need the flows list, under Test data on the environment card. Give the coupon code once and every flow that asks for "a coupon code that works" gets it. The agent sees the values with the flow and uses them where the flow says. They are plain text, not secrets: the test account's password belongs under Login options, and payment cards are picked for you from Test cards.

A flow whose need has no value yet is blocked before it starts: the report says what to add, no steps are spent, and the site is not marked as broken. The environment card says which values are still missing before you run anything.

How a flow ends

  • Passed. The agent got to the end and everything that must be true was.
  • Failed. The agent got to the end but something that must be true was not, or it saw the flow break. This is an issue on the board: "A customer cannot finish Checkout", with the step and screenshot that show it.
  • Blocked. The agent needed something it was not given: a value under Test data, an account, a product in stock. Not an issue; give it what it needs and run again.
  • Stuck. The agent could not get to the end for another reason, or ran out of steps. It goes to a person to look at, with the agent's own words on what happened.
  • Needs review. The agent finished but could not tell whether something that must be true was.

Desktop and phone each get their own result, because menus, layouts and tap targets differ. The report's Flows tab shows both.

Let discovery write the first draft

  1. Discover flows

    On the project page, under Flows, click Discover flows. The agent maps the app without changing anything and proposes the flows a user takes, each with steps, what must be true and what it needs.

  2. Read them like test cases

    Approve the ones that matter and edit the rest. Fix a button name the crawl got wrong, add the check you care about, cut a step nobody takes. The most important flows go first: audits walk them in order.

  3. Fill in the test data

    The environment card lists what the approved flows need. Add the values, and the first audit runs every flow to the end.

Writing flows that catch issues

  • One flow per thing a customer wants to get done. "Browse the shop" finds little; "Buy the oak table with a coupon" finds the broken discount.
  • End every flow on a result the customer would notice: an order number, a confirmation email, a row in a list.
  • Put the exact words of the page in the steps. "Press Add to cart" is better than "add the product".
  • Say what must be true, not what must happen. "The total is $240" is a check; "the price updates" is not.
  • Flows behind login need a test account on the environment. Flows that pay use the test card for the provider the page shows, and never a live one.