# Forms and validation test cases

A starting point: adapt these to your app. These cases cover filling in and sending a form: required fields, limits, formats and error messages. They are generic, not full coverage of your app: remove what does not apply and add what is special about yours.

## FRM-01: Required fields left empty

Type: Negative

Steps:

1. Leave every required field empty
2. Send the form

Expected result: Each required field shows a message next to it, and the form is not sent.

Status: Not run

## FRM-02: Text at the maximum length

Type: Boundary

Steps:

1. Type exactly the maximum number of characters into a limited field
2. Send the form

Expected result: The form is sent and the full text is saved.

Status: Not run

## FRM-03: Text one character over the maximum

Type: Boundary

Steps:

1. Type one character more than the maximum
2. Send the form

Expected result: The field stops at the maximum or shows a message. Nothing is cut short without telling the user.

Status: Not run

## FRM-04: Letters in a number field

Type: Negative

Steps:

1. Type 'abc' in a field that takes a number
2. Send the form

Expected result: The field says it takes a number.

Status: Not run

## FRM-05: An email in the wrong format

Type: Negative

Steps:

1. Type 'name@example' in an email field
2. Send the form

Expected result: The field says the email is not valid.

Status: Not run

## FRM-06: A valid form is sent once

Type: Positive

Steps:

1. Fill in every field correctly
2. Select Send twice, quickly

Expected result: One submission is recorded, and a confirmation shows.

Status: Not run

## FRM-07: What was typed is kept after an error

Type: Positive

Steps:

1. Fill in the form with one invalid field
2. Send the form

Expected result: Only the invalid field shows an error, and everything else typed is still there.

Status: Not run

## FRM-08: Errors are announced and reachable

Type: Positive

Steps:

1. Turn on a screen reader, or use only the keyboard
2. Send the form with one field in error

Expected result: Focus moves to the first error or a summary, and each message is read out with its field.

Status: Not run

## FRM-09: Characters beyond plain English

Type: Boundary

Steps:

1. Enter a name such as 'Zoë Ångström' or '山田太郎'
2. Send the form and open the saved record

Expected result: The name is saved and shown exactly as typed.

Status: Not run

## FRM-10: HTML in a text field is shown as text

Type: Negative

Steps:

1. Type '<b>bold</b>' in a text field
2. Send the form and view the saved value

Expected result: The text shows as typed, with the angle brackets, and is not turned into formatting.

Status: Not run

## FRM-11: Spaces only in a required field

Type: Boundary

Steps:

1. Type only spaces in a required field
2. Send the form

Expected result: The field is treated as empty and asks for a value.

Status: Not run

## FRM-12: An impossible date

Type: Negative

Steps:

1. Enter 31 February in a date field
2. Send the form

Expected result: The field says the date does not exist.

Status: Not run

## FRM-13: Keyboard only

Type: Positive

Steps:

1. Use Tab to move through every field and button
2. Press Enter or Space on the send button

Expected result: Focus moves in a sensible order with a visible outline, and the form is sent.

Status: Not run

## FRM-14: Cancel discards the changes

Type: Positive

Steps:

1. Change some fields
2. Select Cancel, and confirm if asked

Expected result: The changes are not saved, and the form shows the earlier values when opened again.

Status: Not run
