TEST TYPE: dashboard_functional Title: TC_FUNC_001_Generate_Promo_Code_Successfully Scenario: Generate a promo code for a marketing company with valid details. Steps to reproduce: 1. Navigate to the promo code generation dashboard. 2. Enter the company details including company_name, contact_name, contact_email, and contact_number. 3. Set promo_code_value, promo_code_expiry_date, and free_vehicles_allowed. 4. Click the "Generate Promo Code" button. Expected Result: The system generates a unique promo code and displays it on the dashboard. Actual Result: [To be filled during execution] Priority: High Title: TC_FUNC_002_Unique_Email_Validation Scenario: Attempt to generate a promo code using an already registered contact_email. Steps to reproduce: 1. Navigate to the promo code generation dashboard. 2. Enter the company details using an existing contact_email. 3. Fill in the remaining fields and click "Generate Promo Code." Expected Result: The system displays an error message indicating that the contact_email is already in use. Actual Result: [To be filled during execution] Priority: High Title: TC_FUNC_003_Promo_Code_Association_On_Use Scenario: Associate a promo code with a user and vehicle upon use. Steps to reproduce: 1. Register a new user or log in as an existing user. 2. Select a subscription plan. 3. Enter a valid Partner Promo Code during the plan selection. 4. Add a vehicle using the promo code. Expected Result: The promo code is associated with the user and the vehicle, reducing the available free vehicles by one. Actual Result: [To be filled during execution] Priority: High Title: TC_FUNC_004_Expiry_Date_Validation Scenario: Attempt to use an expired promo code. Steps to reproduce: 1. Register a new user or log in as an existing user. 2. Select a subscription plan. 3. Enter an expired Partner Promo Code. Expected Result: The system displays an error message indicating the promo code has expired. Actual Result: [To be filled during execution] Priority: Medium Title: TC_FUNC_005_Exceed_Free_Vehicle_Limit Scenario: Attempt to add more vehicles than allowed by the promo code. Steps to reproduce: 1. Register a new user or log in as an existing user. 2. Use a valid Partner Promo Code with a limit of 10 free vehicles. 3. Add 11 vehicles using the promo code. Expected Result: The system allows only 10 vehicles to be added for free and prompts for payment for the 11th vehicle. Actual Result: [To be filled during execution] Priority: High Title: TC_FUNC_006_Promo_Code_Tracking Scenario: Track which vehicles are registered using a specific promo code. Steps to reproduce: 1. Navigate to the promo code management dashboard. 2. Search for a specific promo code. 3. View the list of vehicles registered under the promo code. Expected Result: The dashboard displays all vehicles associated with the selected promo code. Actual Result: [To be filled during execution] Priority: Medium Title: TC_FUNC_007_Generate_Promo_Code_With_Minimum_Details Scenario: Generate a promo code with only the mandatory fields filled. Steps to reproduce: 1. Navigate to the promo code generation dashboard. 2. Enter only the mandatory fields: company_name, contact_email, promo_code_value, promo_code_expiry_date, and free_vehicles_allowed. 3. Click "Generate Promo Code." Expected Result: The system successfully generates a promo code with the provided details. Actual Result: [To be filled during execution] Priority: Medium Title: TC_FUNC_008_Invalid_Email_Format Scenario: Attempt to generate a promo code with an invalid email format. Steps to reproduce: 1. Navigate to the promo code generation dashboard. 2. Enter an invalid email format in the contact_email field. 3. Fill in the remaining fields and click "Generate Promo Code." Expected Result: The system displays an error message indicating the email format is invalid. Actual Result: [To be filled during execution] Priority: High Title: TC_FUNC_009_View_All_Promo_Codes Scenario: View a list of all active promo codes on the dashboard. Steps to reproduce: 1. Navigate to the promo code management dashboard. 2. Click on "View All Promo Codes." Expected Result: The dashboard displays a list of all active promo codes with their details. Actual Result: [To be filled during execution] Priority: Medium Title: TC_FUNC_010_Promo_Code_Usage_Limit Scenario: Ensure promo code can only be used by the first user who applies it. Steps to reproduce: 1. Register a new user or log in as an existing user. 2. Enter a valid Partner Promo Code during the plan selection. 3. Attempt to use the same promo code with a different user account. Expected Result: The system prevents the second user from using the promo code and displays an error message. Actual Result: [To be filled during execution] Priority: High Title: TC_FUNC_011_Invalid_Promo_Code_Entry Scenario: Attempt to use an invalid promo code during plan selection. Steps to reproduce: 1. Register a new user or log in as an existing user. 2. Select a subscription plan. 3. Enter an invalid Partner Promo Code. Expected Result: The system displays an error message indicating the promo code is invalid. Actual Result: [To be filled during execution] Priority: Medium Title: TC_FUNC_012_Delete_Expired_Promo_Codes Scenario: Automatically delete expired promo codes from the dashboard. Steps to reproduce: 1. Navigate to the promo code management dashboard. 2. Verify the list of promo codes. 3. Check the list after the expiry date of certain promo codes has passed. Expected Result: Expired promo codes are automatically removed from the dashboard. Actual Result: [To be filled during execution] Priority: Medium Title: TC_FUNC_013_Add_Vehicles_With_Existing_Subscription Scenario: Add vehicles using a promo code without affecting existing subscriptions. Steps to reproduce: 1. Log in as a user with an active subscription. 2. Enter a valid Partner Promo Code during the subscription plan update. 3. Add a vehicle using the promo code. Expected Result: The new vehicle is added using the promo code without impacting existing subscriptions. Actual Result: [To be filled during execution] Priority: High Title: TC_FUNC_014_Update_Promo_Code_Details Scenario: Update details of an existing promo code. Steps to reproduce: 1. Navigate to the promo code management dashboard. 2. Select an existing promo code. 3. Update fields such as promo_code_expiry_date or free_vehicles_allowed. 4. Save changes. Expected Result: The promo code details are updated successfully on the dashboard. Actual Result: [To be filled during execution] Priority: Medium Title: TC_FUNC_015_Promo_Code_Generation_Audit_Log Scenario: Verify the audit log entry for promo code generation. Steps to reproduce: 1. Generate a new promo code using the dashboard. 2. Navigate to the audit log section. 3. Search for the recent promo code generation entry. Expected Result: The audit log contains an entry detailing the promo code generation action. Actual Result: [To be filled during execution] Priority: Low Title: TC_FUNC_016_Validate_Contact_Number_Format Scenario: Attempt to generate a promo code with an invalid contact_number format. Steps to reproduce: 1. Navigate to the promo code generation dashboard. 2. Enter an invalid phone number format in the contact_number field. 3. Fill in the remaining fields and click "Generate Promo Code." Expected Result: The system displays an error message indicating the contact number format is invalid. Actual Result: [To be filled during execution] Priority: Medium Title: TC_FUNC_017_Display_Promo_Code_Usage_Stats Scenario: Display usage statistics for a specific promo code. Steps to reproduce: 1. Navigate to the promo code management dashboard. 2. Select a promo code to view usage statistics. Expected Result: The dashboard displays statistics such as the number of vehicles added and remaining free vehicles. Actual Result: [To be filled during execution] Priority: Medium Title: TC_FUNC_018_Promo_Code_Notification Scenario: Notify the marketing company when a promo code is fully utilized. Steps to reproduce: 1. Use a promo code until all free vehicles are added. 2. Check for notification sent to the marketing company. Expected Result: The marketing company receives a notification via email when the promo code is fully utilized. Actual Result: [To be filled during execution] Priority: Medium Title: TC_FUNC_019_Handle_Promo_Code_Database_Errors Scenario: Handle database errors gracefully during promo code generation. Steps to reproduce: 1. Simulate a database connection error during promo code generation. 2. Attempt to generate a new promo code. Expected Result: The system displays an error message and logs the issue without crashing. Actual Result: [To be filled during execution] Priority: High Title: TC_FUNC_020_Fetch_Promo_Code_By_Company_Name Scenario: Retrieve promo codes using the company_name filter. Steps to reproduce: 1. Navigate to the promo code management dashboard. 2. Enter a company_name in the search filter. 3. Click "Search." Expected Result: The dashboard displays all promo codes associated with the specified company. Actual Result: [To be filled during execution] Priority: Low TEST TYPE: dashboard_negative Title: TC_NEG_01_Invalid_Contact_Email_Format Scenario: Entering an incorrectly formatted email in the contact_email field while generating a promo code. Steps to reproduce: 1. Navigate to the promo code generation page. 2. Enter all required fields with valid data except for contact_email. 3. Enter "invalid-email-format" in the contact_email field. 4. Submit the form. Expected Result: An error message should display indicating the email format is invalid. Actual Result: [To be filled during execution] Priority: High Title: TC_NEG_02_Empty_Company_Details Scenario: Attempting to generate a promo code without entering company details. Steps to reproduce: 1. Navigate to the promo code generation page. 2. Leave all fields related to company details empty. 3. Submit the form. Expected Result: An error message should display indicating that company details are mandatory. Actual Result: [To be filled during execution] Priority: High Title: TC_NEG_03_Expired_Promo_Code_Usage Scenario: Trying to use a promo code that has already expired. Steps to reproduce: 1. Ensure a promo code exists with an expiry date in the past. 2. Attempt to use the expired promo code during plan selection. Expected Result: An error message should indicate that the promo code is expired. Actual Result: [To be filled during execution] Priority: Medium Title: TC_NEG_04_Negative_Free_Vehicles_Allowed Scenario: Entering a negative number in the free_vehicles_allowed field. Steps to reproduce: 1. Navigate to the promo code generation page. 2. Enter all required fields with valid data except for free_vehicles_allowed. 3. Enter "-5" in the free_vehicles_allowed field. 4. Submit the form. Expected Result: An error message should be displayed indicating invalid number of free vehicles. Actual Result: [To be filled during execution] Priority: High Title: TC_NEG_05_Duplicate_Promo_Code Scenario: Attempting to generate a promo code with a duplicate promo_code_value. Steps to reproduce: 1. Generate a promo code with a unique promo_code_value. 2. Attempt to generate another promo code with the same promo_code_value. Expected Result: An error message should indicate that the promo code value must be unique. Actual Result: [To be filled during execution] Priority: Medium Title: TC_NEG_06_Empty_Promo_Code_Value Scenario: Leaving the promo_code_value field empty during promo code creation. Steps to reproduce: 1. Navigate to the promo code generation page. 2. Leave the promo_code_value field empty. 3. Fill out all other required fields with valid data. 4. Submit the form. Expected Result: An error message should be displayed indicating that the promo code value is required. Actual Result: [To be filled during execution] Priority: High Title: TC_NEG_07_Invalid_Expiry_Date_Format Scenario: Entering an incorrectly formatted date in the promo_code_expiry_date field. Steps to reproduce: 1. Navigate to the promo code generation page. 2. Enter all required fields with valid data except for promo_code_expiry_date. 3. Enter "32/13/2023" in the promo_code_expiry_date field. 4. Submit the form. Expected Result: An error message should indicate the expiry date format is invalid. Actual Result: [To be filled during execution] Priority: High Title: TC_NEG_08_Contact_Number_Exceeds_Length Scenario: Entering a contact_number that exceeds the maximum allowed length. Steps to reproduce: 1. Navigate to the promo code generation page. 2. Enter all required fields with valid data except for contact_number. 3. Enter a contact_number with more than 15 digits. 4. Submit the form. Expected Result: An error message should be displayed indicating the contact number exceeds the allowed length. Actual Result: [To be filled during execution] Priority: Medium Title: TC_NEG_09_Missing_Contact_Name Scenario: Forgetting to enter a contact_name while generating a promo code. Steps to reproduce: 1. Navigate to the promo code generation page. 2. Fill out all fields except for contact_name. 3. Submit the form. Expected Result: An error message should be displayed indicating that the contact name is required. Actual Result: [To be filled during execution] Priority: Medium Title: TC_NEG_10_Use_Promo_Code_By_Non_Eligible_User Scenario: An unauthorized user attempts to use a promo code meant for a specific individual. Steps to reproduce: 1. Generate a promo code for a specific user (e.g., John). 2. Attempt to use the same promo code with a different user's account. Expected Result: An error message should indicate that the promo code is not valid for this user. Actual Result: [To be filled during execution] Priority: High Title: TC_NEG_11_Empty_Promo_Code_Entry Scenario: Attempting to submit an empty promo code during plan selection. Steps to reproduce: 1. Navigate to the plan selection page. 2. Leave the promo code field empty. 3. Attempt to submit the form. Expected Result: An error message should indicate that a promo code must be entered. Actual Result: [To be filled during execution] Priority: Medium Title: TC_NEG_12_Non_Numeric_Free_Vehicles Scenario: Entering non-numeric characters in the free_vehicles_allowed field. Steps to reproduce: 1. Navigate to the promo code generation page. 2. Enter "ten" in the free_vehicles_allowed field. 3. Fill out all other fields with valid data. 4. Submit the form. Expected Result: An error message should indicate that the free vehicles field must be numeric. Actual Result: [To be filled during execution] Priority: High Title: TC_NEG_13_Long_Company_Name Scenario: Entering a company_name that exceeds the maximum character limit. Steps to reproduce: 1. Navigate to the promo code generation page. 2. Enter a company_name with more than 255 characters. 3. Fill out all other fields with valid data. 4. Submit the form. Expected Result: An error message should indicate that company name exceeds the maximum character limit. Actual Result: [To be filled during execution] Priority: Medium Title: TC_NEG_14_Special_Characters_In_Company_Name Scenario: Entering special characters in the company_name field. Steps to reproduce: 1. Navigate to the promo code generation page. 2. Enter "!@#$%^&*" in the company_name field. 3. Fill out all other fields with valid data. 4. Submit the form. Expected Result: An error message should indicate that special characters are not allowed in the company name. Actual Result: [To be filled during execution] Priority: Low Title: TC_NEG_15_Promo_Code_Value_With_Spaces Scenario: Entering a promo_code_value with spaces. Steps to reproduce: 1. Navigate to the promo code generation page. 2. Enter "PROMO CODE" in the promo_code_value field. 3. Fill out all other fields with valid data. 4. Submit the form. Expected Result: An error message should indicate that spaces are not allowed in the promo code value. Actual Result: [To be filled during execution] Priority: Medium Title: TC_NEG_16_Reusing_Expired_Promo_Code Scenario: Attempting to regenerate a promo code using an expired promo code value. Steps to reproduce: 1. Ensure a promo code with a specific value has expired. 2. Attempt to regenerate a new promo code using the same expired promo code value. Expected Result: An error message should indicate the promo code value is already expired and cannot be reused. Actual Result: [To be filled during execution] Priority: Medium Title: TC_NEG_17_Contact_Email_Already_Exists Scenario: Entering a contact_email that already exists in the database. Steps to reproduce: 1. Navigate to the promo code generation page. 2. Enter a contact_email that is already associated with another company. 3. Fill out all other fields with valid data. 4. Submit the form. Expected Result: An error message should indicate that the contact email already exists and must be unique. Actual Result: [To be filled during execution] Priority: High Title: TC_NEG_18_Empty_Contact_Number Scenario: Leaving the contact_number field empty during promo code creation. Steps to reproduce: 1. Navigate to the promo code generation page. 2. Leave the contact_number field empty. 3. Fill out all other fields with valid data. 4. Submit the form. Expected Result: An error message should indicate that the contact number is required. Actual Result: [To be filled during execution] Priority: Medium Title: TC_NEG_19_Invalid_Characters_In_Contact_Number Scenario: Entering invalid characters in the contact_number field. Steps to reproduce: 1. Navigate to the promo code generation page. 2. Enter "123-ABC-7890" in the contact_number field. 3. Fill out all other fields with valid data. 4. Submit the form. Expected Result: An error message should indicate that only numeric characters are allowed in the contact number. Actual Result: [To be filled during execution] Priority: High Title: TC_NEG_20_Promo_Code_For_Inactive_Company Scenario: Attempting to generate a promo code for a company marked as inactive. Steps to reproduce: 1. Mark a company as inactive in the database. 2. Attempt to generate a promo code for that inactive company. Expected Result: An error message should indicate that promo codes cannot be generated for inactive companies. Actual Result: [To be filled during execution] Priority: Medium