Skip to main content

How to write effective test steps in Thunders

Written by Ines

Introduction

This guide covers best practices for writing test steps that Thunders can execute reliably.
​
Well-written steps describe what a real user sees and does on screen: clear actions, exact UI labels, and verifiable expected results. Following these practices gives you tests you can trust: when a step fails, it's because something changed in your app, not because the step was unclear.

1️⃣ Always write as a real user

❌ Trigger the onSubmit function
❌ Validate the form

These describe what the code does, not what a user does on screen. AI needs visible, human actions to execute a step.

Use:

✓ Click the 'Log in' button

2️⃣ Each step should describe one single action

❌ Click the 'Log in' button, enter "[email protected]" in the 'Email' field, and verify the error message is displayed

This combines two actions and a verification in one step. If any part fails, it's impossible to know which one caused it, and AI may only execute part of it.

Use:

✓ Click the 'Log in' button
​✓ Enter "[email protected]" in the 'Email' field
​✓ Verify the error message is displayed

3️⃣ One sentence = one observable action

❌ Authenticate myself
❌ Complete the form

These describe intentions, not visible actions. If you can't physically see or do it on screen, it's too abstract for AI to act on.

Use:

✓ Enter "[email protected]" in the 'Email' field

4️⃣ Always name elements as they appear on the screen

❌ Click the main button
❌ Click the icon
❌ Fill in Field 1

Generic references give AI nothing to anchor to, so it has to guess. Use the label visible in the UI. When there's no text label, describe the color, icon, or position.

Use:

✓ Click the 'Log in' button
​✓ Click the pencil icon next to the user's name
​✓ Click the blue 'Save' button in the top right corner

5️⃣ Use consistent vocabulary

Choose one verb per type of action and keep it across your Test Cases.

💡 Consistency = better tests generated.

Action

Recommended verb

Navigation

Navigate to / Go to

Click

Click / Click on

Text entry

Enter / Type

Keyboard key

Press

Verification

Verify / Verify that

6️⃣ Describe the intention, not the implementation

❌ Enter an invalid value on the backend

This references system internals a user cannot see or interact with. Steps must stay within the user's perspective: what they type, click, or observe.

Use:

✓ Enter an incorrect password in the 'Password' field

7️⃣ Include important intermediate states

❌ Create an account for the new user

This skips every observable step: navigating to the registration page, filling each field, submitting the form, and verifying the confirmation message. AI cannot automate what it cannot see.

Use:

✓ Navigate to the registration page

✓ Enter "John" in the 'First Name' field

✓ Enter "[email protected]" in the 'Email' field

✓ Click the 'Create Account' button

✓ Verify the confirmation message is displayed

8️⃣ Anticipate negative cases when writing

❌ Only writing the happy path: Enter valid credentials and click 'Log in'

Testing only what should work leaves large gaps in coverage. AI handles negative cases as well as positive ones, but only if you write them.

Use:

✓ Click the 'Log in' button without filling in any fields
​✓ Enter an invalid email address in the 'Email' field
​✓ Click the 'Submit' button twice in quick succession

9️⃣ If AI cannot verify it, rephrase it

❌ Understand that the error is clear
❌ The page looks correct

These require human judgment, so there is nothing concrete to check. A step is testable only if it describes something visible, measurable, or present on screen.

Use:

✓ Verify the error message "Invalid credentials" is displayed below the 'Email' field
​✓ Verify the user's name is visible in the top right corner

Complete example: putting it all together

This example applies all nine rules in a single Test Case. Use it as a reference when writing your own.

✓ 1. Navigate to the login page

✓ 2. Enter "[email protected]" in the 'Email' field

✓ 3. Enter "password123" in the 'Password' field

✓ 4. Click the 'Log in' button

✓ 5. Verify the 'Dashboard' page is displayed

✓ 6. Verify the name "John Doe" is visible in the top right corner

Why this works:

  • Each step is an observable action performed by a real user.

  • Each type of action always uses the same verb.

  • Each verification comes directly after the action that triggers it.

Before / After: common mistakes

Too vague

❌

1. Scroll the page
2. Submit
3. See an error

“The page” and “an error” give AI no reliable element to target. Steps 1 and 2 are actions, but step 3 is an expected result that isn't written as a verification.

✓

1. Navigate to the login page
2. Enter "[email protected]" in the 'Email' field
3. Enter "wrongPassword" in the 'Password' field
4. Click the 'Log in' button
5. Verify the error message "Invalid credentials" is displayed
6. Verify the login page is still displayed

Mixing actions, verifications and technical references

❌

1. Click the primary button to submit the form
2. The backend returns an error
3. The message is correctly displayed

“Primary button” is not a visible label. “The backend returns an error” is an implementation detail, not something a user observes. “Correctly displayed” can't be verified as written.

✓

1. Click the 'Log in' button
2. Verify the error message "Invalid credentials" is displayed
3. Verify the home page is not displayed

Too abstract

❌

1. Authenticate with invalid credentials

This describes an intention in a single step and skips every observable action in between. AI cannot infer which fields exist, what to enter, or what to verify.

✓

1. Enter an invalid email address in the 'Email' field
2. Enter an incorrect password in the 'Password' field
3. Click the 'Log in' button
4. Verify an error message is displayed

Golden rule to remember

If you can't hand a step to a new colleague and have them run it manually from its description alone, AI might struggle too.

Related articles on this topic that you might find helpful

Did this answer your question?