Best Python code snippet using localstack_python
a09_housekeeper.py
Source:a09_housekeeper.py
...32 return self.wait_ac(excel.activity_con('housekeeper_activity'))33 # 管家-æç管家页é¢ï¼æ²¡æä»»å¡æ
åµï¼æ示ï¼è¿æ²¡æå建管家任å¡ï¼ç¹å»å³ä¸è§â+âå建(å®é
æBUG)34 def no_housekeeper(self):35 self.mine_housekeeper() # æç管家页é¢ï¼å é¤ææ管家任å¡36 return self.find_item('è¿æ²¡æå建管家任å¡ï¼ç¹å»å³ä¸è§â+âå建')37 # 管家-æç管家页é¢ï¼ç¹å»å³ä¸è§â+âï¼å¼¹åºå建管家任å¡ç¼è¾æ¡38 def add_housekeeper(self):39 self.mine_housekeeper() # æç管家页é¢ï¼å é¤ææ管家任å¡40 self.find_xpath(excel.xpath_con('housekeeper_add')).click() # ç¹å»å³ä¸+æé®41 time.sleep(1)42 return self.find_item('å建管家任å¡')43 # 管家-æç管家页é¢ï¼ç¹å»å³ä¸è§â+âï¼å¼¹åºå建管家任å¡ç¼è¾æ¡ï¼ç¹å»å³ä¸âxâï¼ç¼è¾æ¡æ¶å¤±44 def add_housekeeper_x(self):45 self.add_housekeeper() # å建管家任å¡ç¼è¾æ¡é¡µé¢46 self.find_xpath(excel.xpath_con('create_housekeeeper_x')).click() # ç¹å»å³ä¸Xæé®47 time.sleep(1)48 return self.find_item('å建管家任å¡')49 # 管家-å建管家任å¡ç¼è¾æ¡ï¼ç¹å»å®æ¶ä»»å¡ï¼è¿å
¥å®æ¶ä»»å¡ç¼è¾é¡µé¢ï¼æ¥æ¾ï¼å½æ¶é´å°è¾¾-------------------------------------------------50 def timing_editpage(self):51 self.add_housekeeper() # å建管家任å¡ç¼è¾æ¡é¡µé¢52 self.find_xpath(excel.xpath_con('create_housekeeeper_timing')).click() # ç¹å»å®æ¶ä»»å¡53 time.sleep(1)54 return self.find_item('å½æ¶é´å°è¾¾')55 # 管家-å®æ¶ä»»å¡ç¼è¾é¡µé¢ï¼ç¹å»å称ï¼å¼¹åºå称弹çª56 def timing_name(self):57 self.timing_editpage() # å®æ¶ä»»å¡ç¼è¾é¡µé¢58 self.find_xpath(excel.xpath_con('timing_name')).click() # ç¹å»å称59 time.sleep(1)60 return self.is_element('xpath', excel.xpath_con('timing_name_search')) # éªè¯æ¯å¦æå称弹çª61 # 管家-å®æ¶ä»»å¡ç¼è¾-å称弹çªï¼è¾å
¥å称åµåµ123ï¼ç¹å»ç¡®å®ï¼å¼¹çªæ¶å¤±ï¼å称æ¾ç¤ºä¸ºï¼åµåµ12362 def timing_name_sure(self):63 self.timing_name() # å®æ¶ä»»å¡ï¼å称弹çª64 self.find_xpath(excel.xpath_con('renameInput')).send_keys(u'åµåµ123') # å称è¾å
¥æ¡è¾å
¥æ°å称 åµåµ12365 time.sleep(1)66 self.find_xpath(excel.xpath_con('customScene_sure')).click() # ç¹å»ç¡®å®æé®67 time.sleep(1)68 return self.find_item('åµåµ123')69 # 管家-å®æ¶ä»»å¡ç¼è¾-å称弹çªï¼è¾å
¥å称åµåµ123ï¼ç¹å»åæ¶ï¼å¼¹çªæ¶å¤±ï¼å称æ¾ç¤ºæªå70 def timing_name_cancel(self):71 self.timing_name() # å®æ¶ä»»å¡ï¼å称弹çª72 self.find_xpath(excel.xpath_con('renameInput')).send_keys(u'åµåµ123') # å称è¾å
¥æ¡è¾å
¥æ°å称 åµåµ12373 time.sleep(1)74 self.find_xpath(excel.xpath_con('addDelay_cancel')).click() # ç¹å»åæ¶æé®75 time.sleep(1)76 return self.find_item('åµåµ123')77 # 管家-å®æ¶ä»»å¡ç¼è¾é¡µé¢ï¼ç¹å»æ¶é´ï¼è¿å
¥å®æ¶ç¼è¾é¡µé¢ï¼æ¥æ¾Sun78 def timing_time(self):79 self.timing_editpage() # å®æ¶ä»»å¡ç¼è¾é¡µé¢80 self.find_xpath(excel.xpath_con('timing_time')).click() # ç¹å»äºä»¶81 time.sleep(1)82 return self.find_item('Sun')83 # 管家-å®æ¶ç¼è¾é¡µé¢ï¼ç¹å»ä¿åï¼è·³è½¬å®æ¶ä»»å¡ç¼è¾é¡µé¢84 def timing_time_save(self):85 self.timing_time() # å®æ¶ä»»å¡ï¼å®æ¶ç¼è¾é¡µé¢86 self.find_xpath(excel.xpath_con('timeTask1_save')).click() # ç¹å»ä¿åæé®87 time.sleep(1)88 return self.find_item('å½æ¶é´å°è¾¾')89 # 管家-å®æ¶ä»»å¡ç¼è¾é¡µé¢ï¼ç¹å»æ§è¡ä»¥ä¸ä»»å¡ï¼è¿å
¥æ·»å ä»»å¡é¡µé¢ï¼æ¥æ¾æ·»å è¦æ§è¡ç设å¤90 def timetask_page(self):91 self.timing_name_sure() # å®æ¶ä»»å¡ç¼è¾é¡µé¢ï¼å·²è®¾ç½®å称为åµåµ12392 self.find_xpath(excel.xpath_con('timing_tasks')).click() # ç¹å»æ§è¡ä»¥ä¸ä»»å¡93 time.sleep(1)94 return self.find_item('æ·»å è¦æ§è¡ç设å¤')95 # 管家-æ·»å ä»»å¡é¡µé¢ï¼ç¹å»æ·»å è¦æ§è¡ç设å¤ï¼è¿å
¥éæ©è®¾å¤é¡µé¢96 def timetask_device_page(self):97 self.timetask_page() # æ·»å ä»»å¡é¡µé¢98 self.find_xpath(excel.xpath_con('circumstances_needdodevice')).click() # ç¹å»æ·»å è¦æ§è¡ç设å¤99 time.sleep(1)100 return self.find_item('éæ©è®¾å¤')101 # 管家-éæ©è®¾å¤é¡µé¢ï¼ç¹å»å
¨é¨ååºï¼ä¸ææ以ååºï¼æ¥æ¾å
ç´ å
¨é¨ååº102 def timetask_allzone(self):103 self.timetask_device_page() # å®æ¶ä»»å¡ï¼éæ©è®¾å¤é¡µé¢104 self.find_xpath(excel.xpath_con('device_list_allAreas')).click() # ç¹å»å
¨é¨ååº105 time.sleep(1)106 return self.is_element('xpath', excel.xpath_con('all_zone')) # 延æ¶æ¯å¦æå
¨é¨ååºå
ç´ 107 # 管家-éæ©è®¾å¤é¡µé¢ï¼ç¹å»å
¨é¨ç±»å«ï¼ä¸ææ以类å«ï¼æ¥æ¾æºè½é¨é108 def timetask_allclass(self):109 self.timetask_device_page() # å®æ¶ä»»å¡ï¼éæ©è®¾å¤é¡µé¢110 self.find_xpath(excel.xpath_con('device_list_Categories')).click() # ç¹å»å
¨é¨åç±»111 time.sleep(1)112 return self.find_item('æºè½é¨é')113 # 管家-éæ©è®¾å¤é¡µé¢ï¼ç¹å»æ¹éæ·»å ï¼è¿å
¥æ¹éæ·»å 页é¢ï¼æ¥æ¾å
¨é114 def timetask_alladd(self):115 self.timetask_device_page() # å®æ¶ä»»å¡ï¼éæ©è®¾å¤é¡µé¢116 self.find_xpath(excel.xpath_con('batchAdd')).click() # ç¹å»æ¹éæ·»å 117 time.sleep(1)118 return self.find_item('å
¨é')119 # 管家-æ·»å ä»»å¡é¡µé¢ï¼ç¹å»æ·»å è¦æ§è¡çåºæ¯ï¼è¿å
¥éæ©åºæ¯é¡µé¢120 def timetask_scene_page(self):121 self.timetask_page() # æ·»å ä»»å¡é¡µé¢122 self.find_xpath(excel.xpath_con('circumstances_needdoscene')).click() # ç¹å»æ·»å è¦æ§è¡çåºæ¯123 time.sleep(1)124 return self.find_item('éæ©åºæ¯')125 # 管家-æ·»å ä»»å¡é¡µé¢ï¼ç¹å»æ·»å è¦æ§è¡çåºæ¯ï¼è¿å
¥éæ©åºæ¯é¡µé¢ï¼ç¹å»å®æï¼toastæ示ï¼è¯·éæ©ä¸ä¸ªåºæ¯ï¼H5页é¢å®ä½ä¸äºtoast126 def timetask_scene_finish(self):127 self.timetask_scene_page() # éæ©åºæ¯é¡µé¢128 self.find_xpath(excel.xpath_con('finish_delay')).click() # ç¹å»å³ä¸å®ææé®129 return self.find_item('éæ©åºæ¯')130 # 管家-éæ©è®¾å¤é¡µé¢ï¼ç¹å»å¢é¢æ座ï¼è¿å
¥è®¾ç½®è®¾å¤ç¶æ页é¢131 def setting_device_status_page(self):132 self.timetask_device_page() # éæ©è®¾å¤é¡µé¢133 self.find_xpath(excel.xpath_con('socket_5')).click()134 time.sleep(1)135 return self.find_item('设置设å¤ç¶æ')136 # 管家-设置设å¤ç¶æ页é¢ï¼ç¹å»å¼ï¼è¿å
¥æ·»å 延æ¶ä»»å¡é¡µé¢137 def delay_task_page(self):138 self.setting_device_status_page() # 设置设å¤ç¶æ页é¢139 self.find_xpath(excel.xpath_con('socket_open')).click() # ç¹å»å¼140 time.sleep(1)141 return self.find_item('æ·»å 延æ¶')142 # 管家-æ·»å 延æ¶ä»»å¡é¡µé¢ï¼ç¹å»æå¼æ·»å 延æ¶æé®ï¼å¼¹åºå»¶æ¶æ¶é´ç¼è¾æ¡ï¼æ¥æ¾ç§143 def delay_task_tiemopen(self):144 self.delay_task_page() # æ·»å 延æ¶é¡µé¢145 self.find_xpath(excel.xpath_con('delay_close')).click() # ç¹å»æå¼æ·»å 延æ¶å¼å
³æé®146 time.sleep(1)147 return self.find_item('ç§')148 # 管家-æ·»å 延æ¶ä»»å¡é¡µé¢ï¼ç¹å»æå¼æ·»å 延æ¶æé®ï¼å次ç¹å»æé®ï¼å»¶æ¶æ¶é´ç¼è¾æ¡éèï¼æ¥æ¾ä¸å°ç§149 def delay_task_timeclose(self):150 self.delay_task_tiemopen() # æ·»å 延æ¶é¡µé¢ï¼å»¶æ¶å¼å
³æå¼ç¶æ151 self.find_xpath(excel.xpath_con('delay_open')).click() # ç¹å»å
³éæ·»å 延æ¶å¼å
³æé®152 time.sleep(1)153 return self.find_item('ç§')154 # 管家-æ·»å 延æ¶ä»»å¡é¡µé¢ï¼ç¹å»å®ææé®ï¼è·³è½¬å®æ¶ä»»å¡ç¼è¾é¡µé¢155 def delay_task_finish(self):156 self.delay_task_page() # æ·»å 延æ¶é¡µé¢157 self.find_xpath(excel.xpath_con('finish_delay')).click() # ç¹å»å®ææé®158 time.sleep(1)159 return self.find_item('å¢é¢æ座')160 # 管家-æ·»å 延æ¶ä»»å¡é¡µé¢ï¼å·¦åä»»å¡ï¼æåºå é¤æé®161 def task_leftswip(self):162 self.delay_task_finish() # æ·»å ä¸ä¸ªæ§è¡ä»»å¡163 self.leftswip_delaytask(2000) # å·¦åæ§è¡ä»»å¡164 return self.find_item('å é¤')165 # 管家-æ·»å 延æ¶ä»»å¡é¡µé¢ï¼å·¦åä»»å¡ï¼æåºå é¤æé®ï¼ç¹å»å é¤æé®ï¼ä»»å¡å é¤166 def task_delete(self):167 self.task_leftswip() # æ·»å æ§è¡ä»»å¡ï¼å·¦åæåºå é¤æé®168 time.sleep(1)169 self.find_xpath(excel.xpath_con('ediescene_delete')).click() # ç¹å»å é¤æé®170 time.sleep(1)171 return self.find_item('å¢é¢æ座')172 # 管家-æ·»å 延æ¶ä»»å¡é¡µé¢ï¼ç¹å»å®ææé®ï¼è·³è½¬å®æ¶ä»»å¡ç¼è¾é¡µé¢ï¼ç¹å»å·¦ä¸è¿åæé®ï¼å¼¹çªæ¯å¦æ¾å¼ç¼è¾å¼¹çª173 def giveup_edit(self):174 self.delay_task_finish() # æ·»å ä¸ä¸ªæ§è¡ä»»å¡175 self.find_xpath(excel.xpath_con('back')).click() # ç¹å»å·¦ä¸è¿åæé®176 time.sleep(1)177 return self.is_element('xpath', excel.xpath_con('giveup_edit')) # éªè¯æ¯å¦æå¼¹çª178 # 管家-æ·»å 延æ¶ä»»å¡é¡µé¢ï¼ç¹å»å®ææé®ï¼è·³è½¬å®æ¶ä»»å¡ç¼è¾é¡µé¢ï¼ç¹å»å·¦ä¸è¿åæé®ï¼å¼¹çªæ¯å¦æ¾å¼ç¼è¾å¼¹çªï¼ç¹å»åæ¶ï¼å¼¹çªæ¶å¤±179 def giveup_edit_cancel(self):180 self.delay_task_finish() # æ·»å ä¸ä¸ªæ§è¡ä»»å¡181 self.find_xpath(excel.xpath_con('back')).click() # ç¹å»å·¦ä¸è¿åæé®182 time.sleep(1)183 self.find_xpath(excel.xpath_con('giveup_edit_cancel')).click() # ç¹å»åæ¶æé®184 time.sleep(1)185 return self.is_element('xpath', excel.xpath_con('giveup_edit')) # éªè¯æ¯å¦æå¼¹çª186 # 管家-æ·»å 延æ¶ä»»å¡é¡µé¢ï¼ç¹å»å®ææé®ï¼è·³è½¬å®æ¶ä»»å¡ç¼è¾é¡µé¢ï¼ç¹å»å·¦ä¸è¿åæé®ï¼å¼¹çªæ¯å¦æ¾å¼ç¼è¾å¼¹çªï¼ç¹å»ç¡®å®ï¼è·³è½¬æç管家页é¢ï¼ä»»å¡æªä¿å187 def giveup_edit_sure(self):188 self.delay_task_finish() # æ·»å ä¸ä¸ªæ§è¡ä»»å¡189 self.find_xpath(excel.xpath_con('back')).click() # ç¹å»å·¦ä¸è¿åæé®190 time.sleep(1)191 self.find_xpath(excel.xpath_con('giveup_edit_sure')).click() # ç¹å»ç¡®å®æé®192 time.sleep(1)193 return self.find_item('åµåµ123') # 跳转æç管家页é¢ï¼ç®¡å®¶ä»»å¡æ²¡æä¿å194 # 管家-æ·»å 延æ¶ä»»å¡é¡µé¢ï¼ç¹å»å®ææé®ï¼è·³è½¬å®æ¶ä»»å¡ç¼è¾é¡µé¢ï¼ç¹å»ä¿åæé®ï¼è·³è½¬æç页é¢ï¼å®æ¶ä»»å¡ä¿åæåï¼æ¥æ¾åµåµ123195 def timed_task(self):196 self.delay_task_finish() # æ·»å ä¸ä¸ªæ§è¡ä»»å¡197 self.find_xpath(excel.xpath_con('timeTask1_save')).click() # ç¹å»å³ä¸ä¿åæé®198 time.sleep(2)199 return self.find_item('åµåµ123')200 # 管家-å®æ¶ä»»å¡ç¼è¾é¡µé¢ï¼ç¹å»ä¿åæé®ï¼å¼¹çªæ示ï¼æ§è¡ä»»å¡ä¸è½ä¸ºç©ºï¼è¯·æ·»å 201 def timed_notask(self):202 self.timing_editpage() # 管家å®æ¶ä»»å¡ç¼è¾é¡µé¢203 self.find_xpath(excel.xpath_con('timeTask1_save')).click() # ç¹å»å³ä¸ä¿åæé®204 time.sleep(1)205 return self.is_element('xpath', excel.xpath_con('task_not_empty')) # å¤ææ¯å¦æå¼¹çªè¿ä¸ªå
ç´ 206 # 管家-å®æ¶ä»»å¡ç¼è¾é¡µé¢ï¼ç¹å»ä¿åæé®ï¼å¼¹çªæ示ï¼æ§è¡ä»»å¡ä¸è½ä¸ºç©ºï¼è¯·æ·»å ï¼ç¹å»ç¡®å®æé®ï¼å¼¹çªæ¶å¤±207 def timed_notask_sure(self):208 self.timed_notask() # 管家-å®æ¶ä»»å¡-æ§è¡ä»»å¡ä¸è½ä¸ºç©ºå¼¹çª209 self.find_id(excel.id_con('dialog_btn_positive')).click() # ç¹å»ç¡®å®æé®210 time.sleep(1)211 return self.is_element('xpath', excel.xpath_con('task_not_empty')) # å¤ææ¯å¦æå¼¹çªè¿ä¸ªå
ç´ 212 # 管家-æ°å»ºä¸ä¸ªå®æ¶ä»»å¡ï¼ç¹å»ä»»å¡ï¼è¿å
¥å®æ¶ä»»å¡ç¼è¾é¡µé¢213 def click_timedtask(self):214 self.timed_task() # å建ä¸ä¸ªå®æ¶ä»»å¡215 self.find_xpath(excel.xpath_con('housekeeper_list')).click() # ç¹å»ç¬¬ä¸ä¸ªç®¡å®¶216 time.sleep(2)217 return self.find_item('å½æ¶é´å°è¾¾')218 # 管家-æ°å»ºä¸ä¸ªå®æ¶ä»»å¡ï¼å·¦åä»»å¡ï¼æåºç¼è¾æé®219 def swip_timedtask(self):220 self.timed_task() # å建ä¸ä¸ªå®æ¶ä»»å¡221 self.leftswip_housekeeper(2000) # å·¦å第ä¸ä¸ªç®¡å®¶ä»»å¡222 return self.find_item('ç¼è¾')223 # 管家-æ°å»ºä¸ä¸ªå®æ¶ä»»å¡ï¼å·¦åä»»å¡ï¼æåºç¼è¾æé®ï¼ç¹å»ç¼è¾æé®ï¼è¿å
¥å®æ¶ä»»å¡ç¼è¾é¡µé¢224 def swip_timedtask_edit(self):225 self.swip_timedtask() # å·¦å管家任å¡ï¼æåºç¼è¾æé®226 time.sleep(1)227 self.find_xpath(excel.xpath_con('housekeeper_edit')).click() # ç¹å»ç¼è¾æé®228 time.sleep(2)229 return self.find_item('å½æ¶é´å°è¾¾')230 # 管家-æ°å»ºä¸ä¸ªå®æ¶ä»»å¡ï¼å·¦åä»»å¡ï¼æåºå é¤æé®231 def swip_timedtask_delete(self):232 self.timed_task() # å建ä¸ä¸ªå®æ¶ä»»å¡233 self.leftswip_housekeeper(2000) # å·¦å第ä¸ä¸ªç®¡å®¶ä»»å¡234 return self.find_item('å é¤')235 # 管家-æ°å»ºä¸ä¸ªå®æ¶ä»»å¡ï¼å·¦åä»»å¡ï¼æåºå é¤æé®ï¼ç¹å»å é¤æé®ï¼ä»»å¡è¢«å é¤236 def swip_timedtask_deletesure(self):237 self.swip_timedtask_delete() # å·¦åä»»å¡ï¼æåºå é¤æé®238 time.sleep(1)239 self.find_xpath(excel.xpath_con('housekeeper_delete')).click() # ç¹å»å é¤æé®240 time.sleep(2)241 return self.find_item('åµåµ123')242 # 管家-å建管家任å¡ç¼è¾æ¡ï¼ç¹å»æ
æ¯ä»»å¡ï¼è¿å
¥æ
æ¯ä»»å¡ç¼è¾é¡µé¢-----------------------------------------------------------------243 def scenetask_page(self):244 self.add_housekeeper() # å建管家任å¡ç¼è¾æ¡é¡µé¢245 self.find_xpath(excel.xpath_con('create_housekeeeper_scene')).click() # ç¹å»æ
æ¯ä»»å¡246 time.sleep(1)247 return self.find_item('满足任ä¸æ¡ä»¶æ¶')248 # 管家-æ
æ¯ä»»å¡ç¼è¾é¡µé¢ï¼ç¹å»å称ï¼å¼¹åºå称弹çª249 def scenetask_name(self):250 self.scenetask_page() # æ
æ¯ä»»å¡ç¼è¾é¡µé¢251 self.find_xpath(excel.xpath_con('timing_name')).click() # ç¹å»å称252 time.sleep(1)253 return self.is_element('xpath', excel.xpath_con('timing_name_search')) # éªè¯æ¯å¦æå称弹çª254 # 管家-æ
æ¯ä»»å¡ç¼è¾-å称弹çªï¼è¾å
¥å称åå123ï¼ç¹å»ç¡®å®ï¼å¼¹çªæ¶å¤±ï¼å称æ¾ç¤ºä¸ºï¼åå123255 def scenetask_namesure(self):256 self.scenetask_name() # æ
æ¯ä»»å¡ç¼è¾é¡µé¢ï¼å称弹çª257 self.find_xpath(excel.xpath_con('renameInput')).send_keys(u'åå123') # è¾å
¥å称åå123258 time.sleep(1)259 self.find_xpath(excel.xpath_con('giveup_edit_sure')).click() # ç¹å»ç¡®å®æé®260 time.sleep(1)261 return self.find_item('åå123')262 # 管家-æ
æ¯ä»»å¡ç¼è¾-å称弹çªï¼è¾å
¥å称åå123ï¼ç¹å»åæ¶ï¼å¼¹çªæ¶å¤±ï¼å称æ¾ç¤ºæªå263 def scenetask_namecancel(self):264 self.scenetask_name() # æ
æ¯ä»»å¡ç¼è¾é¡µé¢ï¼å称弹çª265 self.find_xpath(excel.xpath_con('renameInput')).send_keys(u'åå123') # è¾å
¥å称åå123266 time.sleep(1)267 self.find_xpath(excel.xpath_con('giveup_edit_cancel')).click() # ç¹å»åæ¶æé®268 time.sleep(1)269 return self.find_item('åå123')270 # 管家-æ
æ¯ä»»å¡ç¼è¾ï¼ç¹å»æ»¡è¶³ä»»ä¸æ¡ä»¶æ¶ï¼è¿å
¥éæ©è®¾å¤é¡µé¢271 def condition_page(self):272 self.scenetask_page() # æ
æ¯ä»»å¡ç¼è¾é¡µé¢273 self.find_xpath(excel.xpath_con('scenetask_condition')).click() # ç¹å»æ»¡è¶³ä»»ä¸æ¡ä»¶æ¶274 time.sleep(1)275 return self.find_item('å
¨é¨ååº')276 # 管家-æ¡ä»¶ä»»å¡-éæ©è®¾å¤é¡µé¢ï¼ç¹å»å
¨é¨ååºï¼ä¸ææ以ååºï¼æ¥æ¾å
ç´ å
¨é¨ååº277 def conditionpage_zone(self):278 self.condition_page() # æ
æ¯ä»»å¡-æ¡ä»¶ä»»å¡ï¼éæ©è®¾å¤é¡µé¢279 self.find_xpath(excel.xpath_con('device_list_allAreas')).click() # ç¹å»å
¨é¨ååº280 time.sleep(1)281 return self.is_element('xpath', excel.xpath_con('all_zone')) # éªè¯æ¯å¦åå¨å
ç´ å
¨é¨ååº282 # 管家-æ¡ä»¶ä»»å¡-éæ©è®¾å¤é¡µé¢ï¼ç¹å»å
¨é¨ç±»å«ï¼ä¸ææ以类å«ï¼æ¥æ¾æºè½é¨é283 def conditionpage_category(self):284 self.condition_page() # æ
æ¯ä»»å¡-æ¡ä»¶ä»»å¡ï¼éæ©è®¾å¤é¡µé¢285 self.find_xpath(excel.xpath_con('device_list_Categories')).click() # ç¹å»å
¨é¨åç±»286 time.sleep(1)287 return self.find_item('æºè½é¨é')288 # 管家-æ¡ä»¶ä»»å¡-éæ©è®¾å¤é¡µé¢ï¼ç¹å»é¨çªç£æ¢æµå¨ï¼è¿å
¥è®¾ç½®è®¾å¤ç¶æ页é¢289 def condition_mannetic_page(self):290 self.condition_page() # æ
æ¯ä»»å¡-æ¡ä»¶ä»»å¡ï¼éæ©è®¾å¤é¡µé¢291 self.find_xpath(excel.xpath_con('magnetic_4')).click() # ç¹å»é¨çªç£æ¢æµå¨292 time.sleep(1)293 return self.find_item('设置设å¤ç¶æ')294 # 管家-æ¡ä»¶ä»»å¡-设置设å¤ç¶æ页é¢ï¼ç¹å»è¢«æå¼ï¼è·³è½¬æ
æ¯ä»»å¡ç¼è¾é¡µé¢ï¼æ¥æ¾é¨çªç£æ¢æµå¨295 def condition_magnetic_open(self):296 self.condition_mannetic_page() # 管家-æ¡ä»¶ä»»å¡-é¨ç£è®¾ç½®è®¾å¤ç¶æ页é¢297 self.find_xpath(excel.xpath_con('magnetic_open')).click() # ç¹å»è¢«æå¼298 time.sleep(1)299 return self.find_item('é¨çªç£æ¢æµå¨')300 # 管家-æ¡ä»¶ä»»å¡-设置设å¤ç¶æ页é¢ï¼ç¹å»è¢«å
³éï¼è·³è½¬æ
æ¯ä»»å¡ç¼è¾é¡µé¢ï¼æ¥æ¾é¨çªç£æ¢æµå¨301 def condition_magnetic_close(self):302 self.condition_mannetic_page() # 管家-æ¡ä»¶ä»»å¡-é¨ç£è®¾ç½®è®¾å¤ç¶æ页é¢303 self.find_xpath(excel.xpath_con('magnetic_close')).click() # ç¹å»è¢«å
³é304 time.sleep(1)305 return self.find_item('é¨çªç£æ¢æµå¨')306 # 管家-æ¡ä»¶ä»»å¡æå-æ
æ¯ä»»å¡ç¼è¾é¡µé¢ï¼å·¦åä»»å¡ï¼æåºå é¤æé®ï¼æ¥æ¾å é¤307 def condition_swip(self):308 self.condition_magnetic_open() # å建ä¸ä¸ªæ¡ä»¶ä»»å¡309 self.leftswip_condition(2000) # å·¦åæ¡ä»¶ä»»å¡310 time.sleep(1)311 return self.find_item('å é¤')312 # 管家-æ¡ä»¶ä»»å¡æå-æ
æ¯ä»»å¡ç¼è¾é¡µé¢ï¼å·¦åä»»å¡ï¼æåºå é¤æé®ï¼æ¥æ¾å é¤ï¼ç¹å»å é¤ï¼ä»»å¡å é¤æåï¼æ¥æ¾ä¸å°é¨çªç£æ¢æµå¨313 def condition_swip_delete(self):314 self.condition_swip() # å·¦åæ¡ä»¶ä»»å¡æåºå é¤æé®315 self.find_xpath(excel.xpath_con('ediescene_delete')).click() # ç¹å»å é¤æé®316 time.sleep(1)317 return self.find_item('é¨çªç£æ¢æµå¨')318 # 管家-æ
æ¯ä»»å¡ç¼è¾ï¼ç¹å»æ§è¡ä»¥ä¸ä»»å¡ï¼æ
æ¯ä»»å¡é¡µé¢ï¼æ¥æ¾æ·»å è¦æ§è¡ç设å¤319 def implement_page(self):320 self.scenetask_page() # æ
æ¯ä»»å¡ç¼è¾é¡µé¢321 self.find_xpath(excel.xpath_con('scenetask_task')).click() # ç¹å»æ§è¡ä»¥ä¸ä»»å¡322 time.sleep(1)323 return self.find_item('æ·»å è¦æ§è¡ç设å¤')324 # 管家-æ§è¡ä»»å¡-æ
æ¯ä»»å¡é¡µé¢ï¼ç¹å»æ·»å è¦æ§è¡ç设å¤ï¼è¿å
¥éæ©è®¾å¤é¡µé¢325 def implement_devicepage(self):326 self.implement_page() # æ§è¡ä»»å¡-æ
æ¯ä»»å¡é¡µé¢327 self.find_xpath(excel.xpath_con('circumstances_needdodevice')).click() # ç¹å»æ·»å è¦æ§è¡ç设å¤328 time.sleep(1)329 return self.find_item('éæ©è®¾å¤')330 # 管家-æ§è¡ä»»å¡-æ
æ¯ä»»å¡é¡µé¢ï¼ç¹å»æ·»å è¦æ§è¡çåºæ¯ï¼è¿å
¥éæ©åºæ¯é¡µé¢331 def implement_scenepage(self):332 self.implement_page() # æ§è¡ä»»å¡-æ
æ¯ä»»å¡é¡µé¢333 self.find_xpath(excel.xpath_con('circumstances_needdoscene')).click() # ç¹å»æ·»å è¦æ§è¡çåºæ¯334 time.sleep(1)335 return self.find_item('éæ©åºæ¯')336 # 管家-æ§è¡ä»»å¡-æ
æ¯ä»»å¡é¡µé¢ï¼ç¹å»æ·»å è¦æ§è¡çåºæ¯ï¼è¿å
¥éæ©åºæ¯é¡µé¢ï¼ç¹å»å®æï¼toastæ示ï¼è¯·éæ©ä¸ä¸ªåºæ¯337 def implement_scenepage_finish(self):338 self.implement_scenepage() # æ
æ¯ä»»å¡-éæ©åºæ¯ï¼åºæ¯éæ©é¡µé¢339 self.find_xpath(excel.xpath_con('finishState')).click() # ç¹å»å®ææé®340 time.sleep(1)341 return self.find_item('éæ©åºæ¯')342 # 管家-æ§è¡ä»»å¡-éæ©è®¾å¤é¡µé¢ï¼ç¹å»å
¨é¨ååºï¼ä¸ææ以ååºï¼æ¥æ¾å
ç´ å
¨é¨ååº343 def implement_device_zone(self):344 self.implement_devicepage() # æ§è¡ä»»å¡-éæ©è®¾å¤é¡µé¢345 self.find_xpath(excel.xpath_con('device_list_allAreas')).click() # ç¹å»å
¨é¨ååº346 time.sleep(1)347 return self.is_element('xpath', excel.xpath_con('all_zone')) # éªè¯æ¯å¦åå¨å
ç´ å
¨é¨ååº348 # 管家-æ§è¡ä»»å¡-éæ©è®¾å¤é¡µé¢ï¼ç¹å»å
¨é¨ç±»å«ï¼ä¸ææ以类å«ï¼æ¥æ¾æºè½é¨é349 def implement_device_categroy(self):350 self.implement_devicepage() # æ§è¡ä»»å¡-éæ©è®¾å¤é¡µé¢351 self.find_xpath(excel.xpath_con('device_list_Categories')).click() # ç¹å»å
¨é¨åç±»352 time.sleep(1)353 return self.find_item('æºè½é¨é')354 # 管家-æ§è¡ä»»å¡-éæ©è®¾å¤é¡µé¢ï¼ç¹å»æ¹éæ·»å ï¼è¿å
¥æ¹éæ·»å 页é¢ï¼æ¥æ¾å
¨é355 def implement_device_add(self):356 self.implement_devicepage() # æ§è¡ä»»å¡-éæ©è®¾å¤é¡µé¢357 self.find_xpath(excel.xpath_con('batchAdd')).click() # ç¹å»æ¹éæ·»å 358 time.sleep(1)359 return self.find_item('å
¨é')360 # 管家-æ§è¡ä»»å¡-éæ©è®¾å¤é¡µé¢ï¼ç¹å»å¢é¢æ座ï¼è¿å
¥è®¾ç½®è®¾å¤ç¶æ页é¢361 def implement_socket_setting(self):362 self.implement_devicepage() # æ§è¡ä»»å¡-éæ©è®¾å¤é¡µé¢363 self.find_xpath(excel.xpath_con('socket_5')).click() # ç¹å»å¢é¢æ座364 time.sleep(1)365 return self.find_item('设置设å¤ç¶æ')366 # 管家-æ§è¡ä»»å¡-设置设å¤ç¶æ页é¢ï¼ç¹å»å¼ï¼è·³è½¬æ·»å 延æ¶é¡µé¢367 def implement_socket_open(self):368 self.implement_socket_setting() # æ
æ¯ä»»å¡-æ§è¡ä»»å¡ï¼å¢é¢æ座设置设å¤ç¶æ页é¢369 self.find_xpath(excel.xpath_con('socket_open')).click() # ç¹å»å¢é¢æ座å¼370 time.sleep(1)371 return self.find_item('æ·»å 延æ¶')372 # 管家-æ§è¡ä»»å¡-设置设å¤ç¶æ页é¢ï¼ç¹å»å
³ï¼è·³è½¬æ·»å 延æ¶é¡µé¢373 def implement_socket_close(self):374 self.implement_socket_setting() # æ
æ¯ä»»å¡-æ§è¡ä»»å¡ï¼å¢é¢æ座设置设å¤ç¶æ页é¢375 self.find_xpath(excel.xpath_con('socket_close')).click() # ç¹å»å¢é¢æ座å
³376 time.sleep(1)377 return self.find_item('æ·»å 延æ¶')378 # 管家-æ§è¡ä»»å¡-æ·»å 延æ¶é¡µé¢ï¼ç¹å»æ·»å 延æ¶å¼å
³æé®ï¼å¼¹åºå»¶æ¶æ¶é´ç¼è¾æ¡ï¼æ¥æ¾ç§379 def implement_time_open(self):380 self.implement_socket_open() # æ
æ¯ä»»å¡-æ§è¡ä»»å¡ï¼æ·»å 延æ¶é¡µé¢381 self.find_xpath(excel.xpath_con('delay_close')).click() # ç¹å»æå¼å»¶æ¶å¼å
³382 time.sleep(1)383 return self.find_item('ç§')384 # 管家-æ§è¡ä»»å¡-æ·»å 延æ¶é¡µé¢ï¼ç¹å»æ·»å 延æ¶å¼å
³æé®ï¼å¼¹åºå»¶æ¶æ¶é´ç¼è¾æ¡ï¼å次ç¹å»å¼å
³æé®ï¼å»¶æ¶æ¶é´ç¼è¾æ¡éèï¼æ¥æ¾ä¸å°ç§385 def implement_time_close(self):386 self.implement_time_open() # æå¼å»¶æ¶æé®387 self.find_xpath(excel.xpath_con('delay_open')).click() # ç¹å»å
³é延æ¶å¼å
³388 time.sleep(1)389 return self.find_item('ç§')390 # 管家-æ§è¡ä»»å¡-æ·»å 延æ¶é¡µé¢ï¼ç¹å»å®ææé®ï¼è·³è½¬æ
æ¯ä»»å¡ç¼è¾é¡µé¢ï¼æ¥æ¾å¢é¢æ座391 def implement_finish(self):392 self.implement_socket_open() # æ
æ¯ä»»å¡-æ§è¡ä»»å¡ï¼æ·»å 延æ¶é¡µé¢393 self.find_xpath(excel.xpath_con('finish_delay')).click() # ç¹å»å®ææé®394 time.sleep(1)395 return self.find_item('å¢é¢æ座')396 # 管家-已设置任å¡ï¼ç¹å»æ§è¡ä»»å¡ï¼è¿å
¥è®¾ç½®è®¾å¤ç¶æ页é¢397 def implement_click_firsttask(self):398 self.implement_finish() # æ°å»ºä¸ä¸ªæ§è¡ä»»å¡399 self.find_xpath(excel.xpath_con('implement_1')).click() # ç¹å»ç¬¬ä¸ä¸ªæ§è¡ä»»å¡400 time.sleep(1)401 return self.find_item('设置设å¤ç¶æ')402 # 管家-已设置任å¡ï¼å·¦åæ§è¡ä»»å¡ï¼æåºå é¤æé®ï¼æ¥æ¾å é¤403 def implement_swip(self):404 self.implement_finish() # æ°å»ºä¸ä¸ªæ§è¡ä»»å¡405 self.leftswip_implement(2000) # å·¦åä»»å¡406 time.sleep(1)407 return self.find_item('å é¤')408 # 管家-已设置任å¡ï¼å·¦åæ§è¡ä»»å¡ï¼æåºå é¤æé®ï¼ç¹å»å é¤æé®ï¼ä»»å¡è¢«å é¤ï¼æ¥æ¾å¢é¢æ座409 def implement_swip_delete(self):410 self.implement_swip() # å·¦åä»»å¡ï¼æåºå é¤æé®411 self.find_xpath(excel.xpath_con('ediescene_delete')).click() # ç¹å»å é¤æé®412 time.sleep(1)413 return self.find_item('å¢é¢æ座')414 # 管家-æ
æ¯ä»»å¡ç¼è¾é¡µé¢ï¼ç¹å»ä¿åæé®ï¼å¼¹çªæ示ï¼æ§è¡æ¡ä»¶æè
æ§è¡ä»»å¡ä¸è½ä¸ºç©ºï¼è¯·æ·»å 415 def condition_implement_allnone(self):416 self.scenetask_page() # æ
æ¯ä»»å¡ç¼è¾é¡µé¢417 self.find_xpath(excel.xpath_con('circumstances_save')).click() # ç¹å»ä¿åæé®418 time.sleep(1)419 return self.is_element('xpath', excel.xpath_con('task_not_empty')) # éªè¯å¼¹çªå
ç´ æ¯å¦åå¨420 # 管家-æ
æ¯ä»»å¡ç¼è¾é¡µé¢ï¼ç¹å»ä¿åæé®ï¼å¼¹çªæ示ï¼æ§è¡æ¡ä»¶æè
æ§è¡ä»»å¡ä¸è½ä¸ºç©ºï¼è¯·æ·»å ï¼ç¹å»ç¡®å®æé®ï¼å¼¹çªæ¶å¤±421 def condition_implement_allnone_sure(self):422 self.condition_implement_allnone() # æ§è¡æ¡ä»¶æè
æ§è¡ä»»å¡ä¸è½ä¸ºç©ºå¼¹çª423 self.find_id(excel.id_con('dialog_btn_positive')).click() # ç¹å»ç¡®å®æé®424 time.sleep(1)425 return self.is_element('xpath', excel.xpath_con('task_not_empty')) # éªè¯å¼¹çªå
ç´ æ¯å¦åå¨426 # 管家-æ
æ¯ä»»å¡ç¼è¾é¡µé¢-已设置æ§è¡æ¡ä»¶ï¼ç¹å»ä¿åæé®ï¼å¼¹çªæ示ï¼æ§è¡æ¡ä»¶æè
æ§è¡ä»»å¡ä¸è½ä¸ºç©ºï¼è¯·æ·»å 427 def implement_none(self):428 self.condition_magnetic_open() # å建ä¸ä¸ªæ¡ä»¶ä»»å¡429 self.find_xpath(excel.xpath_con('circumstances_save')).click() # ç¹å»ä¿åæé®430 time.sleep(1)431 return self.is_element('xpath', excel.xpath_con('task_not_empty')) # éªè¯å¼¹çªå
ç´ æ¯å¦åå¨432 # 管家-æ
æ¯ä»»å¡ç¼è¾é¡µé¢-已设置æ§è¡ä»»å¡ï¼ç¹å»ä¿åæé®ï¼å¼¹çªæ示ï¼æ§è¡æ¡ä»¶æè
æ§è¡ä»»å¡ä¸è½ä¸ºç©ºï¼è¯·æ·»å 433 def condition_none(self):434 self.implement_finish() # æ°å»ºä¸ä¸ªæ§è¡ä»»å¡435 self.find_xpath(excel.xpath_con('circumstances_save')).click() # ç¹å»ä¿åæé®436 time.sleep(1)437 return self.is_element('xpath', excel.xpath_con('task_not_empty')) # éªè¯å¼¹çªå
ç´ æ¯å¦åå¨438 # 管家-已设置å称-已设置æ§è¡æ¡ä»¶-已设置æ§è¡ä»»å¡ï¼ç¹å»ä¿åï¼è·³è½¬æç管家页é¢ï¼æ¥æ¾ç¬¬ä¸ä¸ªç®¡å®¶ä»»å¡å
ç´ 439 def scenetask_creat(self):440 self.scenetask_namesure() # 设置æ
æ¯ä»»å¡å称441 self.find_xpath(excel.xpath_con('scenetask_condition')).click() # ç¹å»æ»¡è¶³ä»»ä¸æ¡ä»¶æ¶442 time.sleep(1)443 self.find_xpath(excel.xpath_con('magnetic_4')).click() # ç¹å»é¨çªç£æ¢æµå¨444 time.sleep(1)445 self.find_xpath(excel.xpath_con('magnetic_open')).click() # ç¹å»è¢«æå¼446 time.sleep(1)447 self.find_xpath(excel.xpath_con('scenetask_task')).click() # ç¹å»æ§è¡ä»¥ä¸ä»»å¡448 time.sleep(1)449 self.find_xpath(excel.xpath_con('circumstances_needdodevice')).click() # ç¹å»æ·»å è¦æ§è¡ç设å¤450 time.sleep(1)451 self.find_xpath(excel.xpath_con('socket_5')).click() # ç¹å»å¢é¢æ座452 time.sleep(1)453 self.find_xpath(excel.xpath_con('socket_open')).click() # ç¹å»å¢é¢æ座å¼454 time.sleep(1)455 self.find_xpath(excel.xpath_con('finish_delay')).click() # ç¹å»å®ææé®456 time.sleep(1)457 self.find_xpath(excel.xpath_con('circumstances_save')).click() # ç¹å»ä¿åæé®458 time.sleep(1)459 return self.is_element('xpath', excel.xpath_con('housekeeper_list')) # éªè¯å
ç´ æ¯å¦åå¨460 # 管家-已设置æ§è¡ä»»å¡ï¼ç¹å»å·¦ä¸è¿åæé®ï¼å¼¹çªæ示ï¼æ¯å¦æ¾å¼ç¼è¾461 def giveup_edit2(self):462 self.implement_finish() # æ°å»ºä¸ä¸ªæ§è¡ä»»å¡463 self.find_xpath(excel.xpath_con('back')).click() # ç¹å»å·¦ä¸è¿åæé®464 time.sleep(1)465 return self.is_element('xpath', excel.xpath_con('giveup_edit')) # éªè¯æ¯å¦æå¼¹çª466 # 管家-已设置æ§è¡ä»»å¡ï¼ç¹å»å·¦ä¸è¿åæé®ï¼å¼¹çªæ示ï¼æ¯å¦æ¾å¼ç¼è¾ï¼ç¹å»åæ¶ï¼å¼¹çªæ¶å¤±467 def giveup_edit2_cancel(self):468 self.implement_finish() # æ°å»ºä¸ä¸ªæ§è¡ä»»å¡469 self.find_xpath(excel.xpath_con('back')).click() # ç¹å»å·¦ä¸è¿åæé®470 time.sleep(1)471 self.find_xpath(excel.xpath_con('giveup_edit_cancel')).click() # ç¹å»åæ¶æé®472 time.sleep(1)473 return self.is_element('xpath', excel.xpath_con('giveup_edit')) # éªè¯æ¯å¦æå¼¹çª474 # 管家-已设置æ§è¡ä»»å¡ï¼ç¹å»å·¦ä¸è¿åæé®ï¼å¼¹çªæ示ï¼æ¯å¦æ¾å¼ç¼è¾ï¼ç¹å»ç¡®å®ï¼è·³è½¬æç管家页é¢ï¼ä»»å¡æªä¿å475 def giveup_edit2_sure(self):476 self.implement_finish() # æ°å»ºä¸ä¸ªæ§è¡ä»»å¡477 self.find_xpath(excel.xpath_con('back')).click() # ç¹å»å·¦ä¸è¿åæé®478 time.sleep(1)479 self.find_xpath(excel.xpath_con('giveup_edit_sure')).click() # ç¹å»ç¡®å®æé®480 time.sleep(1)481 return self.is_element('xpath', excel.xpath_con('housekeeper_list')) # éªè¯æç管家页é¢ç®¡å®¶ä»»å¡å
ç´ æ¯å¦åå¨482 # 管家-æ
æ¯ä»»å¡ç¼è¾é¡µé¢ï¼ç¹å»çææ¡ä»¶ï¼è¿å
¥çææ¡ä»¶é¡µé¢,æ¥æ¾ï¼çææ¶é´æ¡ä»¶483 def precondition_page(self):484 self.scenetask_page() # æ
æ¯ä»»å¡ç¼è¾é¡µé¢485 self.find_xpath(excel.xpath_con('conditionAdd')).click() # ç¹å»çææ¡ä»¶486 time.sleep(1)487 return self.find_item('çææ¶é´æ¡ä»¶')488 # 管家-çææ¡ä»¶é¡µé¢ï¼ç¹å»çææ¶é´æ¡ä»¶ï¼è¿å
¥çææ¶æ®µé¡µé¢489 def precondition_time(self):490 self.precondition_page() # çææ¡ä»¶é¡µé¢491 self.find_xpath(excel.xpath_con('time_factor')).click() # ç¹å»çææ¶é´æ¡ä»¶492 time.sleep(1)493 return self.find_item('çææ¶æ®µ')494 # 管家-çææ¡ä»¶é¡µé¢ï¼ç¹å»çæ设å¤æ¡ä»¶ï¼è¿å
¥éæ©è®¾å¤é¡µé¢495 def precondition_device(self):496 self.precondition_page() # çææ¡ä»¶é¡µé¢497 self.find_xpath(excel.xpath_con('device_factor')).click() # ç¹å»çæ设å¤æ¡ä»¶498 time.sleep(1)499 return self.find_item('éæ©è®¾å¤')500 # 管家-çææ¡ä»¶é¡µé¢ï¼ç¹å»çæåºæ¯æ¡ä»¶ï¼è¿å
¥éæ©åºæ¯é¡µé¢501 def precondition_scene(self):502 self.precondition_page() # çææ¡ä»¶é¡µé¢503 self.find_xpath(excel.xpath_con('Scenes_facto')).click() # ç¹å»çæåºæ¯æ¡ä»¶504 time.sleep(1)505 return self.find_item('éæ©åºæ¯')506 # 管家-æ°å»ºä¸ä¸ªæ
æ¯ä»»å¡ï¼ç¹å»æ
æ¯ä»»å¡ï¼è¿å
¥æ
æ¯ä»»å¡ç¼è¾é¡µé¢507 def click_scenetask(self):508 self.scenetask_creat() # å建ä¸ä¸ªæ
æ¯ä»»å¡509 self.find_xpath(excel.xpath_con('housekeeper_list')).click() # ç¹å»ç¬¬ä¸ä¸ªç®¡å®¶ä»»å¡510 time.sleep(1)511 return self.find_item('满足任ä¸æ¡ä»¶æ¶')512 # 管家-æ°å»ºä¸ä¸ªæ
æ¯ä»»å¡ï¼å·¦åä»»å¡ï¼æåºç¼è¾æé®513 def scenetask_swip_edit(self):514 self.scenetask_creat() # å建ä¸ä¸ªæ
æ¯ä»»å¡515 time.sleep(1)516 self.leftswip_housekeeper(2000) # å·¦åä»»å¡517 time.sleep(1)518 return self.find_item('ç¼è¾')519 # 管家-æ°å»ºä¸ä¸ªæ
æ¯ä»»å¡ï¼å·¦åä»»å¡ï¼æåºç¼è¾æé®ï¼ç¹å»ç¼è¾æé®ï¼è¿å
¥å®æ¶ä»»å¡ç¼è¾é¡µé¢520 def scenetask_click_edit(self):521 self.scenetask_swip_edit() # æåºç¼è¾æé®522 self.find_xpath(excel.xpath_con('housekeeper_edit')).click() # ç¹å»ç¼è¾æé®523 time.sleep(1)524 return self.find_item('满足任ä¸æ¡ä»¶æ¶')525 # 管家-æ°å»ºä¸ä¸ªæ
æ¯ä»»å¡ï¼å·¦åä»»å¡ï¼æåºå é¤æé®526 def scenetask_swip_delete(self):527 self.scenetask_creat() # å建ä¸ä¸ªæ
æ¯ä»»å¡528 time.sleep(1)529 self.leftswip_housekeeper(2000) # å·¦åä»»å¡530 time.sleep(2)531 return self.find_item('å é¤')532 # 管家-æ°å»ºä¸ä¸ªæ
æ¯ä»»å¡ï¼å·¦åä»»å¡ï¼æåºå é¤æé®ï¼ç¹å»å é¤æé®ï¼ä»»å¡è¢«å é¤533 def scenetask_click_delete(self):534 self.scenetask_swip_delete() # æåºå é¤æé®535 self.find_xpath(excel.xpath_con('housekeeper_delete')).click() # ç¹å»å é¤æé®536 time.sleep(1)...
a08_wall_socket.py
Source:a08_wall_socket.py
...12 self.find_xpath(excel.xpath_con('device')).click() # ç¹å»è®¾å¤13 time.sleep(1)14 self.find_text('å¢é¢æ座').click() # ç¹å»å¢é¢æ座15 self.wait_ac(excel.activity_con('device_detail_activity'))16 if self.find_item(u'å·²å¼å¯'):17 self.find_xpath(excel.xpath_con('socket_button')).click()18 time.sleep(2)19 # åç½®æ¡ä»¶ï¼å¢é¢æ座详æ
页ï¼æå¼ç¶æ20 def opened_state(self):21 self.find_xpath(excel.xpath_con('device')).click() # ç¹å»è®¾å¤22 time.sleep(1)23 self.find_text('å¢é¢æ座').click() # ç¹å»å¢é¢æ座24 self.wait_ac(excel.activity_con('device_detail_activity'))25 if self.find_item(u'å·²å
³é'):26 self.find_xpath(excel.xpath_con('socket_button')).click()27 time.sleep(2)28 # 1ã设å¤ï¼è¿å
¥å¢é¢æ座详æ
页29 def details_page(self):30 self.old_gateway_mine() # è´¦å·ç»éï¼æç31 self.find_xpath(excel.xpath_con('device')).click() # ç¹å»è®¾å¤32 time.sleep(1)33 self.find_text('å¢é¢æ座').click() # ç¹å»å¢é¢æ座34 self.wait_ac(excel.activity_con('device_detail_activity'))35 if self.find_item(u'å·²å¼å¯'):36 return True37 elif self.find_item(u'å·²å
³é'):38 return True39 else:40 return False41 # 2ã设å¤-æ座详æ
页ï¼ç¹å»è¿åæé®ï¼è¿å设å¤å表页é¢42 def details_page_back(self):43 self.details_page() # è¿å
¥è®¾å¤è¯¦æ
页44 self.find_xpath(excel.xpath_con('back')).click() # ç¹å»è¿åæé®45 time.sleep(1)46 return self.find_item('å
¨é¨ç±»å«') # 确认è¿å设å¤å表页é¢ï¼æ¾å
¨é¨ååºä¹å¯47 # 3ã设å¤-æ座详æ
页ï¼å
³éç¶æï¼ç¹å»å¼å
³æé®ï¼æå¼æ座48 def open_socket(self):49 self.old_gateway_mine() # è´¦å·ç»éï¼æç50 self.closed_state() # è¿å
¥è®¾å¤è¯¦æ
页ï¼å
³éç¶æ51 self.find_xpath(excel.xpath_con('socket_button')).click() # ç¹å»å¼å
³æé®52 time.sleep(2)53 return self.find_item(u'å·²å¼å¯')54 # 4ã设å¤-æ座详æ
页ï¼æå¼ç¶æï¼ç¹å»å¼å
³æé®ï¼å
³éæ座55 def close_socket(self):56 self.old_gateway_mine() # è´¦å·ç»éï¼æç57 self.opened_state() # è¿å
¥è®¾å¤è¯¦æ
页ï¼æå¼ç¶æ58 self.find_xpath(excel.xpath_con('socket_button')).click() # ç¹å»å¼å
³æé®59 time.sleep(2)60 return self.find_item(u'å·²å
³é')61 # 5ã设å¤-æ座详æ
页ï¼ç¹å»æ´å¤æé®ï¼è¿å
¥æ´å¤é¡µé¢62 def more_pages(self):63 self.details_page() # è¿å
¥è®¾å¤è¯¦æ
页64 time.sleep(1)65 self.find_xpath(excel.xpath_con('more')).click() # ç¹å»å³ä¸æ´å¤æé®66 time.sleep(1)67 return self.find_item('å é¤è®¾å¤')68 # 设å¤-æ座详æ
页-æ´å¤ï¼ç¹å»è¿åæé®ï¼è¿å
¥è®¾å¤è¯¦æ
页69 def more_pages_back(self):70 self.more_pages() # è¿å
¥æ´å¤é¡µé¢71 time.sleep(1)72 self.find_id(excel.id_con('img_left')).click() # ç¹å»å·¦ä¸è¿åæé®73 time.sleep(1)74 return self.find_item('å·²å
³é')75 # 设å¤-æ座详æ
页-æ´å¤ï¼éå½ååå123-ç¡®å®,toastï¼ä¿®æ¹è®¾å¤å称æå76 def rename(self):77 self.more_pages() # è¿å
¥æ´å¤é¡µé¢78 time.sleep(1)79 self.find_id(excel.id_con('item_device_more_rename')).click() # ç¹å»éå½å80 time.sleep(1)81 self.find_id(excel.id_con('et_user_info')).send_keys(u'åå') # è¾å
¥æ°å称82 self.find_id(excel.id_con('dialog_btn_positive')).click() # ç¹å»ç¡®å®æé®83 return self.find_toast('ä¿®æ¹è®¾å¤å称æå')84 # 设å¤-æ座详æ
页-æ´å¤ï¼éå½ååå123-ç¡®å®ï¼è¿å设å¤å表ï¼å¯ä»¥æ¥æ¾å°æ°è®¾å¤å称85 def rename_back(self):86 self.rename() # ä¿®æ¹å称87 time.sleep(1)88 self.driver.back() # ç¹å»è¿å89 time.sleep(1)90 self.driver.back() # ç¹å»è¿å91 time.sleep(1)92 for i in range(3): # 设å¤å¤çæ
åµéè¦è°æ´ãããããã93 self.swipeDown(1000)94 return self.find_item('åå')95 # 设å¤-æ座详æ
页-æ´å¤ï¼éå½ååå123-åæ¶96 def rename_cancel(self):97 self.more_pages() # è¿å
¥æ´å¤é¡µé¢98 time.sleep(1)99 self.find_id(excel.id_con('item_device_more_rename')).click() # ç¹å»éå½å100 time.sleep(1)101 self.find_id(excel.id_con('et_user_info')).send_keys(u'åå') # è¾å
¥æ°å称102 self.find_id(excel.id_con('dialog_btn_negative')).click() # ç¹å»åæ¶æé®103 return self.find_item('å¢é¢æ座')104 # 设å¤-æ座详æ
页-æ´å¤ï¼å½åå·²æç设å¤å称ï¼toastæ示ï¼è®¾å¤å称éå¤ï¼å zzzæåè¿è¡ï¼105 def zzz_rename_repeat(self):106 self.more_pages() # è¿å
¥æ´å¤é¡µé¢107 time.sleep(1)108 self.find_id(excel.id_con('item_device_more_rename')).click() # ç¹å»éå½å109 time.sleep(1)110 self.find_id(excel.id_con('et_user_info')).send_keys(u'å称éå¤') # è¾å
¥å称éå¤111 self.find_id(excel.id_con('dialog_btn_positive')).click() # ç¹å»ç¡®å®æé®112 return self.find_toast('设å¤å称éå¤ï¼')113 # 设å¤-æ座详æ
页-æ´å¤ï¼éå½å-ä¸è¾å
¥å称ï¼ç¡®å®æé®ç¹å»æ æï¼éå½åå¼¹çªè¿å¨ï¼æ¥æ¾ï¼è¯·è¾å
¥è®¾å¤å114 def rename_none(self):115 self.more_pages() # è¿å
¥æ´å¤é¡µé¢116 time.sleep(1)117 self.find_id(excel.id_con('item_device_more_rename')).click() # ç¹å»éå½å118 time.sleep(1)119 self.find_id(excel.id_con('et_user_info')).send_keys('') # ä¸è¾å
¥å称120 self.find_id(excel.id_con('dialog_btn_positive')).click() # ç¹å»ç¡®å®æé®121 return self.find_item('请è¾å
¥è®¾å¤å')122 # 设å¤-æ座详æ
页-æ´å¤ï¼ç¹å»ååºï¼è¿å
¥ååºé¡µé¢123 def zone_pages(self):124 self.more_pages() # è¿å
¥æ´å¤é¡µé¢125 time.sleep(1)126 self.find_id(excel.id_con('item_device_more_area')).click() # ç¹å»ååº127 time.sleep(1)128 return self.find_item('æªååº')129 # 设å¤-æ座详æ
页-æ´å¤-ååºï¼ç¹å»è¿åæé®ï¼è¿åæ´å¤é¡µé¢130 def zone_pages_back(self):131 self.zone_pages() # è¿å
¥ååºé¡µé¢132 self.find_id(excel.id_con('img_left')).click() # ç¹å»å·¦ä¸è¿åæé®133 time.sleep(1)134 return self.find_item('æ´å¤')135 # 设å¤-æ座详æ
页-æ´å¤ï¼åç½®æ¡ä»¶è³å°æä¸ä¸ªååºï¼ç¹å»ååºï¼è¿åæ´å¤é¡µé¢ï¼toastï¼ä¿®æ¹è®¾å¤åºåæå136 def modify_zone(self):137 self.least_one_zone() # åç½®æ¡ä»¶ï¼è³å°ä¸ä¸ªååºï¼è®¾å¤å表页é¢138 time.sleep(1)139 self.click_device(u'å¢é¢æ座') # ç¹å»å¢é¢æ座140 self.wait_ac(excel.activity_con('device_detail_activity'))141 self.find_xpath(excel.xpath_con('more')).click() # ç¹å»å³ä¸æ´å¤æé®142 time.sleep(1)143 self.find_id(excel.id_con('item_device_more_area')).click() # ç¹å»ååº144 time.sleep(1)145 self.find_xpath(excel.xpath_con('more_first_zone')).click() # ç¹å»ç¬¬ä¸ä¸ªååº146 return self.find_toast('ä¿®æ¹è®¾å¤åºåæå')147 # 设å¤-æ座详æ
页-æ´å¤ï¼ç¹å»æªååºï¼è¿åæ´å¤é¡µé¢ï¼æªååºå¯ä»¥æ¥æ¾å°148 def non_zone(self):149 self.zone_pages()150 self.find_xpath(excel.xpath_con('no_zone')).click() # ç¹å»æªååº151 time.sleep(2)152 return self.find_item('æªååº')153 # 设å¤-æ座详æ
页-æ´å¤-ååºï¼ç¹å»å³ä¸ç®¡çååºï¼è¿å
¥ååºç®¡ç页é¢154 def zoning_pages(self):155 self.zone_pages()156 self.find_id(excel.id_con('btn_right')).click() # ç¹å»å³ä¸ç®¡çååºæé®157 time.sleep(1)158 return self.find_item('ååºç®¡ç')159 # 设å¤-æ座详æ
页-æ´å¤-ååº-ååºç®¡çï¼ç¹å»è¿åæé®ï¼è¿åååºé¡µé¢160 def zoning_pages_back(self):161 self.zoning_pages() # è¿å
¥ååºç®¡ç页é¢162 self.find_id(excel.id_con('img_left')).click() # ç¹å»è¿åæé®163 return self.find_item('æªååº')164 # 设å¤-æ座详æ
页-æ´å¤ï¼ç¹å»è®¾å¤ä¿¡æ¯ï¼è¿å
¥è®¾å¤ä¿¡æ¯é¡µé¢ï¼äº§åå称165 def device_information(self):166 self.more_pages() # è¿å
¥æ´å¤é¡µé¢167 time.sleep(1)168 self.find_id(excel.id_con('item_device_more_info')).click() # ç¹å»è®¾å¤ä¿¡æ¯169 time.sleep(1)170 return self.find_item('产åå称')171 # 设å¤-æ座详æ
页-æ´å¤-设å¤ä¿¡æ¯ï¼ç¹å»è¿åæé®ï¼è¿åæ´å¤é¡µé¢172 def device_information_back(self):173 self.more_pages() # è¿å
¥æ´å¤é¡µé¢174 time.sleep(1)175 self.find_id(excel.id_con('item_device_more_info')).click() # ç¹å»è®¾å¤ä¿¡æ¯176 time.sleep(1)177 self.find_id(excel.id_con('img_left')).click() # ç¹å»è¿å178 time.sleep(1)179 return self.find_item('æ´å¤')180 # 设å¤-æ座详æ
页-æ´å¤ï¼ç¹å»æ¾è®¾å¤ï¼å¼¹çªè®¾å¤æ示ç¯å°éªç10ç§181 def find_device(self):182 self.more_pages() # è¿å
¥æ´å¤é¡µé¢183 time.sleep(1)184 self.find_id(excel.id_con('item_device_more_find')).click() # ç¹å»æ¾è®¾å¤185 time.sleep(1)186 return self.find_item('设å¤æ示ç¯å°éªç10ç§')187 # 设å¤-æ座详æ
页-æ´å¤-æ¾è®¾å¤å¼¹çªï¼ç¹å»å·²æ¾å°ï¼å¼¹çªæ¶å¤±188 def find_device_found(self):189 self.find_device() # æ¾è®¾å¤å¼¹çª190 self.find_id(excel.id_con('dialog_btn_negative')).click() # ç¹å»å·²æ¾å°191 time.sleep(1)192 return self.find_item('设å¤æ示ç¯å°éªç10ç§')193 # 设å¤-æ座详æ
页-æ´å¤-æ¾è®¾å¤å¼¹çªï¼ç¹å»åéªä¸æ¬¡ï¼å¼¹çªè¿å¨194 def find_device_find(self):195 self.find_device() # æ¾è®¾å¤å¼¹çª196 self.find_id(excel.id_con('dialog_btn_positive')).click() # ç¹å»åæ¾ä¸æ¬¡197 time.sleep(1)198 return self.find_item('设å¤æ示ç¯å°éªç10ç§')199 # 设å¤-æ座详æ
页-æ´å¤ï¼ç¹å»æ¥å¿ï¼æ¥å¿æ¶æ¯é¡µé¢200 def log_message_pages(self):201 self.more_pages() # è¿å
¥æ´å¤é¡µé¢202 time.sleep(1)203 self.find_id(excel.id_con('item_device_more_root')).click() # ç¹å»æ¥å¿204 time.sleep(2)205 return self.wait_ac(excel.activity_con('message_log_activity'))206 # 设å¤-æ座详æ
页-æ´å¤-æ¥å¿æ¶æ¯ï¼ç¹å»è¿åï¼è¿åæ´å¤é¡µé¢207 def log_message_pages_back(self):208 self.log_message_pages() # æ¥å¿æ¶æ¯é¡µé¢209 self.find_id(excel.id_con('img_left')).click() # ç¹å»è¿åæé®210 time.sleep(1)211 return self.find_item('æ´å¤')212 # 设å¤-æ座详æ
页-æ´å¤-æ¥å¿æ¶æ¯ï¼ç¹å»ææ¥ææ¥æ¾ï¼å¼¹çªæ¥æ¾ç¼è¾æ¡213 def log_search_by_time(self):214 self.log_message_pages() # æ¥å¿æ¶æ¯é¡µé¢215 self.find_id(excel.id_con('log_image_arrow')).click() # ç¹å»ææ¥ææ¥æ¾216 time.sleep(3)217 # return self.is_element('xpath', excel.xpath_con('by_date_edit')) # å¤æå
ç´ æ¯å¦åå¨218 # 设å¤-æ座详æ
页-æ´å¤-æ¥å¿æ¶æ¯ï¼ç¹å»æ¸
空æ¥å¿æé®ï¼å¼¹çªç¡®å®æ¸
空该设å¤æ¶æ¯è®°å½219 def emptying_record(self):220 self.log_message_pages() # æ¥å¿æ¶æ¯é¡µé¢221 self.find_id(excel.id_con('btn_right')).click() # ç¹å»æ¸
空记å½222 time.sleep(1)223 return self.find_item('ç¡®å®æ¸
空该设å¤æ¶æ¯è®°å½')224 # 设å¤-æ座详æ
页-æ´å¤-æ¥å¿æ¶æ¯-æ¸
空弹çªï¼ç¹å»åæ¶ï¼å¼¹çªæ¶å¤±225 def emptying_record_cancel(self):226 self.log_message_pages() # æ¥å¿æ¶æ¯é¡µé¢227 self.find_id(excel.id_con('btn_right')).click() # ç¹å»æ¸
空记å½228 time.sleep(1)229 self.find_id(excel.id_con('dialog_btn_negative')).click() # ç¹å»åæ¶æé®230 time.sleep(1)231 return self.find_item('ç¡®å®æ¸
空该设å¤æ¶æ¯è®°å½')232 # 设å¤-æ座详æ
页-æ´å¤-æ¥å¿æ¶æ¯-æ¸
空弹çªï¼ç¹å»ç¡®å®ï¼å¼¹çªæ¶å¤±ï¼è¿åæ´å¤é¡µé¢233 def emptying_record_sure(self):234 self.log_message_pages() # æ¥å¿æ¶æ¯é¡µé¢235 self.find_id(excel.id_con('btn_right')).click() # ç¹å»æ¸
空记å½236 time.sleep(1)237 self.find_id(excel.id_con('dialog_btn_positive')).click() # ç¹å»ç¡®å®æé®238 time.sleep(2)239 return self.find_item('æ´å¤')240 # 设å¤-æ座详æ
页-æ´å¤-æ¥å¿æ¶æ¯-æ¸
空弹çªï¼æ¸
空æ¶æ¯ï¼åè¿åæ¥å¿é¡µé¢ï¼æ示ï¼æ²¡ææ¥å¿æ¶æ¯241 def log_emptying(self):242 self.emptying_record_sure() # æ¥å¿æ¶æ¯æ¸
空å®æï¼æ´å¤é¡µé¢243 self.find_id(excel.id_con('item_device_more_root')).click() # ç¹å»æ¥å¿244 time.sleep(2)245 return self.find_item('没ææ¥å¿æ¶æ¯')246 # 设å¤-æ座详æ
页-æ´å¤-æ¥å¿æ¶æ¯-æ¸
空弹çªï¼æ¸
空æ¶æ¯ï¼åè¿è¿å设å¤è¯¦æ
页ï¼ç¹å»ä¸¤æ¬¡å¼å
³æé®ï¼åè¿æ¥å¿é¡µé¢ï¼æ¥å°å·²æå¼247 def log_open(self):248 self.emptying_record_sure() # æ¸
空æ¥å¿æ¶æ¯ï¼æ´å¤é¡µé¢249 self.driver.back()250 time.sleep(1)251 self.find_xpath(excel.xpath_con('socket_button')).click() # ç¹å»å¼å
³æé®252 time.sleep(2)253 self.find_xpath(excel.xpath_con('socket_button')).click() # ç¹å»å¼å
³æé®254 time.sleep(2)255 self.find_xpath(excel.xpath_con('more')).click() # ç¹å»å³ä¸æ´å¤æé®256 time.sleep(1)257 self.find_id(excel.id_con('item_device_more_root')).click() # ç¹å»æ¥å¿258 time.sleep(2)259 return self.find_item('å·²æå¼')260 # 设å¤-æ座详æ
页-æ´å¤-æ¥å¿æ¶æ¯-æ¸
空弹çªï¼æ¸
空æ¶æ¯ï¼åè¿è¿å设å¤è¯¦æ
页ï¼ç¹å»ä¸¤æ¬¡å¼å
³æé®ï¼åè¿æ¥å¿é¡µé¢ï¼æ¥å°å·²å
³é261 def log_close(self):262 self.emptying_record_sure() # æ¸
空æ¥å¿æ¶æ¯ï¼æ´å¤é¡µé¢263 self.driver.back()264 time.sleep(1)265 self.find_xpath(excel.xpath_con('socket_button')).click() # ç¹å»å¼å
³æé®266 time.sleep(2)267 self.find_xpath(excel.xpath_con('socket_button')).click() # ç¹å»å¼å
³æé®268 time.sleep(2)269 self.find_xpath(excel.xpath_con('more')).click() # ç¹å»å³ä¸æ´å¤æé®270 time.sleep(1)271 self.find_id(excel.id_con('item_device_more_root')).click() # ç¹å»æ¥å¿272 time.sleep(2)273 return self.find_item('å·²å
³é')274 # 设å¤-æ座详æ
页-æ´å¤ï¼ç¹å»å é¤è®¾å¤ï¼å¼¹çªç¡®å®å é¤è®¾å¤åï¼275 def delete_device(self):276 self.more_pages() # è¿å
¥æ´å¤é¡µé¢277 time.sleep(1)278 self.find_id(excel.id_con('item_device_more_delete')).click() # ç¹å»å é¤è®¾å¤æé®279 time.sleep(1)280 return self.find_item('ç¡®å®å é¤è®¾å¤åï¼')281 # 设å¤-æ座详æ
页-æ´å¤-å é¤è®¾å¤å¼¹çªï¼ç¹å»åæ¶æé®ï¼å¼¹çªæ¶å¤±ï¼å é¤è®¾å¤ç¨ä¾çç¥ï¼282 def delete_device_cancel(self):283 self.delete_device() # å é¤è®¾å¤284 self.find_id(excel.id_con('dialog_btn_negative')).click() # ç¹å»åæ¶æé®285 time.sleep(1)286 return self.find_item('ç¡®å®å é¤è®¾å¤åï¼')287 # åºæ¯ï¼è®¾ç½®åºæ¯æå¼æ座 --------------------------------------------------------------288 def scene_open_socket(self):289 self.scene_page() # å
¨é¨åºæ¯é¡µé¢ï¼å é¤å·²æåºæ¯290 time.sleep(1)291 self.find_id(excel.id_con('all_scene_image_add')).click() # ç¹å»å建åºæ¯292 self.wait_ac(excel.activity_con('add_scence_activity')) # åºæ¯å称ä¸å¾æ 页é¢293 time.sleep(1)294 self.find_xpath(excel.xpath_con('go_out')).click() # ç¹å»ç¦»å®¶åºæ¯å¾æ 295 time.sleep(1)296 self.find_xpath(excel.xpath_con('customScene_input_name')).send_keys(u'åµåµ123')297 time.sleep(1)298 self.find_xpath(excel.xpath_con('customScene_sure')).click() # ç¹å»ç¡®å®æé®299 time.sleep(2)300 self.find_xpath(excel.xpath_con('editScene_add_equipment')).click() # ç¹å»æ·»å ä»»å¡æé®301 time.sleep(1)302 self.switch_h5() # åæ¢å°H5页é¢303 self.find_xpath(excel.xpath_con('socket_scene')).click() # ç¹å»å¢é¢æ座304 time.sleep(1)305 self.switch_app() # åååç306 self.find_xpath(excel.xpath_con('socket_open')).click() # ç¹å»å¼307 time.sleep(1)308 self.find_xpath(excel.xpath_con('finish_delay')).click() # ç¹å»å³ä¸å®ææé®309 time.sleep(1)310 self.find_xpath(excel.xpath_con('finishScene')).click() # ç¹å»ä¿åæé®311 self.wait_ac(excel.activity_con('all_scence_activity')) # å
¨é¨åºæ¯é¡µé¢312 return self.find_item('åµåµ123')313 # å
³éæ座ï¼ç¹å»æå¼æ座åºæ¯314 def click_scene_open_socket(self):315 self.scene_open_socket() # 设置åºæ¯ï¼æå¼æ座316 self.driver.back() # è¿åé¦é¡µ317 self.find_xpath(excel.xpath_con('device')).click() # ç¹å»è®¾å¤318 time.sleep(1)319 self.click_device(u'å¢é¢æ座') # ç¹å»å¢é¢æ座320 self.wait_ac(excel.activity_con('device_detail_activity'))321 time.sleep(2)322 if self.find_item(u'å·²å¼å¯'):323 self.find_xpath(excel.xpath_con('socket_button')).click() # å
³éæ座324 time.sleep(1)325 self.driver.back()326 self.find_xpath(excel.xpath_con('home')).click() # ç¹å»é¦é¡µ327 time.sleep(1)328 self.driver.find_element_by_android_uiautomator('text(\"åµåµ123\")').click() # ç¹å»åºæ¯-åµåµ123329 self.find_xpath(excel.xpath_con('device')).click() # ç¹å»è®¾å¤330 time.sleep(1)331 self.click_device(u'å¢é¢æ座') # ç¹å»å¢é¢æ座332 self.wait_ac(excel.activity_con('device_detail_activity'))333 return self.find_item('å·²å¼å¯')334 # åºæ¯ï¼è®¾ç½®åºæ¯å
³éæ座335 def scene_close_socket(self):336 self.scene_page() # å
¨é¨åºæ¯é¡µé¢ï¼å é¤å·²æåºæ¯337 time.sleep(1)338 self.find_id(excel.id_con('all_scene_image_add')).click() # ç¹å»å建åºæ¯339 self.wait_ac(excel.activity_con('add_scence_activity')) # åºæ¯å称ä¸å¾æ 页é¢340 time.sleep(1)341 self.find_xpath(excel.xpath_con('go_out')).click() # ç¹å»ç¦»å®¶åºæ¯å¾æ 342 time.sleep(1)343 self.find_xpath(excel.xpath_con('customScene_input_name')).send_keys(u'åå123')344 time.sleep(1)345 self.find_xpath(excel.xpath_con('customScene_sure')).click() # ç¹å»ç¡®å®æé®346 time.sleep(2)347 self.find_xpath(excel.xpath_con('editScene_add_equipment')).click() # ç¹å»æ·»å ä»»å¡æé®348 time.sleep(1)349 self.switch_h5() # åæ¢å°H5页é¢350 self.find_xpath(excel.xpath_con('socket_scene')).click() # ç¹å»å¢é¢æ座351 time.sleep(1)352 self.switch_app() # åååç353 self.find_xpath(excel.xpath_con('socket_close')).click() # ç¹å»å
³354 time.sleep(1)355 self.find_xpath(excel.xpath_con('finish_delay')).click() # ç¹å»å³ä¸å®ææé®356 time.sleep(1)357 self.find_xpath(excel.xpath_con('finishScene')).click() # ç¹å»ä¿åæé®358 self.wait_ac(excel.activity_con('all_scence_activity')) # å
¨é¨åºæ¯é¡µé¢359 return self.find_item('åå123')360 # æå¼æ座ï¼ç¹å»å
³éæ座åºæ¯361 def click_scene_close_socket(self):362 self.scene_close_socket() # 设置åºæ¯ï¼å
³éæ座363 self.driver.back() # è¿åé¦é¡µ364 self.find_xpath(excel.xpath_con('device')).click() # ç¹å»è®¾å¤365 time.sleep(1)366 self.click_device(u'å¢é¢æ座') # ç¹å»å¢é¢æ座367 self.wait_ac(excel.activity_con('device_detail_activity'))368 time.sleep(2)369 if self.find_item(u'å·²å
³é'):370 self.find_xpath(excel.xpath_con('socket_button')).click() # å¼å¯æ座371 time.sleep(1)372 self.driver.back()373 self.find_xpath(excel.xpath_con('home')).click() # ç¹å»é¦é¡µ374 time.sleep(1)375 self.driver.find_element_by_android_uiautomator('text(\"åå123\")').click() # ç¹å»åºæ¯-åå123376 self.find_xpath(excel.xpath_con('device')).click() # ç¹å»è®¾å¤377 time.sleep(1)378 self.click_device(u'å¢é¢æ座') # ç¹å»å¢é¢æ座379 self.wait_ac(excel.activity_con('device_detail_activity'))380 return self.find_item('å·²å
³é')381 # åºæ¯ï¼æ·»å 延æ¶é¡µé¢ï¼ç¹å»å»¶æ¶æé®ï¼å¼¹åºå»¶æ¶è®¾ç½®ç¼è¾æ¡382 def scene_time(self):383 self.scene_page() # å
¨é¨åºæ¯é¡µé¢ï¼å é¤å·²æåºæ¯384 time.sleep(1)385 self.find_id(excel.id_con('all_scene_image_add')).click() # ç¹å»å建åºæ¯386 self.wait_ac(excel.activity_con('add_scence_activity')) # åºæ¯å称ä¸å¾æ 页é¢387 time.sleep(1)388 self.find_xpath(excel.xpath_con('go_out')).click() # ç¹å»ç¦»å®¶åºæ¯å¾æ 389 time.sleep(1)390 self.find_xpath(excel.xpath_con('customScene_input_name')).send_keys(u'åµåµ123')391 time.sleep(1)392 self.find_xpath(excel.xpath_con('customScene_sure')).click() # ç¹å»ç¡®å®æé®393 time.sleep(2)394 self.find_xpath(excel.xpath_con('editScene_add_equipment')).click() # ç¹å»æ·»å ä»»å¡æé®395 time.sleep(1)396 self.switch_h5() # åæ¢å°H5页é¢397 self.find_xpath(excel.xpath_con('socket_scene')).click() # ç¹å»å¢é¢æ座398 time.sleep(1)399 self.switch_app() # åååç400 self.find_xpath(excel.xpath_con('socket_open')).click() # ç¹å»å¼401 time.sleep(1)402 self.find_xpath(excel.xpath_con('delay_close')).click() # ç¹å»æå¼å»¶æ¶æé®403 time.sleep(1)404 return self.find_item('ç§')405 # return self.is_element('xpath', excel.xpath_con('second_1')) # å¤æå
ç´ æ¯å¦åå¨406 # åºæ¯ï¼æ·»å 延æ¶é¡µé¢ï¼ç¹å»å»¶æ¶æé®ï¼å¼¹åºå»¶æ¶è®¾ç½®ç¼è¾æ¡ï¼å次ç¹å»å»¶æ¶æé®ï¼ç¼è¾æ¡éè407 def scene_time_off(self):408 self.scene_time() # åºæ¯ï¼æå¼å»¶æ¶å¼å
³409 self.find_xpath(excel.xpath_con('delay_open')).click() # ç¹å»å
³é延æ¶å¼å
³410 time.sleep(1)411 return self.find_item('ç§')412 # åºæ¯ï¼æ·»å 延æ¶é¡µé¢ï¼è®¾ç½®å»¶æ¶ä»»å¡ï¼ç¼è¾åºæ¯é¡µé¢æ¥æ¾ï¼ç§åæ§è¡413 def scene_delay(self):414 self.scene_time() # åºæ¯ï¼æå¼å»¶æ¶å¼å
³415 self.tap_scene_delay() # ç¹å»åæ ï¼å¢å 1s416 self.tap_scene_delay() # ç¹å»åæ ï¼å¢å 1s417 self.tap_scene_delay() # ç¹å»åæ ï¼å¢å 1s418 self.find_xpath(excel.xpath_con('finish_delay')).click() # ç¹å»å³ä¸å®ææé®419 time.sleep(1)420 return self.find_item('3ç§åæ§è¡')421 # åºæ¯ï¼è®¾ç½®åºæ¯æå¼æ座ï¼ç¹å»è¿åæé®ï¼å¼¹çªï¼ç¼è¾çåºæ¯å°æªä¿åï¼æ¯å¦éåº422 def editscene_back(self):423 self.scene_page() # å
¨é¨åºæ¯é¡µé¢ï¼å é¤å·²æåºæ¯424 time.sleep(1)425 self.find_id(excel.id_con('all_scene_image_add')).click() # ç¹å»å建åºæ¯426 self.wait_ac(excel.activity_con('add_scence_activity')) # åºæ¯å称ä¸å¾æ 页é¢427 time.sleep(1)428 self.find_xpath(excel.xpath_con('go_out')).click() # ç¹å»ç¦»å®¶åºæ¯å¾æ 429 time.sleep(1)430 self.find_xpath(excel.xpath_con('customScene_input_name')).send_keys(u'åµåµ123')431 time.sleep(1)432 self.find_xpath(excel.xpath_con('customScene_sure')).click() # ç¹å»ç¡®å®æé®433 time.sleep(2)434 self.find_xpath(excel.xpath_con('editScene_add_equipment')).click() # ç¹å»æ·»å ä»»å¡æé®435 time.sleep(1)436 self.switch_h5() # åæ¢å°H5页é¢437 self.find_xpath(excel.xpath_con('socket_scene')).click() # ç¹å»å¢é¢æ座438 time.sleep(1)439 self.switch_app() # åååç440 self.find_xpath(excel.xpath_con('socket_open')).click() # ç¹å»å¼441 time.sleep(1)442 self.find_xpath(excel.xpath_con('finish_delay')).click() # ç¹å»å³ä¸å®ææé®443 time.sleep(2)444 self.find_xpath(excel.xpath_con('editScene_goback')).click() # ç¹å»å·¦ä¸è¿åæé®445 time.sleep(1)446 return self.is_element('xpath', excel.xpath_con('editScene_leave_scene')) # å¤æå¼¹çªå
ç´ æ¯å¦åå¨447 # åºæ¯ï¼è®¾ç½®åºæ¯æå¼æ座ï¼ç¹å»è¿åæé®ï¼ç¹å»åæ¶ï¼å¼¹çªæ¶å¤±448 def editscene_back_cancel(self):449 self.editscene_back() # åºæ¯ç¼è¾é¡µé¢ï¼ç¼è¾çåºæ¯å°æªä¿åå¼¹çª450 self.find_xpath(excel.xpath_con('editScene_cancel')).click() # ç¹å»åæ¶æé®451 time.sleep(1)452 return self.is_element('xpath', excel.xpath_con('editScene_leave_scene')) # å¤æå¼¹çªå
ç´ æ¯å¦åå¨453 # åºæ¯ï¼è®¾ç½®åºæ¯æå¼æ座ï¼ç¹å»è¿åæé®ï¼ç¹å»éåºï¼ä»»å¡æªä¿å454 def editscene_back_exit(self):455 self.editscene_back() # åºæ¯ç¼è¾é¡µé¢ï¼ç¼è¾çåºæ¯å°æªä¿åå¼¹çª456 self.find_xpath(excel.xpath_con('editScene_leave')).click() # ç¹å»éåºæé®457 time.sleep(1)458 self.long_press_custom(self.find_xpath(excel.xpath_con('first_scene'))) # é¿æ第ä¸ä¸ªåºæ¯459 time.sleep(1)460 self.find_id(excel.id_con('popup_edit_scene_text_edit')).click() # ç¹å»ç¼è¾åºæ¯461 time.sleep(1)462 return self.find_item('å¢é¢æ座')463 # åºæ¯ï¼è®¾ç½®åºæ¯æå¼æ座ï¼ç¹å»è¿åæé®ï¼ç¹å»ä¿å并éåºï¼ä»»å¡ä¿åæå464 def editscene_back_exitsave(self):465 self.editscene_back() # åºæ¯ç¼è¾é¡µé¢ï¼ç¼è¾çåºæ¯å°æªä¿åå¼¹çª466 self.find_xpath(excel.xpath_con('editScene_leave_save')).click() # ç¹å»éåºä¿åæé®467 time.sleep(2)468 self.long_press_custom(self.find_xpath(excel.xpath_con('first_scene'))) # é¿æ第ä¸ä¸ªåºæ¯469 time.sleep(1)470 self.find_id(excel.id_con('popup_edit_scene_text_edit')).click() # ç¹å»ç¼è¾åºæ¯471 time.sleep(1)472 return self.find_item('å¢é¢æ座')473 # åºæ¯ï¼è®¾ç½®åºæ¯æå¼æ座ï¼å·¦åæåºå é¤æé®474 def editscene_delete(self):475 self.scene_page() # å
¨é¨åºæ¯é¡µé¢ï¼å é¤å·²æåºæ¯476 time.sleep(1)477 self.find_id(excel.id_con('all_scene_image_add')).click() # ç¹å»å建åºæ¯478 self.wait_ac(excel.activity_con('add_scence_activity')) # åºæ¯å称ä¸å¾æ 页é¢479 time.sleep(1)480 self.find_xpath(excel.xpath_con('go_out')).click() # ç¹å»ç¦»å®¶åºæ¯å¾æ 481 time.sleep(1)482 self.find_xpath(excel.xpath_con('customScene_input_name')).send_keys(u'åµåµ123')483 time.sleep(1)484 self.find_xpath(excel.xpath_con('customScene_sure')).click() # ç¹å»ç¡®å®æé®485 time.sleep(2)486 self.find_xpath(excel.xpath_con('editScene_add_equipment')).click() # ç¹å»æ·»å ä»»å¡æé®487 time.sleep(1)488 self.switch_h5() # åæ¢å°H5页é¢489 self.find_xpath(excel.xpath_con('socket_scene')).click() # ç¹å»å¢é¢æ座490 time.sleep(1)491 self.switch_app() # åååç492 self.find_xpath(excel.xpath_con('socket_open')).click() # ç¹å»å¼493 time.sleep(1)494 self.find_xpath(excel.xpath_con('finish_delay')).click() # ç¹å»å³ä¸å®ææé®495 time.sleep(2)496 self.leftswip_editscene(2000)497 return self.find_item('å é¤')498 # åºæ¯ï¼è®¾ç½®åºæ¯æå¼æ座ï¼å·¦åæåºå é¤æé®ï¼ç¹å»å é¤ï¼ä»»å¡è¢«å é¤499 def editscene_delete_click(self):500 self.editscene_delete() # åºæ¯ç¼è¾é¡µé¢ï¼æåºå é¤æé®501 time.sleep(1)502 self.find_xpath(excel.xpath_con('ediescene_delete')).click() # ç¹å»å é¤æé®503 time.sleep(1)504 return self.find_item('å¢é¢æ座')505 # åºæ¯ï¼è®¾ç½®åºæ¯æå¼æ座ï¼ç¹å»ä»»å¡ï¼å¯ä»¥éæ°è®¾ç½®ä»»å¡ï¼è¿å
¥è®¾ç½®è®¾å¤ç¶æ页é¢506 def editscene_edit(self):507 self.scene_open_socket() # 设置åºæ¯ï¼æ座æå¼508 self.long_press_custom(self.find_xpath(excel.xpath_con('first_scene'))) # é¿æ第ä¸ä¸ªåºæ¯509 time.sleep(1)510 self.find_id(excel.id_con('popup_edit_scene_text_edit')).click() # ç¹å»ç¼è¾åºæ¯511 time.sleep(2)512 self.find_xpath(excel.xpath_con('editscene_action_list')).click() # ç¹å»ç¬¬ä¸ä¸ªä»»å¡513 time.sleep(1)514 return self.find_item('设置设å¤ç¶æ')515 # åºæ¯ï¼æ·»å 设å¤é¡µé¢ï¼ç¹å»å
¨é¨ååºï¼æåºææååºï¼æ¥æ¾xpathå
¨é¨ååºå
ç´ 516 def editscene_allzone(self):517 self.scene_page() # å
¨é¨åºæ¯é¡µé¢ï¼å é¤å·²æåºæ¯518 time.sleep(1)519 self.find_id(excel.id_con('all_scene_image_add')).click() # ç¹å»å建åºæ¯520 self.wait_ac(excel.activity_con('add_scence_activity')) # åºæ¯å称ä¸å¾æ 页é¢521 time.sleep(1)522 self.find_xpath(excel.xpath_con('go_out')).click() # ç¹å»ç¦»å®¶åºæ¯å¾æ 523 time.sleep(1)524 self.find_xpath(excel.xpath_con('customScene_input_name')).send_keys(u'åµåµ123')525 time.sleep(1)526 self.find_xpath(excel.xpath_con('customScene_sure')).click() # ç¹å»ç¡®å®æé®527 time.sleep(2)528 self.find_xpath(excel.xpath_con('editScene_add_equipment')).click() # ç¹å»æ·»å ä»»å¡æé®529 time.sleep(1)530 self.find_xpath(excel.xpath_con('device_list_allAreas')).click() # ç¹å»å
¨é¨ååº531 time.sleep(1)532 return self.is_element('xpath', excel.xpath_con('all_zone')) # éªè¯å
¨é¨ååºå
ç´ æ¯å¦åå¨533 # åºæ¯ï¼æ·»å 设å¤é¡µé¢ï¼ç¹å»å
¨é¨ç±»å«ï¼æåºææç±»å«ï¼æ¥æ¾æºè½é¨é534 def editscene_allcategory(self):535 self.scene_page() # å
¨é¨åºæ¯é¡µé¢ï¼å é¤å·²æåºæ¯536 time.sleep(1)537 self.find_id(excel.id_con('all_scene_image_add')).click() # ç¹å»å建åºæ¯538 self.wait_ac(excel.activity_con('add_scence_activity')) # åºæ¯å称ä¸å¾æ 页é¢539 time.sleep(1)540 self.find_xpath(excel.xpath_con('go_out')).click() # ç¹å»ç¦»å®¶åºæ¯å¾æ 541 time.sleep(1)542 self.find_xpath(excel.xpath_con('customScene_input_name')).send_keys(u'åµåµ123')543 time.sleep(1)544 self.find_xpath(excel.xpath_con('customScene_sure')).click() # ç¹å»ç¡®å®æé®545 time.sleep(2)546 self.find_xpath(excel.xpath_con('editScene_add_equipment')).click() # ç¹å»æ·»å ä»»å¡æé®547 time.sleep(1)548 self.find_xpath(excel.xpath_con('device_list_Categories')).click() # ç¹å»å
¨é¨åç±»549 time.sleep(1)550 return self.find_item('æºè½é¨é')551 # åºæ¯ï¼æ·»å 设å¤é¡µé¢ï¼ç¹å»æ¹éæ·»å ï¼è¿å
¥æ¹éæ·»å 页é¢ï¼æ¥æ¾å
¨é552 def editscene_batchadd(self):553 self.scene_page() # å
¨é¨åºæ¯é¡µé¢ï¼å é¤å·²æåºæ¯554 time.sleep(1)555 self.find_id(excel.id_con('all_scene_image_add')).click() # ç¹å»å建åºæ¯556 self.wait_ac(excel.activity_con('add_scence_activity')) # åºæ¯å称ä¸å¾æ 页é¢557 time.sleep(1)558 self.find_xpath(excel.xpath_con('go_out')).click() # ç¹å»ç¦»å®¶åºæ¯å¾æ 559 time.sleep(1)560 self.find_xpath(excel.xpath_con('customScene_input_name')).send_keys(u'åµåµ123')561 time.sleep(1)562 self.find_xpath(excel.xpath_con('customScene_sure')).click() # ç¹å»ç¡®å®æé®563 time.sleep(2)564 self.find_xpath(excel.xpath_con('editScene_add_equipment')).click() # ç¹å»æ·»å ä»»å¡æé®565 time.sleep(1)566 self.find_xpath(excel.xpath_con('batchAdd')).click() # ç¹å»æ¹éæ·»å 567 time.sleep(1)...
binary_search.py
Source:binary_search.py
1"""2Binary search algorithm3"""4# def binary_search(sorted_lst, find_item):5# """6# Searchs the item in the sorted list and returns it or None7# :param sorted_lst: [int or float]8# :param find_item: int or float9# :return: int or float or None10# """11# if len(sorted_lst) == 0 or \12# not isinstance(sorted_lst[0], (int, float)) or \13# not isinstance(find_item, (int, float)):14# return None15# lst = sorted_lst16# start = 017# finish = len(lst) - 118# middle = int(len(lst) / 2)19# if find_item == lst[middle]:20# return lst[middle]21# if finish == start:22# return None23# if find_item > lst[middle]:24# new_lst = lst[middle:]25# return binary_search(new_lst, find_item)26# new_lst = lst[: middle]27# return binary_search(new_lst, find_item)28def binary_search(lst, find_item):29 """30 Searches the item in the sorted list and returns it or None31 :param lst: [int or float]32 :param find_item: int or float33 :return: int or float or None34 """35 if len(lst) == 0 or \36 not isinstance(lst[0], (int, float)) or \37 not isinstance(find_item, (int, float)):38 return None39 if find_item > lst[-1] or find_item < lst[0]:40 return None41 start = 042 finish = len(lst) - 143 while start <= finish:44 middle = int((start + finish) / 2)45 item = lst[middle]46 if find_item <= item:47 finish = middle - 148 continue49 if find_item > item:50 start = middle + 151 continue52 if find_item == lst[start]:53 return start...
Learn to execute automation testing from scratch with LambdaTest Learning Hub. Right from setting up the prerequisites to run your first automation test, to following best practices and diving deeper into advanced test scenarios. LambdaTest Learning Hubs compile a list of step-by-step guides to help you be proficient with different test automation frameworks i.e. Selenium, Cypress, TestNG etc.
You could also refer to video tutorials over LambdaTest YouTube channel to get step by step demonstration from industry experts.
Get 100 minutes of automation test minutes FREE!!