This repository focuses on automating test cases for the Label Hub system using Selenium.
- Invalid Login: Verify prevention of invalid login attempts and display of appropriate error messages.
- Missing Credentials: Test login behavior when credentials (email or password) are missing.
- Successful Login: Validate the ability to login with valid credentials.
- User Creation: Confirm user creation with valid input data.
- Duplicate Username: Test prevention of creating duplicate usernames.
- User Deletion: Verify proper handling and functionality when deleting a user.
- Project Creation: Ensure the creation of projects and prevent duplicate project names.
- Project Deletion: Validate that project deletion functionality works as expected.
- File Upload: Test file upload functionality, including format validation.
- Annotator Interactions: Validate the actions and data integrity of annotators during project interactions.
- Configuration Adjustments: Verify that system configuration can be modified as required.
- Secure Data Viewing: Ensure that only authorized users can view sensitive project data.
The test cases provide broad coverage across multiple key functionalities, including:
- Authentication
- User and project management
- File handling
- System configuration
Many test cases focus on negative scenarios (e.g., attempting to create users with invalid data) to ensure that error handling mechanisms are in place and function correctly.
Different roles, such as Admin, Annotator, and Validator, are thoroughly tested to ensure proper role-based access control and functionality.
Special attention is given to edge cases, such as:
- Overly long names
- Invalid email formats
- Incorrect password requirements
Selenium, a browser automation tool, is used to implement all test cases, allowing for dynamic interaction with the web application.
Each test case is written as a separate function (e.g., Login
, UserCreate
, ProjectCreate
) to promote reusability and readability. This modular approach ensures that test cases are easier to maintain and scale.
This document lists and describes various test cases for user login, user creation, project management, and other operations in the system.
-
Case 1: Wrong ID
- Description: Attempt to login with an incorrect email ID.
-
Case 2: Without Password
- Description: Attempt to login with an email but without providing a password.
-
Case 3: Without ID and Password
- Description: Attempt to login with both email and password fields left empty.
-
Case 4: Without ID
- Description: Attempt to login without providing an email but with a password.
-
Case 5: Only Part of the Email
- Description: Attempt to login with an incomplete email.
-
Case 6: Correct ID and Password
- Description: Successfully login with the correct email and password.
-
Case 7: Create User without Role
- Description: Attempt to create a user without specifying a role.
-
Case 8: Create User without Email
- Description: Attempt to create a user without providing an email.
-
Case 9: Create User without Password Requirement
- Description: Attempt to create a user with an inadequate password.
-
Case 10: Create User without Name
- Description: Attempt to create a user without providing a name.
-
Case 11: Create User with All Valid Info
- Description: Successfully create a user with all required and valid information.
-
Case 12: Create User with Password Size >14
- Description: Create a user with an excessively long password.
-
Case 13: Create User with Big Name
- Description: Create a user with an overly long name.
-
Case 14: Create User without Gender
- Description: Attempt to create a user without specifying a gender.
-
Case 15: Create User without Valid Email
- Description: Attempt to create a user with an invalid email format.
-
Case 16: Create User with Non-Integer Mobile Number
- Description: Attempt to create a user with an invalid mobile number format.
-
Case 17: Delete a User
- Description: Successfully delete a user.
- Case 18: Logout
- Description: Successfully log out.
-
Case 19: Create User with Mobile Number <11 Digits
- Description: Attempt to create a user with a short mobile number.
-
Case 20: Create User with Mobile Number >11 Digits
- Description: Attempt to create a user with a long mobile number.
-
Case 21: Create New Project
- Description: Successfully create a new project.
-
Case 22: Create Duplicate Project
- Description: Attempt to create a project with a name that already exists.
-
Case 23: Delete Project
- Description: Successfully delete a project.
-
Case 24: File Upload in Project
- Description: Successfully upload a file to a project.
-
Case 25: Annotator
- Description: Annotator logs in, searches for a project, annotates, and logs out.
-
Case 26: Validator (No Edit)
- Description: Validator logs in, searches for a project, performs validation without edits, and logs out.
-
Case 27: Validator (Edit)
- Description: Validator logs in, searches for a project, performs validation with edits, and logs out.
-
Case 28: Rejected Annotator
- Description: Annotator logs in, searches for a rejected project, reviews rejection, and logs out.
-
Case 29: Configuration
- Description: Admin logs in and configures settings.
-
Case 30: Data View
- Description: Admin logs in and views project data.
These test cases ensure robust testing of user, project, and admin operations within the system.
Total Tests Conducted: 30
27 tests passed successfully, demonstrating expected outcomes in functionalities such as:
- User login
- User creation
- Project management
- File uploads
3 tests failed, as detailed below:
-
Default User Role Assignment
- Issue: When creating a user without specifying a role, the system defaulted to the "guest" role.
- Expected Behavior: Either make the role selection mandatory or clearly indicate the default role.
- Recommendation: Modify the system to enforce role selection or clarify the default assignment.
-
Phone Number Validation
- Issue: Entering an incorrect phone number format caused the website to crash.
- Expected Behavior: The system should validate phone numbers and handle incorrect inputs gracefully.
- Recommendation: Implement frontend validation for phone numbers and improve backend error handling to prevent crashes.
-
Performance Issues
- Issue: The website occasionally experienced slow loading times and displayed 404 errors.
- Expected Behavior: The website should load efficiently and avoid such errors.
- Recommendation: Investigate the server-side issues or configuration inefficiencies causing the slow loading and 404 errors.
-
Role Selection Enforcement
- Ensure that role selection is mandatory during user creation or provide clearer feedback on default role assignment.
-
Input Validation and Error Handling
- Implement robust frontend validation for phone numbers and improve backend error handling to prevent crashes.
-
Server and Performance Review
- Investigate and resolve the issues causing slow loading times and 404 errors to enhance the stability and performance of the website.
The majority of tests confirmed that the system's core functionalities are working as intended. However, addressing the identified bugs and performance issues is essential for providing a smoother and more reliable user experience.