Source: https://everyrole.dev/blog/crud-test-cases

# CRUD test cases: create, edit, delete, then reload

CRUD testing in the browser, in nine cases. After each create, edit and delete, look where the thing lives and reload. A success message is not the outcome.

Nov 22, 2026  6 min read  by the EveryRole team

CRUD testing in a browser comes down to one habit: after every create, edit and delete, go and look at the place where the thing lives, and reload the page. A “Saved!” message is something the page prints. The outcome is the item in the list, with the right name, still there after a reload, and gone after a delete. Nine cases cover it for one kind of thing.

The CRUD test case lists we read were about APIs: send a POST, expect a 201. This one is about what a person sees.

The whole life of one item on our practice app. Every step is checked in the list, after a reload.

## The nine test cases for CRUD operations

For one kind of thing (here, an item with a name and a note):

| # | Case | What to do | What must come out |
| --- | --- | --- | --- |
| 1 | The list with none | Open the list before creating anything | The app’s empty state, in words. Ours says “No items yet” |
| 2 | Create | Name `Sample item`, a note, press “Create” | The item’s own page, with that name and that note |
| 3 | Seen in its list | Open the list | One row, `Sample item`. The count says “1 item” |
| 4 | Kept after reload | Reload the list | The same row |
| 5 | Edit | Change the name to `Sample item, edited`, save | The item’s page shows the new name. The note is unchanged |
| 6 | Edit, kept after reload | Open the list, reload | The new name, one row. Not two |
| 7 | The list with two | Create a second item | Two rows, in the order you expect, the count “2 items” |
| 8 | Delete | Delete the first item | The list without it. The other item is untouched |
| 9 | Gone after reload | Reload, then open the deleted item’s old address | Still gone. The address answers the app’s not-found page |

Each “what must come out” is something on a page that two people would agree on, which is the rule for any [expected result](https://everyrole.dev/blog/how-to-write-test-cases).

## CRUD testing needs a reload

A page after a save shows you what the browser believes. Some apps update the screen first and talk to the server after, so the new row is on screen before anything was stored. If the request then fails, the row is still there, looking saved.

A reload asks the server. It is the cheapest honest check there is, and it is the difference between testing the message and testing the thing. A test that stops at “the success message appeared” passes on an app that saves nothing. We call that [a hollow pass](https://everyrole.dev/blog/hollow-passes).

Here is case 6 on our practice app.

![The practice app's list after the edit and a reload: one row, "Sample item, edited", with its Delete button, and the count "1 item".](https://everyrole.dev/s/blog/crud-test-cases/list-after-edit.webp)

After the edit and a reload: the new name, and one row. An edit that had made a copy would show two.

One row matters as much as the new name. An edit that quietly creates a copy passes “the new name is in the list”.

## Read is a case, not a pause

The R gets skipped because it feels like nothing happens. Three of the nine are reads: the list with none, with one, with two.

- **None.** The empty state is the first thing every new user sees. A blank area there reads as “broken”.
- **One.** Singular and plural. Our practice app says “1 item”, which someone had to write code for.
- **Two.** Order, and whether the second create replaced the first. A list that only ever shows the latest item passes every test that creates one.

## Update is the least defended

Create gets the attention. In our own practice app we found the proof of that while writing this post.

The new item form refuses an empty name twice: the browser stops it, and the server answers “A name of 1 to 60 characters, please” if the request gets past the browser. The edit form has the same browser guard. Its server side has none. We sent an edit with an empty name past the browser, and the app saved it: an item with no name, shown in the list as a link with no words to click. A name of 61 characters went through the same way.

So for every rule the create form enforces, run the same wrong value on the edit form: [empty](https://everyrole.dev/blog/empty-form-test), too long, wrong format. They are separate code paths, written at different times, and nothing makes them agree.

Also on edit:

- **Change one field, check the others.** Edit the name and confirm the note is unchanged. Forms that send only some fields can blank the rest.
- **Open, change nothing, save.** Nothing should change, including any “last edited” date you show.

## Delete: the cases after the click

- **Only that one.** Case 8 has a second item for a reason. Delete the first and count what is left.
- **The confirmation.** If there is a “Delete this item?” question, answer no once. The item must still be there.
- **Its old address.** Case 9. Bookmarks and emails keep pointing at deleted things. The answer should be your app’s own not-found page with a way back. Ours says “There is no such page.” with a link to the list.
- **Delete twice.** Two tabs, or a double press. On our practice app the second delete answers the same not-found page. A server error there is what to look for.

## The same thing twice

One extra case, worth a decision: create a second item with exactly the same name. Our practice app makes two items called `Twin` without a word. For items that may be fine. For a project name, a coupon code or an email address it is a bug. Decide per kind of thing, and write the decision into the case.

## Leave nothing behind

A CRUD test is its own clean-up if you run it to the end: what it created, it deleted. When it fails halfway, it leaves things in a real list. Give test things a recognisable name, and delete by that name at the start of the next run. More on that in [test data cleanup](https://everyrole.dev/blog/test-data-cleanup).

## How EveryRole runs these

EveryRole knows this kind of stop: a form that makes something with a page of its own. On top of the form’s own cases (good input, empty and the rest), its main cases there are the ones above, by these names: **Seen in its list**, **The list with one of them**, **The list with two of them**, **Edit**, **Kept after reload**, **Delete**, **Gone after reload**, and **The list with none** when you tell it a kind of user has an account you keep empty. Its Kept after reload is checked after the edit, which is case 6 in the table. One extra case, **The same thing twice**, is off until you turn it on.

It marks what it creates with the run’s own id, so it can find its item in the list and delete only that one. Delete and Gone after reload double as the clean-up, and when an app has no delete it says the thing was left behind.

What it wouldn’t have found is the edit form’s missing server check. It types into the page like a person, and the browser’s guard stops an empty name before the server is asked. Sending past the browser is still a test for you, and on the edit form it paid off.

## 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

Forms, uploads and downloads

### [File upload test cases: type, size, empty, name](https://everyrole.dev/blog/file-upload-test-cases)

Test cases for file upload, with seven small files to keep at hand. Wrong type, renamed type, empty, at and over the limit, an odd name, the same name twice.

Nov 22, 2026  6 min read

Forms, uploads and downloads

### [How to test a file download or a CSV export](https://everyrole.dev/blog/test-file-download)

How to test file download in four checks. A file arrived, it is the type the button names, it isn’t empty, and it holds the rows the page showed. Open the file.

Nov 22, 2026  6 min read

Forms, uploads and downloads

### [Multi-step form testing: every step, and Back](https://everyrole.dev/blog/multi-step-form-testing)

Multi-step form testing in five cases: all steps good, the wizard’s own Back, the browser’s Back, a reload mid-way, and a step opened by its address.

Nov 22, 2026  6 min read
