In this post, I’m jotting down some of the test cases for date field validation. Date fields in form are available in various options. Some of them have the validation offered by JavaScript library like Jquery etc. So the test cases depends on the type of the date picker field that is available for you to test. As the modern date pickers have built in validation feature, in turn makes less room for bugs.
There are different types of date fields as you can see in the below screenshot. Some date fields have editable fields and some have date selection control. If the date field is created using Jquery UI then you can find typical control field. You can check the below screenshot for editable date field and another is date control select-able field.
Test cases for Date Picker box
- Check the calendar component is active when the date boxes are clicked.
- Check if the calendar component loads properly after click on any date box.
- Check if the calendar control is by default shows the date, month, year as per the system date.
- Check if the calendar control is as per dd/mm/yy or mm/dd/yy format.
- Check if the calendar component allows 10 years forward and backward to select the dates.
- Check if the calendar component allows to scroll month field forward and backward.
- Check if the today’s date is highlighted or not for default selection of the date box.
- Check if the prev and next links are navigable in the date picker control.
- Click on the date field select the date and verify if the correct date is shown in the box.
- Click on the date field select the date and verify if the date shown is in mm/dd/yy format.
- Click on the date field and check if the right month and year for date picker is shown.
Test Cases for Editable Date field
You can see the screenshot below to see how the editable date field box works.
- Check if the form accepts the valid month, date, year in mm/dd/yy format.
- Check if the form accepts the month, year, date in dd/mm/yy format.
- Check if the wrong month, year and date format is accepted. in yy/dd/mm
- Check if the field accepts the input in more than 2 digits.
- Check if the field accepts the input as blank.
- Check if the field accepts any other symbol than backward or forward slash.
- Check if the field accepts special character instead of the dates.
- Check if the field accepts invalid order of the date.
- Check if the field accepts hypen instead of backward or forward slash.
- Check if the field accepts more than 4 digits for the year.
- Check if the field accepts zero in all fields of the box.
- Check if the field accepts blank field for one of the part of the date format.
- Check the format of the date accepted and verify if it is according to the specification.
- Check if the field accepts alphabets in the date format.
- Check if the date as 32 is accepted or not.
- Check if the month field accepts 13 or higher number or flags errors.
- Check if the year is accepted in 3 digits or 2 digits.
- Check if the year field accepts year entered 10 years backward or forward.
- Check if the February 30 or 31 is accepted in the date format.
- Check if the decimal point is accepted instead of hyphen or slashes (- or /).
- Check if the blank spaces are accepted in the date format fields.
- Check the blank space in the random sequence in the correct date format and see if the input is accepted.
These are some of the test cases for date field verification. You can come up with more test cases depending on the requirement and type of the date format field available for you to test. I hope the test cases mentioned here helps you. If you have any more test cases or have any other suggestions regarding the test cases posts, please feel free to let me know. If you wish to contribute any testing related post then feel free to let me know in the comments and i’ll send you an email. Please do share the post on facebook, twitter or any other social media. I’d appreciate your comments 🙂
khush says
thanks foe good information
Roxi says
thank you for sharing this! Really helpful! Happy testing! 🙂