What are test cases? Practice writing Test cases for Auto Fill OTP function.

Tram Ho

1. What is a test case?

Test case is a set of actions to be performed to verify a function, a software system is working properly or not. Test case describes input data, action or event and an expected result.

A Test case includes the following important components:

  • Test case ID – TC ID
  • Function
  • Test Objective
  • Pre – condition
  • Test Steps
  • Expected results
  • Test result (Passed ; Failed ; Blocked ; N/A ; Pending)

The tester will compare the expected results with the reality to determine if the software product is working according to the customer’s requirements.

2. Let’s practice.

As the title above, I will write test cases for auto fill OTP function. Because I want everyone to understand easily, I will deploy from design, spec to TCs in the most specific and detailed way. ^ ^

Function overview

A certain app with the login function with a phone number, after entering the phone number, the system will move to the OTP input screen and at the same time the system will send the OTP to that phone number for the user to enter confirmation. just successfully logged in. But in case the user Login with the phone number on the device, instead of having to manually enter it like always, OTP will automatically fill. The function is just that simple, but it will probably meet a lot in practice.

i.Design :

Note:   For Android, it will automatically fill, but for iOS, it will only suggest.

ii. Spec:

NoItem nameDescription
1input OTP– Validation : 6 characters, center align
– In case of auto input with Android, when OTP sms is sent to the device, OTP will automatically fill in box 1
– In case of auto import with iOS:
+ when OTP sms is sent to the device, OTP will automatically show on the keyboard’s suggestion with the content:
“From message
xxxxxx”
+ When the user clicks on the above section, the OTP will automatically enter box 1
+ If the user does not select suggest OTP but enters from the keyboard, the above suggestion will be lost
+ After the user deletes the entered OTP, the suggestion will be displayed again.
2Text Resent OTP“Please enter your OTP
If you did not receive it: Resend ”
Click the text link “Resend” to be resend OTP
3Next
4KeyboardSystem default keyboard

iii. Test case :

Below is not a complete sample of test cases, I have removed some columns, shortening to only a few main columns.

TC IDFunctionTest ObjectivePre-conditionExpected results
1Auto Fill– OTP verification will be automatically displayed in the suggestion above the keyboard and can be successfully logged in when the user presses the suggested value– iOS
– Login với chính sdt của device
1. OTP is automatically displayed in the suggestions above the keyboard
+ Content “From message
xxxxxx”
2. OTP displayed properly as sms sent to device
3. Login successfully with that OTP
2– Verify user can login successfully when entering OTP with keyboard
+ Enter the same value in the suggest
1. Login successful
3– Verify that the OPT in the suggest section will disappear when the user enters the OTP from the keyboard1. The OPT in the suggest section will disappear when the user enters the OTP from the keyboard
4– Verify the OTP in the suggested section will show up again when the user enters the OTP from the keyboard, then delete it1. OPT in the suggested section will show up again
2. When clicking on the suggest section, the OTP will be displayed on the [Enter Password] textbox
3. Login successfully with that OTP
5– OTP verification will again be automatically displayed in the suggestion above the keyboard when the user presses [Resent] textlink1. OTP is automatically displayed in the suggestions above the keyboard
2. The OTP is displayed as if the sms were sent to the device
3. Login successfully with that OTP
6– Verify that the OTP automatically fills in the [Enter Password] textbox when the OTP is sent to the device– Android
– Login with the device’s own sdt
1. OTP auto-fill in [Enter Password] textbox
2. The OTP is displayed as if the sms were sent to the device
3. Login successfully with that OTP
7– Verify that new OTP is automatically filled in [Enter Password] textbox when user clicks [Resent] textlink1. New OTP auto-fill in [Enter Password] textbox
2. The OTP is displayed as if the sms were sent to the device
3. Login successfully with that OTP
8– Verify that the user can delete and re-enter the OTP from the keyboard1. User can delete and re-enter OTP from keyboard
9– Verify that OTP is still autofill/suggest even when the user turns off the device’s message receipt– Android / iOS1. OTP still automatically fills in / suggests correct
10– Verify that OTP is still auto-populate/suggest correctly when another app’s OTP message is sent to the device at the same time.1. OTP still automatically fills in / suggests correct
11– Verify that the OTP is still autofill/suggest correctly even though the user doesn’t accept the message
+ For iOS 11 and above supported
1. OTP still automatically fills in / suggests correct

This is all I want to share. Thank you for reading. ^ ^

> References: [https://www.guru99.com/test-case.html]

Share the news now