EveryRole

Multi-step form testing: every step, and Back

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.

Multi-step form testing comes down to one idea: a wizard is a form with memory, and the memory is what breaks. Each step can be a perfectly good form on its own. The bugs are in what the wizard remembers when you move between steps, in any direction other than straight ahead.

So test five things: all steps with good answers, the wizard’s own Back, the browser’s Back, a reload in the middle, and a later step opened directly by its address. We ran all five on our practice app’s three-step set-up wizard and it failed two of them.

Multi-step form testing on a real wizard

The wizard asks for a company name, then a team size, then shows a summary that ends with “All set”. Step two has two buttons: Back and Next.

Going straight through works. Type Sample Co, press Next, type 12, press Next, and the summary shows both. That is the happy path, and it is the path the wizard was built along.

Now go backwards once.

Our practice app. Back keeps step one. It loses what was typed on the step you left.

Back took us to step one and the company was still there. Good. Then Next brought us to step two, and the 12 we had typed was gone.

The cause is ordinary. The wizard saves a step’s answer when you press Next. Back is a different button with a different code path, and that path only moves you. Nobody decided that Back should throw answers away. Nobody decided anything, which is how this kind of bug gets made.

On a long step with a dozen fields, retyping them all is a reason to leave.

Test cases for a multi-step form

Here are the five, with what each must show. Use values you can recognise later: Sample Co and 12, never test and 1.

CaseWhat to doWhat must come out
All steps goodFill every step, press Next each timeThe last page shows every answer you gave, exactly as typed
The wizard’s own BackOn step two, type an answer, press Back, then NextStep one still has its answer. Step two still has what you typed
The browser’s BackOn step two, press the browser’s Back arrow, then go forward with NextSame as above, and no “resubmit this form?” warning
Reload mid-wayOn step two, reload the pageYou are still on step two, and step one’s answer is still saved
A step by its addressPaste the last step’s address into a fresh sessionThe wizard sends you to the first unanswered step

The first case is the one everyone runs. If your wizard has a branch (a different step three for companies and for individuals), run it once per branch.

The second case has two halves, and it is easy to check only the first: do the earlier steps still show what I typed? The half that fails is the step you are leaving.

The form Back button test, twice

There are two Back buttons and they share nothing.

The wizard’s own Back is a button in your page. It does what your code tells it to. On our practice app it is a submit button that skips the browser’s validation, so that an empty team size doesn’t stop you from going back. That part is right, and it is worth checking on yours: a Back button that says “Please fill out this field” is a trap.

The browser’s Back is not yours. If each step is its own address, the browser shows the previous page again, either from its memory or by asking the server. If the previous page was the answer to a posted form, some browsers ask whether to send the form again. And if the whole wizard lives at one address and changes steps with scripts, the browser’s Back leaves the wizard entirely and the person loses everything.

You can’t stop people using it. So decide what should happen and test that it does. Our practice app passed this one: each step has its own address, the browser’s Back showed step one with Sample Co in it, and going back from the summary showed step two with its 12. It passed the reload too.

Open the last step by its address

This one is quick. Start a fresh session, log in, and paste the address of the final step.

The practice app's summary page opened directly by its address: Company and Team size are both blank, and the page says "All set"
A new account that answered nothing. The wizard says it is all set.

Our practice app says “All set” to someone who answered nothing. On a set-up wizard that is a cosmetic problem. On a checkout, where the last step is “Confirm order”, or on a sign-up where the last step creates the account, a step that trusts you arrived the proper way is how empty orders and half-made accounts get into a database.

The right behaviour is boring: any step checks that the earlier ones are done, and sends you to the first one that isn’t.

Each step is still a form

A wizard doesn’t excuse its steps from ordinary form cases. Each step with a field should get the empty form and, where a field has a format, a wrong one.

Ours has a team size field that only accepts a number of at least one. The browser enforces that. The server doesn’t: sent past the browser, it saves the word lots and the summary shows it. We wrote that one up in the post on input validation testing. It matters more in a wizard than in a single form, because the bad value isn’t shown the door at once. It travels to the last step and into whatever the wizard creates there.

One more thing to check per step: after an error, does the step keep what you typed in its other fields? That is wrong, then right, and long steps are where it hurts.

What we’d skip

Every combination of going back and forth. Back once from the second step, and once from the last step to the first, is enough to learn whether the wizard saves on leaving.

Timing out in the middle is worth one manual try (leave the tab for an hour, come back, press Next) but it isn’t worth automating early. And we wouldn’t test the progress bar beyond “it says the step I’m on”.

How EveryRole tests a wizard

EveryRole treats a wizard as one stop of a journey, however many pages it has. It runs two main cases there. “All steps good” fills each page and compares where it ends with the answer you approved on the first result. “Its own Back keeps the answers” fills step one, goes forward, presses the wizard’s own Back and checks, in code, that step one’s answers are still there. That is the half our practice app passes. The half it fails, what you typed on the step you left, isn’t in its list today.

It types like a person, in a real browser, from the outside. So what it reports is what a person gets, and the server-only test (the lots one) stays a test for you to do past the browser. The other kinds of user are checked at the stop too: does the page open for them, and do they get its button.

The browser’s Back, the step you leave, and the step-by-address case are not in its list for a wizard today. They are on ours, by hand.

Keep reading

Forms, uploads and downloads

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.

6 min read

Forms, uploads and downloads

File upload test cases: type, size, empty, name

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.

6 min read

Forms, uploads and downloads

How to test a file download or a CSV export

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.

6 min read