Index: tst_create_custom_treatment/test.py =================================================================== diff -u -rfb6ac562400c6f366eb194c2c9e3ea9d0186d162 -rc9803a315063da3e0a07031078ed4e9075fb1a5c --- tst_create_custom_treatment/test.py (.../test.py) (revision fb6ac562400c6f366eb194c2c9e3ea9d0186d162) +++ tst_create_custom_treatment/test.py (.../test.py) (revision c9803a315063da3e0a07031078ed4e9075fb1a5c) @@ -53,15 +53,68 @@ treatment_status = hd_simulator.cmd_send_treatment_parameter_validation_response(reject_reasons) test.compare(treatment_status, True, "custom treatment should be rejected") - def verify_request_continue_mode(): """ Method to accept treatment response. """ mouseClick(waitForObject(names.o_CreateCustomTreatment_Continue_button)) treatment_status = hd_simulator.cmd_send_treatment_parameter_manual_validation_response([1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 ]) test.compare(treatment_status, True, "custom treatment should be accepted") + +def verify_manual_validation_mode(): + """ + Method to verify response of all the parameters in the treatment. + """ + test.startSection("Verifying manual validation response for all patameters") + + treatment_status = hd_simulator.cmd_send_treatment_parameter_manual_validation_response([0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18 ]) + test.compare(treatment_status, True, "custom treatment should be rejected") + treatment_status = hd_simulator.cmd_send_treatment_parameter_manual_validation_response([1, 0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17 ]) + test.compare(treatment_status, True, "custom treatment should be rejected") + treatment_status = hd_simulator.cmd_send_treatment_parameter_manual_validation_response([2, 1, 0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16 ]) + test.compare(treatment_status, True, "custom treatment should be rejected") + treatment_status = hd_simulator.cmd_send_treatment_parameter_manual_validation_response([3, 2, 1, 0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15 ]) + test.compare(treatment_status, True, "custom treatment should be rejected") + treatment_status = hd_simulator.cmd_send_treatment_parameter_manual_validation_response([4, 3, 2, 1, 0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14 ]) + test.compare(treatment_status, True, "custom treatment should be rejected") + treatment_status = hd_simulator.cmd_send_treatment_parameter_manual_validation_response([5, 4, 3, 2, 1, 0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13 ]) + test.compare(treatment_status, True, "custom treatment should be rejected") + treatment_status = hd_simulator.cmd_send_treatment_parameter_manual_validation_response([6, 5, 4, 3, 2, 1, 0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12 ]) + test.compare(treatment_status, True, "custom treatment should be rejected") + treatment_status = hd_simulator.cmd_send_treatment_parameter_manual_validation_response([7, 6, 5, 4, 3, 2, 1, 0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11 ]) + test.compare(treatment_status, True, "custom treatment should be rejected") + treatment_status = hd_simulator.cmd_send_treatment_parameter_manual_validation_response([8, 7, 6, 5, 4, 3, 2, 1, 0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10 ]) + test.compare(treatment_status, True, "custom treatment should be rejected") + treatment_status = hd_simulator.cmd_send_treatment_parameter_manual_validation_response([9, 8, 7, 6, 5, 4, 3, 2, 1, 0, 1, 2, 3, 4, 5, 6, 7, 8, 9 ]) + test.compare(treatment_status, True, "custom treatment should be rejected") + + for expected_treatment_title in config.CREATE_TREATMENT_PARAMETERS: + parameter_object = set_parameter_type(text = expected_treatment_title) + utility.scroll_to_zone(parameter_object, names.o_treatment_create_flickable) + + treatment_status = hd_simulator.cmd_send_treatment_parameter_manual_validation_response([10, 9, 8, 7, 6, 5, 4, 3, 2, 1, 0, 1, 2, 3, 4, 5, 6, 7, 8 ]) + test.compare(treatment_status, True, "custom treatment should be rejected") + treatment_status = hd_simulator.cmd_send_treatment_parameter_manual_validation_response([11, 10, 9, 8, 7, 6, 5, 4, 3, 2, 1, 0, 1, 2, 3, 4, 5, 6, 7 ]) + test.compare(treatment_status, True, "custom treatment should be rejected") + treatment_status = hd_simulator.cmd_send_treatment_parameter_manual_validation_response([12, 11, 10, 9, 8, 7, 6, 5, 4, 3, 2, 1, 0, 1, 2, 3, 4, 5, 6 ]) + test.compare(treatment_status, True, "custom treatment should be rejected") + treatment_status = hd_simulator.cmd_send_treatment_parameter_manual_validation_response([13, 12, 11, 10, 9, 8, 7, 6, 5, 4, 3, 2, 1, 0, 1, 2, 3, 4, 5 ]) + test.compare(treatment_status, True, "custom treatment should be rejected") + treatment_status = hd_simulator.cmd_send_treatment_parameter_manual_validation_response([14, 13, 12, 11, 10, 9, 8, 7, 6, 5, 4, 3, 2, 1, 0, 1, 2, 3, 4 ]) + test.compare(treatment_status, True, "custom treatment should be rejected") + + treatment_status = hd_simulator.cmd_send_treatment_parameter_manual_validation_response([15, 14, 13, 12, 11, 10, 9, 8, 7, 6, 5, 4, 3, 2, 1, 0, 1, 2, 3 ]) + test.compare(treatment_status, True, "custom treatment should be rejected") + treatment_status = hd_simulator.cmd_send_treatment_parameter_manual_validation_response([16, 15, 14, 13, 12, 11, 10, 9, 8, 7, 6, 5, 4, 3, 2, 1, 0, 1, 2 ]) + test.compare(treatment_status, True, "custom treatment should be rejected") + treatment_status = hd_simulator.cmd_send_treatment_parameter_manual_validation_response([17, 16, 15, 14, 13, 12, 11, 10, 9, 8, 7, 6, 5, 4, 3, 2, 1, 0, 1 ]) + test.compare(treatment_status, True, "custom treatment should be rejected") + treatment_status = hd_simulator.cmd_send_treatment_parameter_manual_validation_response([18, 17, 16, 15, 14, 13, 12, 11, 10, 9, 8, 7, 6, 5, 4, 3, 2, 1, 0 ]) + test.compare(treatment_status, True, "custom treatment should be rejected") + utils.waitForGUI(0.1) + + test.endSection() def verify_custom_treatment_record_rejected(): """ @@ -634,6 +687,9 @@ verify_operational_details_from_confirm_treatment_screen() verify_prescriptional_details_from_confirm_treatment_screen() mouseClick(waitForObject(names.o_PreTreatmentConfirm_confirmButton_TouchRect)) + utils.waitForGUI(0.2) + mouseClick(waitForObject(names.o_back_button_confirm_treatment)) + verify_manual_validation_mode() utils.tstDone()