So the test cases depend on the type of date picker field that is available for you to test. As the modern date pickers have built-in validation features, in turn, it makes less room for bugs.
|Post On:||Test Case For Date Field|
|Post Type:||Test Case Template|
|Applicable For:||Freshers & Experience|
|Never Miss:||To Join Our Telegram Group|
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 the typical control field. You can check the below screenshot for the editable date field, and another is a date control select-able field.
Test Cases for Date Picker box
- Check the calendar component is active when the date boxes are clicked.
- Check the user is able to select the date from the date picker.
- Check if the calendar component loads properly after a click on any date box.
- Check if the calendar control is by default shows the date, month, a year as per the system date.
- Check on selecting the date from the date picker, the date picker is closed or not.
- Check on click out side of the date picker, the date picker is closing or not.
- 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 scrolling month field forward and backward.
- Check if today’s date is highlighted or not for the default selection of the date box.
- Check that user able to swipe the previous month or year from arrow(forward and Backward) option in date picker (if allow).
- Click on the date field, select the date, and verify if the correct date is shown in the box.
- Check that user able to change the date or not once select from date picker.
- Check that selected date showing in date field or not.
- Check that when user try to select the which are not in boundary.
- Check that the user able to change the date or not when date masking applied on field.
- Check that date showing disable or not (as per condition ,if ).
- Click on the date field, select the date, and verify if the date is shown is in mm/dd/yy format.
- Click on the date field and check if the right month and year for date picker are 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 the invalid order of the date.
- Check if the field accepts hyphen instead of the 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 a blank field for one of the parts 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 the alphabets in the date format.
- Check if the date as 32 is accepted or not.
- Check if the month field accepts 13 or higher numbers 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.
Test Cases For Time Picker
- Check the user can click the time picker or not.
- Check the user can select the time from the time picker or not.
- Check on click on the time field is the time picker is open or not.
- Check that cursor point to hours when user click in time field.
- Check after select the time, the selected time is displaying on the time picker or not.
- Check the time format of the time picker.
- Check is the warning or error message is displaying when the wrong time format is entered.
- Check is the user is able to enter the time manually in the time picker.
- Check the time picker by entering the hour value more then 24.
- Check the time picker by entering the minute value more then 60.
- Check that AM/PM if time format is 12 hours .
- Check the cursor is automatically shift from hour to minite when the user enter valid hour value in the hour field.
- Check is the user is able to switch the cursor from hour to minute by pressing the tab key.
Valid Date and Time Formats
Date format Types
- MM/DD/YY – Month-Day-Year with leading zeros (03/19/2022)
- DD/MM/YY – Day-Month-Year with leading zeros (13/05/2022)
- YY/MM/DD – Year-Month-Day with leading zeros (2022/02/24)
- Month D, Yr – Month name-Day-Year with no leading zeros (February 27, 2022)
- M/D/YY- Month-Day-Year with no leading zeros (3/13/2022)
- D/M/YY- Day-Month-Year with no leading zeros (17/2/2022)
- YY/M/D -Year-Month-Day with no leading zeros (2022/2/13)
- bM/bD/YY -Month-Day-Year with spaces instead of leading zeros( 2/13/2022)
- bD/bM/YY-Day-Month-Year with spaces instead of leading zeros (13/ 2/2022)
- YY/bM/bD-Year-Month-Day with spaces instead of leading zeros (2022/ 2/13)
- MMDDYY-Month-Day-Year with no separators (02132022)
- DDMMYY-Day-Month-Year with no separators (13022022)
- YYMMDD-Year-Month-Day with no separators (20220213)
- MonDDYY-Month abbreviation-Day-Year with leading zeros (Feb132022)
- DDMonYY-Day-Month abbreviation-Year with leading zeros (13Feb2022)
- YYMonDD-Year-Month abbreviation-Day with leading zeros (2022Feb13)
- day/YY-Day of year (counting consecutively from January 1)-Year (48/2022)
- YY/day-Year-Day of Year (counting consecutively from January 1—often called the Julian date format) (2022/48)
- D Month, Yr -Day-Month name-Year (13 February, 2022)
- Yr, Month D -Year-Month name-Day (2022, February 13)
- Mon-DD-YYYY -Month abbreviation, Day with leading zeros, Year (Feb 13, 2022)
- DD-Mon-YYYY -Day with leading zeros, Month abbreviation, Year 13 Feb, 2022.
- YYYYY-Mon-DD -Year, Month abbreviation, Day with leading zeros (2022, Feb 13)
- This format defaults to a two-digit year, but can be overridden to have four digits.
- Mon DD, YYYY-Month abbreviation, Day with leading zeros, Year (Feb 13, 2022)
- DD Mon, YYYY-Day with leading zeros, Month abbreviation, Year(13 Feb, 2022)
- YYYY, Mon DD -Year, Month abbreviation, Day with leading zeros(2022, Feb 13)
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 help you.
If you have any more test cases or have any other suggestions regarding the test case 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.