Test Cases
Happy Path
- Test Case 1: Submit the form with all valid data
- Steps:
- Enter
username
as "Nagaraju". - Enter
email
as "nagaraju@example.com". - Enter
password
as "password123". - Enter
age
as "38". - Click "Submit" button.
- Enter
- Expected Result: "Registration successful!" message should be displayed on top of the form
- Steps:
Error Cases
Test Case 2: Username Too Short
- Description: Username is shorter than the minimum length requirement.
- Steps:
- Enter
username
as "jo". - Enter
email
as "john.doe@example.com". - Enter
password
as "password123". - Enter
age
as "25". - Click "Submit" button.
- Enter
- Expected Result: Error message "Username must be at least 3 characters long." is displayed below the username field.
Test Case 3: Invalid Email Format
- Description: Email field does not contain the "@" character.
- Steps:
- Enter
username
as "john_doe". - Enter
email
as "john.doeexample.com". - Enter
password
as "password123". - Enter
age
as "25". - Click "Submit" button.
- Enter
- Expected Result: Error message "Please enter a valid email." is displayed below the email field.
Test Case 4: Password Too Short
- Description: Password is shorter than the minimum length requirement.
- Steps:
- Enter
username
as "john_doe". - Enter
email
as "john.doe@example.com". - Enter
password
as "pass". - Enter
age
as "25". - Click "Submit" button.
- Enter
- Expected Result: Error message "Password must be at least 6 characters long." is displayed below the password field.
Test Case 5: Age Out of Range
- Description: Age is outside the valid range (less than 18 or greater than 100).
- Steps:
- Enter
username
as "john_doe". - Enter
email
as "john.doe@example.com". - Enter
password
as "password123". - Enter
age
as "17". - Click "Submit" button.
- Enter
- Expected Result: Error message "Age must be between 18 and 100." is displayed below the age field.
Test Case 6: Missing Mandatory Fields
- Description: One or more mandatory fields are left empty.
- Steps:
- Leave
username
empty. - Enter
email
as "john.doe@example.com". - Enter
password
as "password123". - Enter
age
as "25". - Click "Submit" button.
- Leave
- Expected Result: No specific error message for missing fields since the form has required attributes. It should prompt an empty error message or default browser validation if applicable.
Test Case 7: Age Field with Non-Numeric Input
- Description: The age field is filled with non-numeric input.
- Steps:
- Enter
username
as "john_doe". - Enter
email
as "john.doe@example.com". - Enter
password
as "password123". - Enter
age
as "abc". - Click "Submit" button.
- Enter
- Expected Result: Error message indicating that the input is not a number should be displayed below the age field.