Index: shared/scripts/configuration/config.py =================================================================== diff -u -r28eaad74b094db5832e72f1d66f19e534045393f -r8599e463aedf05d6a36824ca4eba62d914a5db5c --- shared/scripts/configuration/config.py (.../config.py) (revision 28eaad74b094db5832e72f1d66f19e534045393f) +++ shared/scripts/configuration/config.py (.../config.py) (revision 8599e463aedf05d6a36824ca4eba62d914a5db5c) @@ -14,40 +14,14 @@ ############################################################################ import os +from configuration.strings import * AUT_NAME = "denaliSquish" COMMON_PATH = os.environ['HOME']+"/Projects" - -COLOR_CODES = {"Aqua": "#81ffff", "Blue": "#017dea", "Blue 2": "#1090d5", "Green": "#29fd2d", "Grey": "#d3d3d3", - "Lavender": "#db98f5", "Light Blue": "#acd7f1", "Light Teal": "#29f1da","Lime": "#b7fc36", - "Magenta":"#fd28fd", "Orange": "#f2721c", "Peach":"#f1979a", "Red": "#c53b33", "Rose":"#fc178d", - "Slate blue":"#7f7ffa", "Violet": "#6435c9", "White": "#ffffff", "Yellow": "#fcfc4d"} - -#standby mode -GOODMORNING_START_TIME_SEC = 0 -GOODEVENING_START_TIME_SEC = 43200 - -BLOOD_PRIMING_TEXT = "Blood Priming" -SALINE_UNIT = "mL" -BLOOD_PRIMING_DEFAULT_VALUE = "0 mL" - #tst_pretreatment_screens -PRE_TREATMENT_SCREENS = ["Create" , "Sample" , "Consumables" , "Disposables" , "Prime" , "Ultrafiltration" , "BP/HR" , "Connection" , "Start"] NUM_OF_PRETREATMENT_BULLETS = len(PRE_TREATMENT_SCREENS) -#tst_pretreatment_screens color palettes -CURRENT_COLOR = '#000000' -COMPLETE_COLOR= '#4290ec' -ENABLED_COLOR = '#fcfcfc' -INCOMPLETE_COLOR = '#607a91' -CONSUMABLE_SELF_TEST_TEXT = "Consumables Self Test" -BICARB_PUMP_CHECK_TEXT = "BiCarb Pump Check" -ACID_PUMP_CHECK_TEXT = "Acid Pump Check" -SELF_TEST_COMPLETE_TEXT = "Self Test Complete!" -CONSUMABLE_SELF_TEST_BICARB_PUMP_CHECK_STATE = 3 - - Index: shared/scripts/configuration/utility.py =================================================================== diff -u -refab64294d8971b8a8b2d5729995cb4dc54e8379 -r8599e463aedf05d6a36824ca4eba62d914a5db5c --- shared/scripts/configuration/utility.py (.../utility.py) (revision efab64294d8971b8a8b2d5729995cb4dc54e8379) +++ shared/scripts/configuration/utility.py (.../utility.py) (revision 8599e463aedf05d6a36824ca4eba62d914a5db5c) @@ -16,7 +16,7 @@ import names import test import squish -from configuration import config +from configuration import config, strings from builtins import int as pyInt def check_if_object_is_within_the_container(obj=None, container=None): @@ -76,36 +76,36 @@ @param pre_treatment_step : indicates the Current pre-treatment step """ test.startSection("verification of page step indicators") - for page in range(len(config.PRE_TREATMENT_SCREENS)): + for page in range(config.NUM_OF_PRETREATMENT_BULLETS): bullet_children = object.children(squish.waitForObjectExists(get_bullet_object(screen_obj, page))) bullet_circle_color = bullet_children[0].color.name bullet_border_color = bullet_children[0].border.color.name - step_title = squish.waitForObjectExists(get_text_object(screen_obj, config.PRE_TREATMENT_SCREENS[page])) + step_title = squish.waitForObjectExists(get_text_object(screen_obj, strings.PRE_TREATMENT_SCREENS[page])) if page < pre_treatment_step: - test.log("To verify the step indicator of the completed pre-treatment screen " + config.PRE_TREATMENT_SCREENS[page]) + test.log("To verify the step indicator of the completed pre-treatment screen " + strings.PRE_TREATMENT_SCREENS[page]) test.verify(squish.waitForObjectExists(get_bullet_object(screen_obj, page)).complete) test.verify(not squish.waitForObjectExists(get_bullet_object(screen_obj, page)).current) - test.compare(bullet_circle_color, config.COMPLETE_COLOR, " the bullet color must be " + str(config.COMPLETE_COLOR)) - test.compare(bullet_border_color, config.COMPLETE_COLOR," the bullet border color must be " + str(config.COMPLETE_COLOR)) - test.compare(step_title.color.name, config.ENABLED_COLOR, " the text color must be " + str(config.ENABLED_COLOR)) + test.compare(bullet_circle_color, strings.COMPLETE_COLOR, " the bullet color must be " + str(strings.COMPLETE_COLOR)) + test.compare(bullet_border_color, strings.COMPLETE_COLOR," the bullet border color must be " + str(strings.COMPLETE_COLOR)) + test.compare(step_title.color.name, strings.ENABLED_COLOR, " the text color must be " + str(strings.ENABLED_COLOR)) elif page == pre_treatment_step: - test.log("To verify the step indicators of the current pre-treatment screen " + config.PRE_TREATMENT_SCREENS[page]) + test.log("To verify the step indicators of the current pre-treatment screen " + strings.PRE_TREATMENT_SCREENS[page]) test.verify(squish.waitForObjectExists(get_bullet_object(screen_obj, page)).current) test.verify(not squish.waitForObjectExists(get_bullet_object(screen_obj, page)).complete) - test.compare(bullet_circle_color,config.CURRENT_COLOR," the bullet color must be " + str(config.CURRENT_COLOR)) - test.compare(bullet_border_color,config.COMPLETE_COLOR, " the bullet border color must be " + str(config.COMPLETE_COLOR)) - test.compare(step_title.color.name,config.ENABLED_COLOR, " the text color must be " + str(config.ENABLED_COLOR)) + test.compare(bullet_circle_color,strings.CURRENT_COLOR," the bullet color must be " + str(strings.CURRENT_COLOR)) + test.compare(bullet_border_color,strings.COMPLETE_COLOR, " the bullet border color must be " + str(strings.COMPLETE_COLOR)) + test.compare(step_title.color.name,strings.ENABLED_COLOR, " the text color must be " + str(strings.ENABLED_COLOR)) test.verify(step_title.font.bold, " the current text must be in bold") else: - test.log("To verify the step indicators of the remaining pre-treatment screen " + config.PRE_TREATMENT_SCREENS[page]) + test.log("To verify the step indicators of the remaining pre-treatment screen " + strings.PRE_TREATMENT_SCREENS[page]) test.verify(not squish.waitForObjectExists(get_bullet_object(screen_obj, page)).current,) test.verify(not squish.waitForObjectExists(get_bullet_object(screen_obj, page)).complete,) - test.compare(step_title.color.name,config.INCOMPLETE_COLOR, " the text color must be " + str(config.INCOMPLETE_COLOR)) - test.compare(bullet_circle_color,config.CURRENT_COLOR," the bullet color must be " + str(config.CURRENT_COLOR)) - test.compare(bullet_border_color,config.INCOMPLETE_COLOR, " the bullet border color must be " + str(config.INCOMPLETE_COLOR)) + test.compare(step_title.color.name,strings.INCOMPLETE_COLOR, " the text color must be " + str(strings.INCOMPLETE_COLOR)) + test.compare(bullet_circle_color,strings.CURRENT_COLOR," the bullet color must be " + str(strings.CURRENT_COLOR)) + test.compare(bullet_border_color,strings.INCOMPLETE_COLOR, " the bullet border color must be " + str(strings.INCOMPLETE_COLOR)) test.endSection() def get_text_object(screen_obj, txt): Index: tst_pre_treatment_consumables/test.py =================================================================== diff -u -refab64294d8971b8a8b2d5729995cb4dc54e8379 -r8599e463aedf05d6a36824ca4eba62d914a5db5c --- tst_pre_treatment_consumables/test.py (.../test.py) (revision efab64294d8971b8a8b2d5729995cb4dc54e8379) +++ tst_pre_treatment_consumables/test.py (.../test.py) (revision 8599e463aedf05d6a36824ca4eba62d914a5db5c) @@ -21,14 +21,15 @@ import names from dialin.ui import utils -from configuration import config, utility +from configuration import config, utility, strings from dialin.ui.hd_simulator import HDSimulator from dialin.ui.utils import waitForGUI -from dialin.common.hd_defs import PreTreatmentSubModes, PreTreatmentConsumableSelfTestStates, HDOpModes, HDOpSubModes, PreTreatmentSampleWaterStates, PreTreatmentConsumableSelfTestStates, PreTreatmentNoCartSelfTestsStates, PreTreatmentCartridgeInstallStates, PreTreatmentDrySelfTestsStates, PreTreatmentPrimeStates, PreTreatmentRecircStates, PreTreatmentPatientConnectionStates +from dialin.common.hd_defs import PreTreatmentSubModes, PreTreatmentConsumableSelfTestStates, HDOpModes, HDOpSubModes, PreTreatmentSampleWaterStates, PreTreatmentConsumableSelfTestStates, PreTreatmentNoCartSelfTestsStates, PreTreatmentCartridgeInstallStates, PreTreatmentDrySelfTestsStates, PreTreatmentPrimeStates, PreTreatmentRecircStates, PreTreatmentPatientConnectionStates,\ + PreTreatmentModeStates hd_simulator = HDSimulator() -PRE_TREATMENT_STEP= 2 +PRE_TREATMENT_STEP = PreTreatmentModeStates.HD_PRE_TREATMENT_SELF_TEST_CONSUMABLE_STATE.value num_of_instructions = 0 SCREEN_OBJ= names.o_PreTreatmentStack_preTreatmentConsumablesStack_PreTreatmentConsumablesStack @@ -48,59 +49,59 @@ """ The method is used to verify the functionality of the right arrow in the instruction navigation, as well as the visibility of the two arrows """ - test.startSection(" rightward instruction navigation") - test.verify(not object.exists(names.o_PreTreatmentBase_leftImage_Image), " The left arrow must be missing") + test.startSection("Rightward instruction navigation") + test.verify(not object.exists(names.o_PreTreatmentBase_leftImage_Image), "The left navigation arrow should not be present on the first screen of instruction") for indicator in range(1,num_of_instructions + 1): verify_bullet_navigation(indicator) if indicator != num_of_instructions: mouseClick(waitForObject(names.o_PreTreatmentBase_rightImage_Image)) - test.verify(not object.exists(names.o_PreTreatmentBase_rightImage_Image), " The right arrow must be missing") + test.verify(not object.exists(names.o_PreTreatmentBase_rightImage_Image), "The right navigation arrow should not be present on the last screen of instruction") test.endSection() def verify_left_instruction_navigation(): """ The method is used to verify the functionality of the left arrow in the instruction navigation, as well as the visibility of the two arrows """ - test.startSection(" leftward instruction navigation") - test.verify(not object.exists(names.o_PreTreatmentBase_rightImage_Image), " The right arrow must be missing") + test.startSection("Leftward instruction navigation") + test.verify(not object.exists(names.o_PreTreatmentBase_rightImage_Image), "The right navigation arrow should not be present on the last screen of instruction") for indicator in range(num_of_instructions, 0, -1): verify_bullet_navigation(indicator) if indicator != 1: mouseClick(waitForObject(names.o_PreTreatmentBase_leftImage_Image)) - test.verify(not object.exists(names.o_PreTreatmentBase_leftImage_Image), " The left arrow must be missing") + test.verify(not object.exists(names.o_PreTreatmentBase_leftImage_Image), "The left navigation arrow should not be present on the first screen of instruction") test.endSection() def verify_bullet_navigation(num): """ This method verifies the properties of the bullets present in the instruction navigation screen """ - test.startSection(" instruction bullet verification for screens " + str(num)) + test.startSection("Instruction bullet verification for screens " + str(num)) for instruction in range(1,num_of_instructions + 1): bullet_children = object.children(waitForObjectExists(utility.get_bullet_object(SCREEN_OBJ,(config.NUM_OF_PRETREATMENT_BULLETS + instruction) - 1))) bullet_circle_color = bullet_children[0].color.name bullet_border_color = bullet_children[0].border.color.name if instruction <= num: - test.compare(bullet_circle_color, config.COMPLETE_COLOR) - test.compare(bullet_border_color,config.COMPLETE_COLOR) + test.compare(bullet_circle_color, strings.COMPLETE_COLOR) + test.compare(bullet_border_color,strings.COMPLETE_COLOR) test.log("The bullet " + str(instruction) + " must be a complete bullet") else: - test.compare(bullet_circle_color, config.CURRENT_COLOR) - test.compare(bullet_border_color,config.INCOMPLETE_COLOR) + test.compare(bullet_circle_color, strings.CURRENT_COLOR) + test.compare(bullet_border_color,strings.INCOMPLETE_COLOR) test.log("The bullet " + str(instruction) + " must be a incomplete bullet") test.endSection() def verify_consumable_states_text(): """ Method is to verify the Consumables Self test states' text. """ - test.compare(waitForObjectExists(names.o_PreTreatmentBase_Consumables_Self_Test_Text).text ,config.CONSUMABLE_SELF_TEST_TEXT," text must be " + config.CONSUMABLE_SELF_TEST_TEXT) - test.compare(waitForObjectExists(names.o_PreTreatmentBase_BiCarb_Pump_Check_Text).text, config.BICARB_PUMP_CHECK_TEXT," text must be " + config.BICARB_PUMP_CHECK_TEXT) - test.compare(waitForObjectExists(names.o_PreTreatmentBase_Acid_Pump_Check_Text).text,config.ACID_PUMP_CHECK_TEXT, " text must be from" + config.ACID_PUMP_CHECK_TEXT) - test.compare(waitForObjectExists(names.o_PreTreatmentBase_Self_Test_Complete_Text).text,config.SELF_TEST_COMPLETE_TEXT," must be " + config.SELF_TEST_COMPLETE_TEXT ) + test.compare(waitForObjectExists(names.o_PreTreatmentBase_Consumables_Self_Test_Text).text ,strings.CONSUMABLE_SELF_TEST_TEXT," text must be " + strings.CONSUMABLE_SELF_TEST_TEXT) + test.compare(waitForObjectExists(names.o_PreTreatmentBase_BiCarb_Pump_Check_Text).text, strings.BICARB_PUMP_CHECK_TEXT," text must be " + strings.BICARB_PUMP_CHECK_TEXT) + test.compare(waitForObjectExists(names.o_PreTreatmentBase_Acid_Pump_Check_Text).text,strings.ACID_PUMP_CHECK_TEXT, " text must be from" + strings.ACID_PUMP_CHECK_TEXT) + test.compare(waitForObjectExists(names.o_PreTreatmentBase_Self_Test_Complete_Text).text,strings.SELF_TEST_COMPLETE_TEXT," must be " + strings.SELF_TEST_COMPLETE_TEXT ) def verify_consumables_states(): """ @@ -109,14 +110,14 @@ Acid Pump Check Self Test Complete. """ - test.startSection("Check and busy indicator shouldn't be present") - for states in range (config.CONSUMABLE_SELF_TEST_BICARB_PUMP_CHECK_STATE): - test.startSection(" consumable self test state = " + str(states)) + test.startSection("Check and busy indicator shouldn't be present initially") + for states in range (PreTreatmentConsumableSelfTestStates.CONSUMABLE_SELF_TESTS_ACID_PUMP_CHECK_STATE.value): + test.startSection(" consumable self test state = " + PreTreatmentConsumableSelfTestStates(states).name) hd_simulator.cmd_send_pre_treatment_state_data(sub_mode=HDOpSubModes.SUBMODE_WAIT_FOR_DISINFECT.value, water_sample_state=PreTreatmentSampleWaterStates.SAMPLE_WATER_SETUP_STATE.value,consumables_self_test_state=PreTreatmentConsumableSelfTestStates.CONSUMABLE_SELF_TESTS_BICARB_PUMP_CHECK_STATE.value, no_cartridge_self_test_state=PreTreatmentNoCartSelfTestsStates.NO_CART_SELF_TESTS_START_STATE.value,installation_state=PreTreatmentCartridgeInstallStates.CARTRIDGE_INSTALL_STATE.value, dry_self_test_state=PreTreatmentDrySelfTestsStates.DRY_SELF_TESTS_START_STATE.value, prime_state=PreTreatmentPrimeStates.HD_PRIME_START_STATE.value,recirculate_state=PreTreatmentRecircStates.PRE_TREATMENT_RECIRC_STATE.value, patient_connection_state=PreTreatmentPatientConnectionStates.PATIENT_CONNECTION_STATE.value) - bicarb_indicator=utility.get_indicators(SCREEN_OBJ,config.BICARB_PUMP_CHECK_TEXT) - acid_indicator=utility.get_indicators(SCREEN_OBJ,config.ACID_PUMP_CHECK_TEXT) + bicarb_indicator=utility.get_indicators(SCREEN_OBJ,strings.BICARB_PUMP_CHECK_TEXT) + acid_indicator=utility.get_indicators(SCREEN_OBJ,strings.ACID_PUMP_CHECK_TEXT) test.verify(not bicarb_indicator[0].visible, " busy indicator for bicarb pump must not be present") test.verify(not bicarb_indicator[1].visible, " check indicator for bicarb pump must not be present") test.verify(not acid_indicator[0].visible , " busy indicator for acid pump must not be present") @@ -125,40 +126,40 @@ test.endSection() test.startSection("Verification of Check and busy indicators") - test.log(" consumable self test state = 3") + test.log(" consumable self test state = " + PreTreatmentConsumableSelfTestStates.CONSUMABLE_SELF_TESTS_ACID_PUMP_CHECK_STATE.name) hd_simulator.cmd_send_pre_treatment_state_data(sub_mode=HDOpSubModes.SUBMODE_WAIT_FOR_DISINFECT.value, water_sample_state=PreTreatmentSampleWaterStates.SAMPLE_WATER_SETUP_STATE.value,consumables_self_test_state=PreTreatmentConsumableSelfTestStates.CONSUMABLE_SELF_TESTS_ACID_PUMP_CHECK_STATE.value, no_cartridge_self_test_state=PreTreatmentNoCartSelfTestsStates.NO_CART_SELF_TESTS_START_STATE.value,installation_state=PreTreatmentCartridgeInstallStates.CARTRIDGE_INSTALL_STATE.value, dry_self_test_state=PreTreatmentDrySelfTestsStates.DRY_SELF_TESTS_START_STATE.value, prime_state=PreTreatmentPrimeStates.HD_PRIME_START_STATE.value,recirculate_state=PreTreatmentRecircStates.PRE_TREATMENT_RECIRC_STATE.value, patient_connection_state=PreTreatmentPatientConnectionStates.PATIENT_CONNECTION_STATE.value) - bicarb_indicator=utility.get_indicators(SCREEN_OBJ,config.BICARB_PUMP_CHECK_TEXT) - acid_indicator=utility.get_indicators(SCREEN_OBJ,config.ACID_PUMP_CHECK_TEXT) + bicarb_indicator=utility.get_indicators(SCREEN_OBJ,strings.BICARB_PUMP_CHECK_TEXT) + acid_indicator=utility.get_indicators(SCREEN_OBJ,strings.ACID_PUMP_CHECK_TEXT) test.verify(waitForObject(bicarb_indicator[0]).visible,"The Busy indicator for BiCarb Pump must be visible") test.verify(not acid_indicator[0].visible," busy indicator for acid pump must not be present") test.verify(not acid_indicator[1].visible," check indicator for acid pump must not be present") - test.log(" consumable self test state = 4") + test.log(" consumable self test state = " + PreTreatmentConsumableSelfTestStates.CONSUMABLE_SELF_TESTS_COMPLETE_STATE.name) hd_simulator.cmd_send_pre_treatment_state_data(sub_mode=HDOpSubModes.SUBMODE_WAIT_FOR_DISINFECT.value, water_sample_state=PreTreatmentSampleWaterStates.SAMPLE_WATER_SETUP_STATE.value,consumables_self_test_state=PreTreatmentConsumableSelfTestStates.CONSUMABLE_SELF_TESTS_COMPLETE_STATE.value, no_cartridge_self_test_state=PreTreatmentNoCartSelfTestsStates.NO_CART_SELF_TESTS_START_STATE.value,installation_state=PreTreatmentCartridgeInstallStates.CARTRIDGE_INSTALL_STATE.value, dry_self_test_state=PreTreatmentDrySelfTestsStates.DRY_SELF_TESTS_START_STATE.value, prime_state=PreTreatmentPrimeStates.HD_PRIME_START_STATE.value,recirculate_state=PreTreatmentRecircStates.PRE_TREATMENT_RECIRC_STATE.value, patient_connection_state=PreTreatmentPatientConnectionStates.PATIENT_CONNECTION_STATE.value) - bicarb_indicator=utility.get_indicators(SCREEN_OBJ,config.BICARB_PUMP_CHECK_TEXT) - acid_indicator=utility.get_indicators(SCREEN_OBJ,config.ACID_PUMP_CHECK_TEXT) + bicarb_indicator=utility.get_indicators(SCREEN_OBJ,strings.BICARB_PUMP_CHECK_TEXT) + acid_indicator=utility.get_indicators(SCREEN_OBJ,strings.ACID_PUMP_CHECK_TEXT) test.verify(waitForObject(bicarb_indicator[1]).visible,"The check indicator for Bicarb Pump must be visible") test.log("BiCarb Pump Check is completed") test.verify(waitForObject(acid_indicator[0]).visible,"The Busy indicator for Acid Pump must be visible") - test.log(" consumable self test state = 5") + test.log(" consumable self test state = " + PreTreatmentConsumableSelfTestStates.NUM_OF_CONSUMABLE_SELF_TESTS_STATES.name) hd_simulator.cmd_send_pre_treatment_state_data(sub_mode=HDOpSubModes.SUBMODE_WAIT_FOR_DISINFECT.value, water_sample_state=PreTreatmentSampleWaterStates.SAMPLE_WATER_SETUP_STATE.value,consumables_self_test_state=PreTreatmentConsumableSelfTestStates.NUM_OF_CONSUMABLE_SELF_TESTS_STATES.value, no_cartridge_self_test_state=PreTreatmentNoCartSelfTestsStates.NO_CART_SELF_TESTS_START_STATE.value,installation_state=PreTreatmentCartridgeInstallStates.CARTRIDGE_INSTALL_STATE.value, dry_self_test_state=PreTreatmentDrySelfTestsStates.DRY_SELF_TESTS_START_STATE.value, prime_state=PreTreatmentPrimeStates.HD_PRIME_START_STATE.value,recirculate_state=PreTreatmentRecircStates.PRE_TREATMENT_RECIRC_STATE.value, patient_connection_state=PreTreatmentPatientConnectionStates.PATIENT_CONNECTION_STATE.value) test.log("Verification for Acid Pump check is done") - bicarb_indicator=utility.get_indicators(SCREEN_OBJ,config.BICARB_PUMP_CHECK_TEXT) - acid_indicator=utility.get_indicators(SCREEN_OBJ,config.ACID_PUMP_CHECK_TEXT) + bicarb_indicator=utility.get_indicators(SCREEN_OBJ,strings.BICARB_PUMP_CHECK_TEXT) + acid_indicator=utility.get_indicators(SCREEN_OBJ,strings.ACID_PUMP_CHECK_TEXT) test.verify(bicarb_indicator[1].visible) test. verify(acid_indicator[1].visible) test.verify(waitForObjectExists(names.o_PreTreatmentBase_Self_Test_Complete_Text).visible) test.log("Self test complete for consumables is done") - test.compare(waitForObjectExists(names.o_PreTreatmentBase_Self_Test_Complete_Text).text,config.SELF_TEST_COMPLETE_TEXT," text must be " + config.SELF_TEST_COMPLETE_TEXT ) + test.compare(waitForObjectExists(names.o_PreTreatmentBase_Self_Test_Complete_Text).text,strings.SELF_TEST_COMPLETE_TEXT," text must be " + strings.SELF_TEST_COMPLETE_TEXT ) test.endSection() def main(): @@ -183,7 +184,7 @@ test.endSection() test.startSection("verification of consumable self test ") - test.verify(not object.exists(names.o_PreTreatmentBase_Self_Test_Complete_Text),config.SELF_TEST_COMPLETE_TEXT + " must not be present ") + test.verify(not object.exists(names.o_PreTreatmentBase_Self_Test_Complete_Text),strings.SELF_TEST_COMPLETE_TEXT + " must not be present ") verify_consumables_states() verify_consumable_states_text() test.endSection()