Index: tst_create_custom_treatment/test.py =================================================================== diff -u -r2b8304ba389c8d6e3fd7987d0af1625443b594dc -rb3524cb74d96f70808818d97e2e84957aa11e684 --- tst_create_custom_treatment/test.py (.../test.py) (revision 2b8304ba389c8d6e3fd7987d0af1625443b594dc) +++ tst_create_custom_treatment/test.py (.../test.py) (revision b3524cb74d96f70808818d97e2e84957aa11e684) @@ -23,11 +23,9 @@ from builtins import str as pyStr from configuration import utility from configuration import config -from configuration import assertion_helper from dialin.common.msg_defs import RequestRejectReasons from dialin.ui.hd_simulator import HDSimulator -squish_assert = assertion_helper.AssertionHelper() PATIENT_ID = "demopatientid" HEPARIN_TYPE = "UFH 1,000 IU/mL" @@ -110,14 +108,14 @@ RequestRejectReasons.REQUEST_REJECT_REASON_NOT_ALLOWED_IN_CURRENT_MODE ] * hd_simulator.NUM_TREATMENT_PARAMETERS treatment_status = hd_simulator.cmd_send_treatment_parameter_validation_response(reject_reasons) - squish_assert.is_true(treatment_status, "custom treatment should be rejected") + test.compare(treatment_status, True, "custom treatment should be rejected") def verify_request_continue_mode(hd_simulator): 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 ]) - squish_assert.is_true(treatment_status, "custom treatment should be accepted") + test.compare(treatment_status, True, "custom treatment should be accepted") def verify_custom_treatment_record_rejected(): @@ -132,7 +130,7 @@ parameter_text = waitForObject(parameter_object) parameter_text_color = parameter_text.color - squish_assert.are_equal(expected_color, parameter_text_color, message = "parameter color should be "\ + test.compare(expected_color, parameter_text_color, "parameter color should be "\ f"red for {expected_treatment_title}, if the confirmation get rejected !") test.endSection() @@ -147,8 +145,7 @@ else: slider_object = object.children(parameter)[2] slider_status = utility.set_slider_value(slider_value, slider_object, bislider, slider_range) - squish_assert.is_true(condition = slider_status, - message = f"{item_text} should set to value -> {slider_value}") + test.compare(slider_status, True, f"{item_text} should set to value -> {slider_value}") def create_custom_treatment_record( blood_flow_rate, dialysate_flow_rate, @@ -237,9 +234,8 @@ test.log("Verifying the 'Confirm Treatment' is displayed and its title text") confirm_treatment_title = waitForObject(names.confirm_title_text) - squish_assert.are_equal(expected_value=CONFIRM_TREATMENT_TITLE, - actual_value=confirm_treatment_title.text.toUtf8().constData(), - message=f"{CONFIRM_TREATMENT_TITLE} screen is displayed " + + test.compare(CONFIRM_TREATMENT_TITLE, confirm_treatment_title.text.toUtf8().constData(), + f"{CONFIRM_TREATMENT_TITLE} screen is displayed " + f"and title should be {CONFIRM_TREATMENT_TITLE}") @@ -249,9 +245,8 @@ verify_the_confirm_treatment_screen_is_displayed() prescription_title = waitForObject(names.prescription_title_text) - squish_assert.are_equal(expected_value=PRESCRIPTION_TITLE, - actual_value=prescription_title.text.toUtf8().constData(), - message=f"{PRESCRIPTION_TITLE} title " + + test.compare(PRESCRIPTION_TITLE, prescription_title.text.toUtf8().constData(), + f"{PRESCRIPTION_TITLE} title " + f"should be {PRESCRIPTION_TITLE}") option = index for expected_prescription_title, measurement in PRESCRIPTION_DETAILS.items(): @@ -264,14 +259,12 @@ text=expected_prescription_title)) actual_measurement = object.parent(prescription_title) actual_measurement = object.children(actual_measurement)[-1] - squish_assert.are_equal(expected_value=expected_prescription_title, - actual_value=prescription_title.text.toUtf8().constData(), - message=f"{expected_prescription_title} title should be " + + test.compare(expected_prescription_title, prescription_title.text.toUtf8().constData(), + f"{expected_prescription_title} title should be " + f"{expected_prescription_title}") unit = CREATE_TREATMENT_SLIDER_VALUES[expected_prescription_title][option] - squish_assert.are_equal(expected_value=f"{unit} {measurement}", - actual_value=actual_measurement.text.toUtf8().constData(), - message=f"{expected_prescription_title} corresponding "+ + test.compare(f"{unit} {measurement}", actual_measurement.text.toUtf8().constData(), + f"{expected_prescription_title} corresponding "+ f"measured value should be {unit} {measurement}") option = index test.endSection() @@ -290,15 +283,13 @@ text=expected_operational_title)) actual_measurement = object.parent(operational_title) actual_measurement = object.children(actual_measurement)[-1] - squish_assert.are_equal(expected_value=expected_operational_title, - actual_value=operational_title.text.toUtf8().constData(), - message=f"{expected_operational_title} title should be " + + test.compare(expected_operational_title, operational_title.text.toUtf8().constData(), + f"{expected_operational_title} title should be " + f"{expected_operational_title}") if expected_operational_title == "Acid Concentrate" or expected_operational_title == "Dialyzer Type": measurement = measurement[index] - squish_assert.are_equal(expected_value=measurement, - actual_value=actual_measurement.text.toUtf8().constData(), - message=f"{expected_operational_title} corresponding "+ + test.compare(measurement, actual_measurement.text.toUtf8().constData(), + f"{expected_operational_title} corresponding "+ f"measured value should be {measurement}") test.endSection()