Index: tst_instructions_poc/test.py =================================================================== diff -u -r535df219a0721d69e25f36e9a24c98e7b59394b3 -r87ee9356d9ed8a0908be46622ddcced2cdc2d5a8 --- tst_instructions_poc/test.py (.../test.py) (revision 535df219a0721d69e25f36e9a24c98e7b59394b3) +++ tst_instructions_poc/test.py (.../test.py) (revision 87ee9356d9ed8a0908be46622ddcced2cdc2d5a8) @@ -21,6 +21,7 @@ title_list = [] count_of_instructions = [] title_count_dict = {} +IMAGE_READY = 1 image_list_from_location = os.listdir(config.EXPECTED_IMAGE_LOCATION) text_obj_names = [names.o_PreTreatmentBase_swipeview_SwipeView_WaterSample,names.o_PreTreatmentBase_swipeview_SwipeView_Consumables,names.o_preTreatmentDisposablesCartridgeInstallation_swipeview_SwipeView,names.o_preTreatmentDisposablesCartridgeConnetion_swipeview_SwipeView,names.o_PreTreatmentBase_swipeview_SwipeView,names.o_preTreatmentDisposablesSalineBag_swipeview_SwipeView,names.o_PreTreatmentBase_swipeview_SwipeView_3,names.o_EndTreatmentRinsebackInit_swipeview_SwipeView,names.o_EndTreatmentRinsebackComplete_swipeview_SwipeView,names.o_patientDisconnectionConfirm_swipeview_SwipeView,names.o_disposablesRemovalConfirm_swipeview_SwipeView,names.o_EndTreatmentBase_swipeview_SwipeView,names.o_disinfect_swipeview_SwipeView] rightarrow_obj_names = [names.o_preTreatmentConsumablesStack_PreTreatmentBase_TreatmentFlowBase,names.o_preTreatmentDisposablesStack_preTreatmentDisposablesCartridgeInstallation_TreatmentFlowBase,names.o_preTreatmentDisposablesStack_preTreatmentDisposablesCartridgeConnetion_TreatmentFlowBase,names.o_PreTreatmentStack_preTreatmentDisposablesStack_PreTreatmentDisposablesStack,names.o_pretreatmentConnectionStack_PreTreatmentBase_TreatmentFlowBase,names.o_EndTreatmentRinsebackStack_EndTreatmentRinsebackInit_EndTreatmentRinsebackInit,names.o_PostTreatmentStack_patientDisconnectionConfirm_TreatmentFlowBase,names.o_PostTreatmentStack_disposablesRemovalConfirm_TreatmentFlowBase,names.o_EndTreatmentRecirculateStack_EndTreatmentBase_EndTreatmentBase,names.o_DisinfectStack_disinfect_TreatmentFlowBase] @@ -103,18 +104,9 @@ #to remove last empty character from the string if instruction_text[-1] == " ": instruction_text = instruction_text.rstrip() - image_source = waitForObjectExists(get_img_obj(text_obj_names[0],"{}{}".format(config.IMAGE_LOCATION, image_text))).source.path + image_status = waitForObjectExists(get_img_obj(text_obj_names[0],"{}{}".format(config.IMAGE_LOCATION,image_text))).status + test.compare(str(image_status),str(IMAGE_READY),image_text + " - image title is valid and loaded on UI.") test.compare(str(waitForObject(get_text_obj(text_obj_names[0],instruction_text)).text),instruction_text, "Instruction from " +title+ " screen is visible and matched") - #appends .png extension to image names,if not present - if not(str(image_source).endswith(".png")): - image_source = "{}{}".format(image_source,".png") - if not(str(image_text).endswith(".png")): - image_text = str(image_text) + ".png" - #to verify if image name mentioned in instructions.conf file is present at location - if image_text in image_list_from_location: - test.compare(str(image_source),"{}{}".format(config.EXPECTED_IMAGE_LOCATION, image_text), "Image from " +title+ " screen is visible and matched") - else: - test.fail(image_text+" is not present at "+config.EXPECTED_IMAGE_LOCATION) if object.exists(names.o_next_button_ws): mouseClick(waitForObject(names.o_next_button)) if object.exists(names.o_fail_button_ws):