Source: https://everyrole.dev/blog/expected-results-in-test-cases

# A test without an expected result isn’t a test

The expected result is the half of a test case people leave vague. How to write one that can fail, what to leave out of it, and who gets to say what is right.

Nov 22, 2026  5 min read  by the EveryRole team

A test case, unlike the [test scenario](https://everyrole.dev/blog/test-scenario-vs-test-case) it belongs to, has two halves: what you do, and what must come out. Teams write the first half in detail and the second half as “it works”. A test whose expected result is “it works” can’t fail. It can only be run. (The first half is in [how to write test cases](https://everyrole.dev/blog/how-to-write-test-cases).)

The fix is small and a little tedious. Write the expected result as something on the screen that two people would agree on.

## Three levels of expected result

![Three expected results for an editor creating an item. A wish: it works. A sign: a success message appears. A result: the item's page opens with its heading and note, and the list has one more row.](https://everyrole.dev/s/blog/expected-results-in-test-cases/vague-to-exact.webp)

Same test, same steps. Only the last one can catch a save that silently fails.

**A wish.** “The item is created successfully.” There is nothing to look at. Whoever runs it will look at the screen, see no explosion, and tick the box.

**A sign.** “A success message appears.” Better: it is on the screen, yes or no. But a message is evidence that some code decided to print a message. We have all seen “Saved!” on a form whose save failed.

**A result.** “The item’s page opens. Its heading is `Sample item`, the note `A short sample note` is under it, and the list has one more row.” Now a broken save can’t pass, a save with the wrong name can’t pass, and a double save can’t pass.

The difference between level two and level three is where you look. A sign is on the form. A result is in the place the thing lives after the form is gone.

## How to write an expected result for a test case

Take the action, then answer three questions about what the app should show.

**Where does the person end up?** A page, by what it is: “the item’s page”, “back on the list”, “still on the form”. The exact address often has an id in it that changes every time, so describe the page, don’t quote the address.

**What on that page proves it?** The values that were typed, shown back. A count that went up by one. A row that is gone. Pick the thing a broken version of the feature would get wrong.

**What must not have happened?** For a refused input this is the main point: “no item was created”. For an action with side effects: “no email was sent”, “the card was not charged”. These need a second look somewhere else (the list, the inbox), and they are the checks that get skipped.

A worked example, for the empty case of the same form:

>

Where: still on the new item form. What proves it: the name field says “Please fill out this field.” What must not happen: the list still says “No items yet”.

Three short sentences. It took longer to read this section than to write that.

## What to leave out

An expected result that is too exact fails for no reason, and a test that fails for no reason gets ignored soon after. Leave out:

- **Things that change every run.** Ids, dates, “created 3 seconds ago”, the order of two things made in the same second.
- **Things that are not the point.** The colour of the button, the wording of the footer. If the test is about creating an item, a changed footer should not turn it red.
- **Exact pixels.** Unless the test is about layout.

The skill is choosing the two or three facts a broken feature would get wrong, and holding only those.

## Who says what is right

Here is the uncomfortable part. Somebody has to decide that the item’s page showing the name once, with the note under it, is correct. That is a product decision. It can’t be derived from the code (the code does what it does, bugs included), and it can’t be guessed by a tool.

In practice the decision gets made in one of three ways:

1. **Nobody makes it.** The test records whatever the app did the first time and calls that correct forever. If the app was wrong on day one, the test now protects the bug.
2. **The author imagines it.** The expected result is written before running anything, from what the feature is supposed to do. Good in principle. In practice it drifts from what the page really shows, and people “fix the test” to match.
3. **A person looks at a real result and says yes.** Run the case once. Look at what came out, next to what went in. If that is what a user should get, it becomes the expected result.

We think the third is the honest one, and it is how EveryRole works.

![EveryRole asking "Is this first result right?" for the good input case. Under Typed: Sample item, A short sample note. Beside it, what the page answered: Sample item. A dashed box marks the item's address as changing each time, so not compared. Below are the answers No, it's wrong, Not sure yet and Yes, it's right.](https://everyrole.dev/s/blog/expected-results-in-test-cases/is-this-result-right.webp)

The first result of a case, waiting for a person. What was typed is beside what the page answered. The item’s address changes each time, so it is left out of the comparison.

Three things on that screen matter for writing good expected results by hand too.

What was typed sits **beside** what the page answered (the actual result next to what you expected), so you compare instead of remembering. The address with the item’s id is marked as changing each time, and left out. And there is a “Not sure yet” button, because sometimes the honest answer is that you need to ask someone.

A yes keeps that result as the answer. Each later run is compared with it by code. A no marks the case as a wrong result until the app gives one you do approve.

## When the app changes

Expected results go stale. The page gets a redesign, the message is reworded, a field is added. The test now disagrees with the app, and the app is right.

The test is doing its second job here, which is to notice change. What matters is what happens next: a person looks at the new result and either approves it or says “no, that’s a bug”. What must never happen is the expected result updating itself to match. We wrote more about that in [hollow passes](https://everyrole.dev/blog/hollow-passes).

## Try it on one test

Open your most important test and read only its last line. If it says “it works”, “is successful” or “no errors”, rewrite it with the three questions: where the person ends up, what proves it, what must not have happened.

Then run it once and watch. If you can’t tell from the screen whether your new expected result was met, it still isn’t exact enough.

## Try it on your own app

EveryRole tests your app’s real user journeys for each kind of user, from the live site, and runs them after every deploy. Paste your app’s address to see what it finds.

[Start with your app](https://everyrole.dev/signup) [How it works](https://everyrole.dev/docs#start)

## Keep reading

Test cases

### [How to write test cases that catch real bugs](https://everyrole.dev/blog/how-to-write-test-cases)

A test case is one input and one expected result at one stop. How to write test cases for a real form, and the three most teams leave out.

Nov 22, 2026  6 min read

Test cases

### [Boundary value testing, without the theory](https://everyrole.dev/blog/boundary-value-testing)

Boundary value analysis on a real form: a field of 1 to 60 characters needs four test values, all at the edges. What to type, and what we found in our own app.

Nov 22, 2026  6 min read

Test cases

### [Empty form submission: the cheapest test you skip](https://everyrole.dev/blog/empty-form-test)

Test empty form submission: press the button with nothing typed. It finds blank records, crash pages and dead ends. What a good answer looks like.

Nov 22, 2026  5 min read
