TEST TYPE: dashboard_functional Here are the functional test cases based on the provided task description: ### Test Case 1 **Title:** TC_FUNC_001_Validate_Payment_Marking_After_Delivery **Scenario:** Verify that the order is marked as paid by the restaurant after delivery. **Preconditions:** An order is accepted by the driver, and the restaurant is set to 'Driver pays restaurant immediately.' **Steps to Reproduce:** 1. Log in as a driver. 2. Accept an order from a restaurant marked for immediate payment. 3. Mark the order as delivered. 4. Check the order status in the dashboard. **Expected Result:** The order status should change to 'Paid by Restaurant.' **Actual Result:** To be filled during execution. **Priority:** High **Test Data:** Order ID: 12345, Restaurant ID: 67890 ### Test Case 2 **Title:** TC_FUNC_002_Validate_Icon_Color_Change_On_Driver_App **Scenario:** Ensure the order appears with a different color or icon in the driver application when marked for immediate payment. **Preconditions:** An order is accepted by the driver, and the restaurant is set to 'Driver pays restaurant immediately.' **Steps to Reproduce:** 1. Log in as a driver. 2. Accept an order from a restaurant marked for immediate payment. 3. Navigate to the order list in the driver app. **Expected Result:** The order should display with a distinct color or icon indicating immediate payment. **Actual Result:** To be filled during execution. **Priority:** Medium **Test Data:** Order ID: 12345 ### Test Case 3 **Title:** TC_FUNC_003_Validate_Payable_Amount_Display **Scenario:** Verify that the payable amount is displayed correctly in the driver application for an order. **Preconditions:** An order is accepted by the driver, and the restaurant is set to 'Driver pays restaurant immediately.' **Steps to Reproduce:** 1. Log in as a driver. 2. Accept an order from a restaurant marked for immediate payment. 3. Check the order details in the driver app. **Expected Result:** The payable amount should be displayed accurately as per the order details. **Actual Result:** To be filled during execution. **Priority:** High **Test Data:** Order ID: 12345, Payable Amount: $50.00 ### Test Case 4 **Title:** TC_FUNC_004_Validate_Cash_Collection_After_Delivery **Scenario:** Ensure that the remaining amount is reflected as collected cash after the order is delivered. **Preconditions:** An order is accepted by the driver, and the restaurant is set to 'Driver pays restaurant immediately.' **Steps to Reproduce:** 1. Log in as a driver. 2. Accept an order from a restaurant marked for immediate payment. 3. Mark the order as delivered. 4. Check the collected cash details in the dashboard. **Expected Result:** The collected cash should include the commission, service fee, tax fee, and delivery charge. **Actual Result:** To be filled during execution. **Priority:** High **Test Data:** Order ID: 12345, Collected Cash: $70.00 ### Test Case 5 **Title:** TC_FUNC_005_Validate_Non_Payment_Status_For_Other_Orders **Scenario:** Verify that orders not marked for immediate payment do not show as paid after delivery. **Preconditions:** An order is accepted by the driver, and the restaurant is not set to 'Driver pays restaurant immediately.' **Steps to Reproduce:** 1. Log in as a driver. 2. Accept an order from a restaurant not marked for immediate payment. 3. Mark the order as delivered. 4. Check the order status in the dashboard. **Expected Result:** The order status should remain as 'Pending Payment' or similar. **Actual Result:** To be filled during execution. **Priority:** Medium **Test Data:** Order ID: 54321 ### Test Case 6 **Title:** TC_FUNC_006_Validate_Immediate_Payment_Icon_Visibility **Scenario:** Ensure that the immediate payment icon is visible only for applicable orders. **Preconditions:** Multiple orders with different payment settings are present. **Steps to Reproduce:** 1. Log in as a driver. 2. View the list of orders. 3. Identify orders marked for immediate payment. **Expected Result:** Only orders marked for immediate payment should display the specific icon. **Actual Result:** To be filled during execution. **Priority:** Medium **Test Data:** Order IDs: 12345 (immediate), 54321 (not immediate) ### Test Case 7 **Title:** TC_FUNC_007_Validate_Payment_Processing_After_Delivery **Scenario:** Confirm that the payment processing occurs correctly after the order is marked as delivered. **Preconditions:** An order is accepted by the driver, and the restaurant is set to 'Driver pays restaurant immediately.' **Steps to Reproduce:** 1. Log in as a driver. 2. Accept an order from a restaurant marked for immediate payment. 3. Mark the order as delivered. 4. Check the payment processing logs. **Expected Result:** Payment should be processed successfully without errors. **Actual Result:** To be filled during execution. **Priority:** High **Test Data:** Order ID: 12345 ### Test Case 8 **Title:** TC_FUNC_008_Validate_Error_Handling_For_Delivery_Failure **Scenario:** Ensure the system handles errors gracefully if the delivery fails. **Preconditions:** An order is accepted by the driver, and the restaurant is set to 'Driver pays restaurant immediately.' **Steps to Reproduce:** 1. Log in as a driver. 2. Accept an order from a restaurant marked for immediate payment. 3. Attempt to mark the order as delivered but simulate a delivery failure. **Expected Result:** An appropriate error message should be displayed, and the order status should not change. **Actual Result:** To be filled during execution. **Priority:** High **Test Data:** Order ID: 12345 ### Test Case 9 **Title:** TC_FUNC_009_Validate_Immediate_Payment_Configuration **Scenario:** Verify that the configuration for immediate payment can be set and updated correctly. **Preconditions:** Access to the restaurant settings is available. **Steps to Reproduce:** 1. Log in as an admin. 2. Navigate to the restaurant settings. 3. Set the payment option to 'Driver pays restaurant immediately.' 4. Save changes and log out. 5. Log in as a driver and check the order list. **Expected Result:** The orders from the restaurant should reflect the immediate payment setting. **Actual Result:** To be filled during execution. **Priority:** Medium **Test Data:** Restaurant ID: 67890 ### Test Case 10 **Title:** TC_FUNC_010_Validate_Notification_On_Payment_Success **Scenario:** Ensure that a notification is sent to the restaurant upon successful payment processing. **Preconditions:** An order is accepted by the driver, and the restaurant is set to 'Driver pays restaurant immediately.' **Steps to Reproduce:** 1. Log in as a driver. 2. Accept an order from a restaurant marked for immediate payment. 3. Mark the order as delivered. 4. Check the restaurant's notification system. **Expected Result:** The restaurant should receive a notification confirming the payment. **Actual Result:** To be filled during execution. **Priority:** Medium **Test Data:** Order ID: 12345 ### Test Case 11 **Title:** TC_FUNC_011_Validate_Insufficient_Funds_Error **Scenario:** Check for error handling when the restaurant has insufficient funds for immediate payment. **Preconditions:** An order is accepted by the driver, and the restaurant is set to 'Driver pays restaurant immediately.' **Steps to Reproduce:** 1. Log in as a driver. 2. Accept an order from a restaurant with insufficient funds. 3. Mark the order as delivered. **Expected Result:** An error message should indicate insufficient funds, and the order should not be marked as paid. **Actual Result:** To be filled during execution. **Priority:** High **Test Data:** Order ID: 12345, Restaurant Funds: $0.00 ### Test Case 12 **Title:** TC_FUNC_012_Validate_Concurrent_Delivery_Processing **Scenario:** Ensure that multiple deliveries can be processed simultaneously without errors. **Preconditions:** Multiple orders are accepted by different drivers from the same restaurant. **Steps to Reproduce:** 1. Log in as multiple drivers. 2. Each driver accepts a different order from the same restaurant. 3. All drivers mark their orders as delivered at the same time. **Expected Result:** All orders should be marked as paid without any processing errors. **Actual Result:** To be filled during execution. **Priority:** High **Test Data:** Order IDs: 12345, 67890 ### Test Case 13 **Title:** TC_FUNC_013_Validate_Payment_Transaction_Log **Scenario:** Verify that payment transactions are logged correctly in the system. **Preconditions:** An order is accepted by the driver, and the restaurant is set to 'Driver pays restaurant immediately.' **Steps to Reproduce:** 1. Log in as a driver. 2. Accept an order from a restaurant marked for immediate payment. 3. Mark the order as delivered. 4. Check the transaction log for the payment entry. **Expected Result:** The transaction log should contain an entry for the payment with correct details. **Actual Result:** To be filled during execution. **Priority:** Medium **Test Data:** Order ID: 12345 ### Test Case 14 **Title:** TC_FUNC_014_Validate_Refund_Process **Scenario:** Ensure that the refund process works correctly if an order is canceled after delivery. **Preconditions:** An order is accepted by the driver, and the restaurant is set to 'Driver pays restaurant immediately.' **Steps to Reproduce:** 1. Log in as a driver. 2. Accept an order from a restaurant marked for immediate payment. 3. Mark the order as delivered. 4. Initiate a refund for the order. **Expected Result:** The refund should be processed correctly, and the order status should reflect the refund. **Actual Result:** To be filled during execution. **Priority:** Medium **Test Data:** Order ID: 12345 ### Test Case 15 **Title:** TC_FUNC_015_Validate_Change_Payment_Setting **Scenario:** Verify that changing the payment setting for a restaurant updates the order processing correctly. **Preconditions:** An order is accepted by the driver, and the restaurant is initially set to 'Driver pays restaurant immediately.' **Steps to Reproduce:** 1. Log in as an admin. 2. Change the payment setting for the restaurant to 'Driver pays restaurant later.' 3. Log in as a driver and check the order list. **Expected Result:** The orders should reflect the updated payment setting. **Actual Result:** To be filled during execution. **Priority:** Medium **Test Data:** Restaurant ID: 67890 ### Test Case 16 **Title:** TC_FUNC_016_Validate_Timeout_Handling **Scenario:** Ensure the system handles timeouts during payment processing gracefully. **Preconditions:** An order is accepted by the driver, and the restaurant is set to 'Driver pays restaurant immediately.' **Steps to Reproduce:** 1. Log in as a driver. 2. Accept an order from a restaurant marked for immediate payment. 3. Simulate a timeout during the payment processing. **Expected Result:** An error message should indicate a timeout, and the order status should remain unchanged. **Actual Result:** To be filled during execution. **Priority:** High **Test Data:** Order ID: 12345 ### Test Case 17 **Title:** TC_FUNC_017_Validate_Transaction_Receipt **Scenario:** Verify that a transaction receipt is generated after successful payment processing. **Preconditions:** An order is accepted by the driver, and the restaurant is set to 'Driver pays restaurant immediately.' **Steps to Reproduce:** 1. Log in as a driver. 2. Accept an order from a restaurant marked for immediate payment. 3. Mark the order as delivered. 4. Check for the generated transaction receipt. **Expected Result:** A transaction receipt should be generated and available for download. **Actual Result:** To be filled during execution. **Priority:** Medium **Test Data:** Order ID: 12345 ### Test Case 18 **Title:** TC_FUNC_018_Validate_Notification_Configuration **Scenario:** Ensure that notification settings can be configured for payment success and failure. **Preconditions:** Access to notification settings is available. **Steps to Reproduce:** 1. Log in as an admin. 2. Navigate to the notification settings. 3. Configure notifications for payment success and failure. 4. Save changes and log out. 5. Log in as a driver and complete an order. **Expected Result:** Notifications should be sent according to the configured settings. **Actual Result:** To be filled during execution. **Priority:** Medium **Test Data:** Notification Settings: Enabled ### Test Case 19 **Title:** TC_FUNC_019_Validate_Analytics_For_Payment_Processing **Scenario:** Verify that analytics data is updated correctly after payment processing. **Preconditions:** An order is accepted by the driver, and the restaurant is set to 'Driver pays restaurant immediately.' **Steps to Reproduce:** 1. Log in as a driver. 2. Accept an order from a restaurant marked for immediate payment. 3. Mark the order as delivered. 4. Check the analytics dashboard for payment processing data. **Expected Result:** The analytics data should reflect the recent payment processing accurately. **Actual Result:** To be filled during execution. **Priority:** Medium **Test Data:** Order ID: 12345 ### Test Case 20 **Title:** TC_FUNC_020_Validate_Integration_With_Third_Party_Payment_Gateway **Scenario:** Ensure that the integration with the third-party payment gateway works correctly for immediate payments. **Preconditions:** An order is accepted by the driver, and the restaurant is set to 'Driver pays restaurant immediately.' **Steps to Reproduce:** 1. Log in as a driver. 2. Accept an order from a restaurant marked for immediate payment. 3. Mark the order as delivered. 4. Monitor the integration logs for payment processing. **Expected Result:** The payment should be processed through the third-party gateway without errors. **Actual Result:** To be filled during execution. **Priority:** High **Test Data:** Order ID: 12345 These test cases cover a variety of scenarios related to the new payment processing feature, ensuring thorough testing of the functional components involved.