Writing a good test plan

A test plan has five parts:

  1. Title — short and descriptive, e.g. "Checkout with Stripe test card".
  2. Target URL — the staging or production URL to test against.
  3. Body — the plain-English flow.
  4. Login instructions — exactly how to authenticate.
  5. Acceptance criteria — what success looks like.

Example: a good plan

Title: Add to cart and checkout
Target URL: https://staging.example.com
Body: Open the home page, click "Shop now", choose the first product, click "Add to cart", open the cart, click "Checkout", fill the shipping form with the test address, choose the Stripe test card 4242 4242 4242 4242, click "Pay", and wait for the confirmation page.
Login instructions: Click "Sign in" in the header. Use email qa+test@example.com and password ${TEST_PASSWORD}.
Acceptance criteria: A confirmation page is shown with the text "Order confirmed" and an order number starting with ORD-.

Anti-patterns

  • Vague verbs. "Use the app like a normal user" gives the agent nothing to anchor on.
  • Implicit steps. "Sign in normally" — say which sign-in form.
  • Asserting on volatile data. "The cart shows 3 items" only works if seed data is deterministic.