Skip to content

Writing Effective Tests

Best practices for writing natural-language tests that autonomous agents execute reliably.

Certyn's agents execute what you write. The goal is to be clear about intent and expected outcomes, without being brittle about UI implementation details.

Principles

  1. Test one workflow per test.
  2. Specify what "success" looks like.
  3. Prefer stable identifiers (labels, page titles) over layout instructions ("top left").
  4. Use stable test data and dedicated test accounts.

A strong example

Go to the login page.
Sign in using LOGIN_USERNAME and LOGIN_PASSWORD from the environment variables.
Verify the dashboard loads and shows the user menu.
Open Settings and verify the API Keys section is visible.

Make expectations explicit

Avoid "Verify it works". Instead:

  • "Verify an error banner appears and contains 'Invalid password'."
  • "Verify the URL changes to /app/.../overview."
  • "Verify at least one row is visible in the table."

Handling dynamic content

If the UI shows variable data, verify structure rather than exact values:

  • "Verify at least 3 product cards are displayed."
  • "Verify an order confirmation page is shown and contains an order number."

Using environment variables

Store credentials and test data in environment variables (via Manage Environments). In your test instructions, reference them by name and tell the agent how to apply them.

Keep secrets out of test text

Put secrets in environment variables, not in test steps.