def read_received_message_with_phonenumber(self,src_number,except_msg=''): """ open the messaging app """ self.__open_messaging_app() """ open the new message with source phone number """ self.a.log.info_log(self.__tag,'open the new message with source phone number') res = self.a.inputer.get(ObjectIDDict.CONVERSATION_LISTITEM,'Name',0,ObjectIDDict.CONVERSATION_LISTVIEW,'-1') if(self.a.log.analysis_receive_msg_log_level(self.__tag,res)!=Constant.LOG_LEVEL_SUCCESS): return False self.a.log.info_log(self.__tag,'select the conversation with source phone number') index = Utility.search_key_of_value_part_match(res['PropertyDict'],src_number,'\r\n',0,'+86') if(index==-1): return False res = self.a.inputer.click(ObjectIDDict.CONVERSATION_LISTITEM,0,ObjectIDDict.CONVERSATION_LISTVIEW,str(index)) if(self.a.log.analysis_receive_msg_log_level(self.__tag,res)!=Constant.LOG_LEVEL_SUCCESS): return False if(not self.a.validate.validate_object_for_next_step(ObjectIDDict.MESSAGE_LIST_ITEM,2,'message list')): return False """ check the nearest message in source phone number """ res = self.a.inputer.get(ObjectIDDict.MESSAGE_LIST_ITEM,'Name',0,ObjectIDDict.MESSAGE_LIST) if(self.a.log.analysis_receive_msg_log_level(self.__tag,res)!=Constant.LOG_LEVEL_SUCCESS): return False msg_content = Utility.get_str_with_index(res['Property'],'\r\n',1) #print msg_content if(not self.a.validate.validate_string(msg_content,except_msg)): return False """ back to the main page """ self.a.log.info_log(self.__tag,'back to the main page') res = self.a.inputer.hard('start',1) if(self.a.log.analysis_receive_msg_log_level(self.__tag,res)!=Constant.LOG_LEVEL_SUCCESS): return False if(not self.a.validate.validate_object_for_next_step(ObjectIDDict.MESSAGINGAPP_BUTTON,2,'message app')): return False return True
def call_from_contacts(self,name): """ open the phone call app """ if(not self.__open_call_app()): return False """ change to history """ self.a.log.info_log(self.__tag,'change to history') res = self.a.inputer.scrollh(ObjectIDDict.CALL_PHONEPIVOT,'0',0) self.a.log.analysis_receive_msg_log_level(self.__tag,res) #time.sleep(0.5) if(not self.a.validate.validate_object_for_next_step(ObjectIDDict.CALL_HISTORY_LIST,2,'call history list')): return False res = self.a.inputer.click(ObjectIDDict.CONTACT_PHONEBOOK,0) self.a.log.analysis_receive_msg_log_level(self.__tag,res) if(not self.a.validate.validate_object_for_next_step(ObjectIDDict.PEOPLEPICKERPAGE,2,'call history list')): return False res = self.a.inputer.get(ObjectIDDict.CONTACT_LISTITEM,'Name',0,ObjectIDDict.CONTACT_LIST,'-1') if(self.a.log.analysis_receive_msg_log_level(self.__tag,res)!=Constant.LOG_LEVEL_SUCCESS): return False index = Utility.search_key_of_value_part_match(res['PropertyDict'],name,'\r\n',0,'') if(index==-1): return False res = self.a.inputer.click(ObjectIDDict.CONTACT_LISTITEM,0,ObjectIDDict.CONTACT_LIST,str(index)) return True pass