Best Python code snippet using ATX
jw_case.py
Source:jw_case.py
...859 pass860 else:861 SameOperation().add_wired(u, video_camera_name)862 u.press('back')863 if u(resourceId="com.yoosee:id/ll_defence_state").wait_gone(timeout=3.0):864 u.swipe_ext("down", scale=0.8)865 u(resourceId="com.yoosee:id/tv_playback").click(timeout=8)866 u(resourceId="com.yoosee:id/tv_sdcard_playback").click(timeout=5)867 u(resourceId='com.yoosee:id/fl_videoplayer_parent').wait(timeout=5)868 timeline_icon_coordinates = u(resourceId='com.yoosee:id/fl_videoplayer_parent').center()869 u.drag(timeline_icon_coordinates[0] - 100, timeline_icon_coordinates[1], timeline_icon_coordinates[0],870 timeline_icon_coordinates[1], 0.2)871 # u(resourceId="com.yoosee:id/fl_videoplayer_parent").swipe("right", steps=10)872 sleep(5)873 u(resourceId="com.yoosee:id/rl_vedioplayer_area").click(timeout=5)874 sleep(1)875 if not u(resourceId="com.yoosee:id/iv_playback_fast").exists:876 u(resourceId="com.yoosee:id/rl_vedioplayer_area").click(timeout=5)877 sleep(1)878 sleep(3)879 pix1 = SameOperation().pixel_value(u,timeline_icon_coordinates)880 # print('pix1', pix1)881 if pix1[0] < 120 and pix1[1] < 120:882 play_status = u(resourceId="com.yoosee:id/iv_playback_fast").info883 assert play_status['enabled'] == True, 'æ¶é´è½´ååå¿«éæ»å¨æ²¡æèªå¨ææ¾'884 u.drag(timeline_icon_coordinates[0] + 100, timeline_icon_coordinates[1], timeline_icon_coordinates[0],885 timeline_icon_coordinates[1], 0.2)886 # u(resourceId="com.yoosee:id/fl_videoplayer_parent").swipe("left", steps=10)887 sleep(5)888 if not u(resourceId="com.yoosee:id/iv_playback_fast").exists:889 u(resourceId="com.yoosee:id/rl_vedioplayer_area").click(timeout=5)890 sleep(1)891 sleep(3)892 pix2 = SameOperation().pixel_value(u, timeline_icon_coordinates)893 # print ('pix2',pix2)894 if pix2[0] < 120 and pix2[1] < 120:895 play_status = u(resourceId="com.yoosee:id/iv_playback_fast").info896 assert play_status['enabled'] == True, 'æ¶é´è½´ååå¿«éæ»å¨æ²¡æèªå¨ææ¾'897 SameOperation().quit_app(u)898 @classmethod899 def jwt_38(cls, u, video_camera_name): #é¦æ¬¡æå¼äºåæ¾ï¼é»è®¤ææ¾900 SameOperation().app_go(u)901 if u(resourceId='com.yoosee:id/setting_more_iv').wait(timeout=5):902 pass903 else:904 SameOperation().add_wired(u, video_camera_name)905 u.press('back')906 if u(resourceId="com.yoosee:id/tv_playback").wait_gone(timeout=3.0):907 u.swipe_ext("down", scale=0.8)908 u(resourceId="com.yoosee:id/tv_playback").wait(timeout=5)909 u(resourceId="com.yoosee:id/tv_playback").click(timeout=8)910 u(resourceId="com.yoosee:id/tv_cloud_playback").click(timeout=5)911 u(resourceId="com.yoosee:id/rl_functin_bar").wait(timeout=8)912 sleep(20)913 SameOperation().quit_app(u)914 @classmethod915 def jwt_39(cls, u, video_camera_name): #ææ¾çé¢å°æ§ä»¶ç«å± - ææ¾æé®916 SameOperation().app_go(u)917 if u(resourceId='com.yoosee:id/setting_more_iv').wait(timeout=5):918 pass919 else:920 SameOperation().add_wired(u, video_camera_name)921 u.press('back')922 if u(resourceId="com.yoosee:id/tv_playback").wait_gone(timeout=3.0):923 u.swipe_ext("down", scale=0.8)924 u(resourceId="com.yoosee:id/tv_playback").wait(timeout=5)925 u(resourceId="com.yoosee:id/tv_playback").click(timeout=8)926 u(resourceId="com.yoosee:id/tv_cloud_playback").click(timeout=5)927 u(resourceId="com.yoosee:id/rl_functin_bar").wait(timeout=8)928 sleep(10)929 if u(resourceId="com.yoosee:id/rl_functin_bar").wait_gone(timeout=3.0):930 u(resourceId="com.yoosee:id/rl_vedioplayer_area").click(timeout=5)931 # u(resourceId="com.yoosee:id/play_iv").click(timeout=5)932 stop_status = SameOperation().icon_statuscheck(u,"com.yoosee:id/play_iv")933 assert stop_status > 0,'ææ¾ç¶æä¸å¯¹'934 # sleep(8)935 # if not u(resourceId="com.yoosee:id/play_iv").exists:936 # u(resourceId="com.yoosee:id/rl_vedioplayer_area").click(timeout=5)937 # u(resourceId="com.yoosee:id/play_iv").click(timeout=5)938 SameOperation().quit_app(u)939 @classmethod940 def jwt_40(cls, u, video_camera_name): #ææ¾çé¢å°æ§ä»¶ç«å± - æåæ¶æé®ç¶æ941 SameOperation().app_go(u)942 if u(resourceId='com.yoosee:id/setting_more_iv').wait(timeout=5):943 pass944 else:945 SameOperation().add_wired(u, video_camera_name)946 u.press('back')947 if u(resourceId="com.yoosee:id/tv_playback").wait_gone(timeout=3.0):948 u.swipe_ext("down", scale=0.8)949 u(resourceId="com.yoosee:id/tv_playback").click(timeout=8)950 u(resourceId="com.yoosee:id/tv_cloud_playback").click(timeout=5)951 u(resourceId="com.yoosee:id/rl_functin_bar").wait(timeout=8)952 sleep(10)953 if u(resourceId="com.yoosee:id/rl_functin_bar").wait_gone(timeout=3.0):954 u(resourceId="com.yoosee:id/rl_vedioplayer_area").click(timeout=5)955 u(resourceId="com.yoosee:id/play_iv").click(timeout=5)956 sleep(0.5)957 stop_status = SameOperation().icon_statuscheck(u,"com.yoosee:id/play_iv")958 assert stop_status > 0, 'æåç¶æä¸å¯¹'959 SameOperation().quit_app(u)960 @classmethod961 def jwt_41(cls, u, video_camera_name): #ææ¾çé¢å°æ§ä»¶ç«å± - æªå¾962 SameOperation().app_go(u)963 if u(resourceId='com.yoosee:id/setting_more_iv').wait(timeout=5):964 pass965 else:966 SameOperation().add_wired(u, video_camera_name)967 u.press('back')968 if u(resourceId="com.yoosee:id/tv_playback").wait_gone(timeout=3.0):969 u.swipe_ext("down", scale=0.8)970 u(resourceId="com.yoosee:id/tv_playback").click(timeout=8)971 u(resourceId="com.yoosee:id/tv_cloud_playback").click(timeout=5)972 u(resourceId="com.yoosee:id/rl_functin_bar").wait(timeout=8)973 sleep(10)974 if u(resourceId="com.yoosee:id/rl_functin_bar").wait_gone(timeout=3.0):975 u(resourceId="com.yoosee:id/rl_vedioplayer_area").click(timeout=5)976 u(resourceId="com.yoosee:id/play_iv").click(timeout=5)977 u(resourceId="com.yoosee:id/iv_palyback_screenshot_btn").click(timeout=5)978 assert u.xpath('//*[@resource-id="com.yoosee:id/rl_vedioplayer_area"]/android.widget.ImageView[1]').wait(timeout=8), 'å·¦ä¸è§æ²¡æ¾ç¤ºæªå¾ç¼©ç¥å¾'979 SameOperation().quit_app(u)980 @classmethod981 def jwt_42(cls, u, video_camera_name): #ææ¾çé¢å°æ§ä»¶ä¸è½½ä¿å982 SameOperation().app_go(u)983 if u(resourceId='com.yoosee:id/setting_more_iv').wait(timeout=5):984 pass985 else:986 SameOperation().add_wired(u, video_camera_name)987 u.press('back')988 if u(resourceId="com.yoosee:id/tv_playback").wait_gone(timeout=3.0):989 u.swipe_ext("down", scale=0.8)990 # u(resourceId="com.yoosee:id/tv_playback").wait(timeout=5)991 # sleep(1)992 u(resourceId="com.yoosee:id/tv_playback").click(timeout=8)993 u(resourceId="com.yoosee:id/tv_cloud_playback").click(timeout=5)994 u(resourceId="com.yoosee:id/rl_functin_bar").wait(timeout=8)995 #æ¸
é¤ä¸è½½ä»»å¡996 u(resourceId="com.yoosee:id/tv_download_list").click(timeout=5)997 u(resourceId="com.yoosee:id/rbtn_right").click(timeout=5)998 if u(resourceId="com.yoosee:id/top_tv").exists:999 u(resourceId="com.yoosee:id/top_tv").click(timeout=5)1000 u(resourceId="com.yoosee:id/ll_select_all").click(timeout=5)1001 u(resourceId="com.yoosee:id/ll_delete").click(timeout=5)1002 u(resourceId="com.yoosee:id/tv_yes").click(timeout=5)1003 u(resourceId="com.yoosee:id/back_btn").click(timeout=5)1004 sleep(10)1005 if u(resourceId="com.yoosee:id/rl_functin_bar").wait_gone(timeout=3.0):1006 u(resourceId="com.yoosee:id/rl_vedioplayer_area").click(timeout=5)1007 u(resourceId="com.yoosee:id/play_iv").click(timeout=5)1008 u(resourceId="com.yoosee:id/iv_playback_to_dwonload").click(timeout=5)1009 u(resourceId="com.yoosee:id/iv_palyback_dwonload_ok").click(timeout=5)1010 u(resourceId="com.yoosee:id/tv_download_list").click(timeout=5)1011 try:1012 assert u(resourceId="com.yoosee:id/rl_download_start").wait(timeout=5), 'ä¸è½½ä¸æ ä¸è½½ä»»å¡'1013 except:1014 assert u(resourceId="com.yoosee:id/rl_download_start").wait(timeout=5), 'ä¸è½½ä¸åå·²ä¸è½½é½æ ä»»å¡'1015 SameOperation().quit_app(u)1016 @classmethod1017 def jwt_43(cls, u, video_camera_name): #äºåæ¾åæ¢æ¥æå°è¿å»1018 SameOperation().app_go(u)1019 if u(resourceId='com.yoosee:id/setting_more_iv').wait(timeout=5):1020 pass1021 else:1022 SameOperation().add_wired(u, video_camera_name)1023 u.press('back')1024 if u(resourceId="com.yoosee:id/tv_playback").wait_gone(timeout=3.0):1025 u.swipe_ext("down", scale=0.8)1026 # u(resourceId="com.yoosee:id/tv_playback").wait(timeout=5)1027 u(resourceId="com.yoosee:id/tv_playback").click(timeout=8)1028 sleep(1)1029 u(resourceId="com.yoosee:id/tv_cloud_playback").click(timeout=5)1030 u(resourceId="com.yoosee:id/rl_functin_bar").wait(timeout=8)1031 sleep(10)1032 u(resourceId='com.yoosee:id/date_tv')[2].click(timeout=5)1033 sleep(10)1034 if not u(text="ææ å½å").exists:1035 if u(resourceId="com.yoosee:id/rl_functin_bar").wait_gone(timeout=3.0):1036 u(resourceId="com.yoosee:id/rl_vedioplayer_area").click(timeout=5)1037 # u(resourceId="com.yoosee:id/play_iv").click(timeout=5)1038 sleep(1)1039 stop_status = SameOperation().icon_statuscheck(u,"com.yoosee:id/play_iv")1040 # print (stop_status)1041 assert stop_status > 0, 'åæ¾ææ¾ç¶æä¸å¯¹'1042 SameOperation().quit_app(u)1043 @classmethod1044 def jwt_44(cls, u, video_camera_name): #äºåæ¾æ¶æ¯å表-ææ¾è§é¢1045 SameOperation().app_go(u)1046 if u(resourceId='com.yoosee:id/setting_more_iv').wait(timeout=5):1047 pass1048 else:1049 SameOperation().add_wired(u, video_camera_name)1050 u.press('back')1051 if u(resourceId="com.yoosee:id/tv_playback").wait_gone(timeout=3.0):1052 u.swipe_ext("down", scale=0.8)1053 u(resourceId="com.yoosee:id/tv_playback").click(timeout=8)1054 sleep(3)1055 u(resourceId="com.yoosee:id/tv_cloud_playback").click(timeout=5)1056 u(resourceId="com.yoosee:id/rl_functin_bar").wait(timeout=8)1057 sleep(10)1058 if not u(text="ææ å½å").exists:1059 u(resourceId='com.yoosee:id/detection_time_tv')[0].click(timeout=5)1060 sleep(5)1061 assert u(text="æ£å¨é¢è§").wait(timeout=5), 'ç¹å»å没ææ£å¨é¢è§'1062 SameOperation().quit_app(u)1063 @classmethod1064 def jwt_45(cls, u, video_camera_name): #äºåæ¾æ¶é´å»åº¦å°ºæ¨ªç«å±åæ¢ææ¾1065 SameOperation().app_go(u)1066 if u(resourceId='com.yoosee:id/setting_more_iv').wait(timeout=5):1067 pass1068 else:1069 SameOperation().add_wired(u, video_camera_name)1070 u.press('back')1071 if u(resourceId="com.yoosee:id/tv_playback").wait_gone(timeout=3.0):1072 u.swipe_ext("down", scale=0.8)1073 u(resourceId="com.yoosee:id/tv_playback").click(timeout=8)1074 u(resourceId="com.yoosee:id/tv_cloud_playback").click(timeout=5)1075 u(resourceId="com.yoosee:id/rl_functin_bar").wait(timeout=8)1076 sleep(10)1077 if u(resourceId="com.yoosee:id/rl_functin_bar").wait_gone(timeout=3.0):1078 u(resourceId="com.yoosee:id/rl_vedioplayer_area").click(timeout=5)1079 u(resourceId="com.yoosee:id/iv_half_screen").click(timeout=5)1080 sleep(2)1081 if not u(resourceId="com.yoosee:id/ll_landscape_timeline").exists:1082 u.xpath('//android.widget.FrameLayout[1]').click()1083 u(resourceId="com.yoosee:id/play_land_iv").click(timeout=5)1084 assert u(resourceId="com.yoosee:id/ll_landscape_timeline").wait(timeout=5),'åæ¢æ¨ªå±æ¶ï¼å»åº¦å°ºä¸åå¨'1085 SameOperation().quit_app(u)1086 @classmethod1087 def jwt_46(cls, u, video_camera_name): #äºåæ¾æ¶é´å»åº¦å°ºæ¨ªç«å±åæ¢ææ¾1088 SameOperation().app_go(u)1089 if u(resourceId='com.yoosee:id/setting_more_iv').wait(timeout=5):1090 pass1091 else:1092 SameOperation().add_wired(u, video_camera_name)1093 u.press('back')1094 if u(resourceId="com.yoosee:id/tv_playback").wait_gone(timeout=3.0):1095 u.swipe_ext("down", scale=0.8)1096 u(resourceId="com.yoosee:id/tv_playback").click(timeout=8)1097 u(resourceId="com.yoosee:id/tv_cloud_playback").click(timeout=5)1098 u(resourceId="com.yoosee:id/rl_functin_bar").wait(timeout=8)1099 sleep(10)1100 if u(resourceId="com.yoosee:id/rl_functin_bar").wait_gone(timeout=3.0):1101 u(resourceId="com.yoosee:id/rl_vedioplayer_area").click(timeout=5)1102 u(resourceId="com.yoosee:id/iv_half_screen").click(timeout=5)1103 sleep(2)1104 if not u(resourceId="com.yoosee:id/ll_landscape_timeline").exists:1105 u.xpath('//android.widget.FrameLayout[1]').click()1106 u(resourceId="com.yoosee:id/iv_portrait_screen").click(timeout=5)1107 sleep(2)1108 if not u(resourceId="com.yoosee:id/rl_functin_bar").exists:1109 u(resourceId="com.yoosee:id/rl_vedioplayer_area").click(timeout=5)1110 u(resourceId="com.yoosee:id/play_iv").click(timeout=5)1111 assert u(resourceId="com.yoosee:id/fl_videoplayer_parent").exists, 'åæ¢ç«å±æ¶ï¼å»åº¦å°ºä¸åå¨'1112 SameOperation().quit_app(u)1113 @classmethod1114 def jwt_47(cls, u, video_camera_name): #banner广å1115 SameOperation().app_go(u)1116 if u(resourceId='com.yoosee:id/setting_more_iv').wait(timeout=5):1117 pass1118 else:1119 SameOperation().add_wired(u, video_camera_name)1120 u.press('back')1121 banner_times = 01122 while True:1123 if u.xpath('//*[@resource-id="com.yoosee:id/lv_contact"]/android.widget.LinearLayout[1]').exists:1124 break1125 elif banner_times == 5:1126 break1127 u.swipe_ext("down", scale=0.8)1128 sleep(3)1129 banner_times = banner_times + 11130 assert u.xpath('//*[@resource-id="com.yoosee:id/lv_contact"]/android.widget.LinearLayout[1]').wait(timeout=8), '没æbanner广å'1131 SameOperation().quit_app(u)1132 @classmethod1133 def jwt_48(cls, u, video_camera_name): #设置äºåå
¥å£1134 SameOperation().app_go(u)1135 if u(resourceId='com.yoosee:id/setting_more_iv').wait(timeout=5):1136 pass1137 else:1138 SameOperation().add_wired(u, video_camera_name)1139 u.press('back')1140 SameOperation().find_deldevices(u, 'æçäºåå¨')1141 u(text='æçäºåå¨').click(timeout=5)1142 assert u(text="äºæå¡").wait(timeout=10), '没æ跳转å°å¢å¼ä¸å¡H5页é¢ï¼é¡µé¢æ é¢æªåºç°'1143 SameOperation().quit_app(u)1144 @classmethod1145 def jwt_49(cls, u, video_camera_name): #设置åºç¡å
¨å¤©/æ¥è¦å½åäºå1146 SameOperation().app_go(u)1147 if u(resourceId='com.yoosee:id/setting_more_iv').wait(timeout=5):1148 pass1149 else:1150 SameOperation().add_wired(u, video_camera_name)1151 u.press('back')1152 SameOperation().find_deldevices(u, 'å½å设置')1153 u(text='å½å设置').click(timeout=5)1154 u(text='æ¥è¦å½å').click(timeout=5)1155 assert u(resourceId='com.yoosee:id/pt_alarm_record_time').wait(timeout=5), 'åæ¢æ¥è¦å½å失败'1156 SameOperation().quit_app(u)1157 @classmethod1158 def jwt_50(cls, u, video_camera_name): #设置åºç¡å
¨å¤©/æ¥è¦å½åäºå1159 SameOperation().app_go(u)1160 if u(resourceId='com.yoosee:id/setting_more_iv').wait(timeout=5):1161 pass1162 else:1163 SameOperation().add_wired(u, video_camera_name)1164 u.press('back')1165 SameOperation().find_deldevices(u, 'å½å设置')1166 u(text='å½å设置').click(timeout=5)1167 u(text='å®æ¶å½å').click(timeout=5)1168 assert u(resourceId='com.yoosee:id/pt_timed_record_time').wait(timeout=5), 'åæ¢å®æ¶å½å失败'1169 SameOperation().quit_app(u)1170 @classmethod1171 def jwt_51(cls, u, video_camera_name): #设置åºç¡å
¨å¤©/æ¥è¦å½åäºå1172 SameOperation().app_go(u)1173 if u(resourceId='com.yoosee:id/setting_more_iv').wait(timeout=5):1174 pass1175 else:1176 SameOperation().add_wired(u, video_camera_name)1177 u.press('back')1178 SameOperation().find_deldevices(u, 'å½å设置')1179 u(text='å½å设置').click(timeout=5)1180 u(text='å
¨å¤©å½å').click(timeout=5)1181 assert u(resourceId='com.yoosee:id/sv_record_switch').wait(timeout=5), 'åæ¢å
¨å¤©å½å失败'1182 SameOperation().quit_app(u)1183 @classmethod1184 def jwt_52(cls, u, video_camera_name): #çæ§çé¢/æ´å¤-åæ¾1185 SameOperation().app_go(u)1186 if u(resourceId='com.yoosee:id/setting_more_iv').wait(timeout=5):1187 pass1188 else:1189 SameOperation().add_wired(u, video_camera_name)1190 u.press('back')1191 u.xpath(1192 '//*[@resource-id="com.yoosee:id/lv_contact"]/android.widget.RelativeLayout[1]/android.widget.LinearLayout[1]/android.widget.RelativeLayout[2]/android.widget.LinearLayout[1]').click()1193 sleep(5)1194 u(resourceId='com.yoosee:id/more_btn').click(timeout=5)1195 u(resourceId='com.yoosee:id/root_view')[0].click(timeout=5)1196 u(resourceId='com.yoosee:id/tv_sdcard_playback').click(timeout=5)1197 sleep(5)1198 if u(resourceId="com.yoosee:id/rl_functin_bar").wait_gone(timeout=3.0):1199 u(resourceId="com.yoosee:id/rl_vedioplayer_area").click(timeout=5)1200 # u(resourceId="com.yoosee:id/play_iv").click(timeout=5)1201 play_status = u(resourceId="com.yoosee:id/iv_playback_fast").info1202 sleep(1)1203 assert play_status['enabled'] == True, '没æèªå¨ææ¾'1204 SameOperation().quit_app(u)1205 @classmethod1206 def jwt_53(cls, u, video_camera_name): #çæ§çé¢/æ´å¤-åæ¾è¿åéæ°è¿æ¥1207 SameOperation().app_go(u)1208 if u(resourceId='com.yoosee:id/setting_more_iv').wait(timeout=5):1209 pass1210 else:1211 SameOperation().add_wired(u, video_camera_name)1212 u.press('back')1213 u.xpath(1214 '//*[@resource-id="com.yoosee:id/lv_contact"]/android.widget.RelativeLayout[1]/android.widget.LinearLayout[1]/android.widget.RelativeLayout[2]/android.widget.LinearLayout[1]').click()1215 sleep(5)1216 u(resourceId='com.yoosee:id/more_btn').click(timeout=5)1217 u(resourceId='com.yoosee:id/root_view')[0].click(timeout=5)1218 sleep(5)1219 u(resourceId='com.yoosee:id/back_btn').click(timeout=5)1220 u(resourceId='com.yoosee:id/center_direction_view').wait(timeout=5)1221 u.xpath(1222 '//*[@resource-id="android:id/content"]/android.widget.RelativeLayout[1]/android.widget.LinearLayout[1]/android.widget.RelativeLayout[1]').click(timeout=5)1223 assert u(resourceId='com.yoosee:id/bottom_control_rl').wait(timeout=5),'没æéæ°è¿æ¥è§é¢'1224 SameOperation().quit_app(u)1225 @classmethod1226 def jwt_54(cls, u, video_camera_name): #çæ§çé¢/æ´å¤-åæ¾è¿åæ¶èµ·æ´å¤èå1227 SameOperation().app_go(u)1228 if u(resourceId='com.yoosee:id/setting_more_iv').wait(timeout=5):1229 pass1230 else:1231 SameOperation().add_wired(u, video_camera_name)1232 u.press('back')1233 u.xpath(1234 '//*[@resource-id="com.yoosee:id/lv_contact"]/android.widget.RelativeLayout[1]/android.widget.LinearLayout[1]/android.widget.RelativeLayout[2]/android.widget.LinearLayout[1]').click()1235 sleep(5)1236 u(resourceId='com.yoosee:id/more_btn').click(timeout=5)1237 u(resourceId='com.yoosee:id/root_view')[0].click(timeout=5)1238 sleep(5)1239 u(resourceId='com.yoosee:id/back_btn').click(timeout=5)1240 u(resourceId='com.yoosee:id/center_direction_view').wait(timeout=5)1241 assert not u(resourceId='com.yoosee:id/root_view')[0].wait(timeout=5),'没ææ¶èµ·æ´å¤èå'1242 SameOperation().quit_app(u)1243 @classmethod1244 def jwt_55(cls, u, video_camera_name): #çæ§çé¢æ´å¤-æ¥è¦å¼å
³å¸é²ç¶æ1245 SameOperation().app_go(u)1246 if u(resourceId='com.yoosee:id/setting_more_iv').wait(timeout=5):1247 pass1248 else:1249 SameOperation().add_wired(u, video_camera_name)1250 u.press('back')1251 if u(resourceId="com.yoosee:id/ll_defence_state").wait_gone(timeout=3.0):1252 u.swipe_ext("down", scale=0.8)1253 u(resourceId='com.yoosee:id/ll_defence_state').wait(timeout=5)1254 if u(text='è¦æä¸').exists:1255 u(text='è¦æä¸').click(timeout=5)1256 sleep(3)1257 u.xpath(1258 '//*[@resource-id="com.yoosee:id/lv_contact"]/android.widget.RelativeLayout[1]/android.widget.LinearLayout[1]/android.widget.RelativeLayout[2]/android.widget.LinearLayout[1]').click(timeout=5)1259 sleep(5)1260 u(resourceId='com.yoosee:id/more_btn').click(timeout=5)1261 u(resourceId='com.yoosee:id/root_view')[1].click(timeout=5)1262 sleep(3)1263 u(resourceId='com.yoosee:id/back_btn').click(timeout=5)1264 u(resourceId='com.yoosee:id/setting_more_iv').wait(timeout=5)1265 u.swipe_ext("down", scale=0.8)1266 u(resourceId='com.yoosee:id/ll_defence_state').wait(timeout=5)1267 assert u(resourceId="com.yoosee:id/tx_defence_state").get_text() == 'è¦æä¸','å¸é²ç¶æåæ¢ä¸æå'1268 u(text='è¦æä¸').click(timeout=5)1269 sleep(2)1270 SameOperation().quit_app(u)1271 @classmethod1272 def jwt_56(cls, u, video_camera_name): #çæ§çé¢æ´å¤-å
³éæ¥è¦ï¼è®¾å¤æ¤éå¸é²1273 SameOperation().app_go(u)1274 if u(resourceId='com.yoosee:id/setting_more_iv').wait(timeout=5):1275 pass1276 else:1277 SameOperation().add_wired(u, video_camera_name)1278 u.press('back')1279 if u(resourceId="com.yoosee:id/ll_defence_state").wait_gone(timeout=3.0):1280 u.swipe_ext("down", scale=0.8)1281 u(resourceId='com.yoosee:id/ll_defence_state').wait(timeout=5)1282 if u(text='è¦æä¸').exists:1283 u(text='è¦æä¸').click(timeout=5)1284 sleep(3)1285 u.xpath(1286 '//*[@resource-id="com.yoosee:id/lv_contact"]/android.widget.RelativeLayout[1]/android.widget.LinearLayout[1]/android.widget.RelativeLayout[2]/android.widget.LinearLayout[1]').click(timeout=5)1287 sleep(5)1288 u(resourceId='com.yoosee:id/more_btn').click(timeout=5)1289 u(resourceId='com.yoosee:id/root_view')[1].click(timeout=5)1290 sleep(3)1291 u(resourceId='com.yoosee:id/root_view')[1].click(timeout=5)1292 sleep(3)1293 u(resourceId='com.yoosee:id/back_btn').click(timeout=5)1294 u(resourceId='com.yoosee:id/setting_more_iv').wait(timeout=5)1295 u.swipe_ext("down", scale=0.8)1296 u(resourceId='com.yoosee:id/ll_defence_state').wait(timeout=5)1297 assert u(resourceId="com.yoosee:id/tx_defence_state").get_text() == 'ä¸æ¥è¦', '设å¤æ¤éå¸é²ä¸æå'1298 sleep(2)1299 SameOperation().quit_app(u)1300 @classmethod1301 def jwt_57(cls, u, video_camera_name): #çæ§çé¢--æ¾ç¤ºå
¨å±æé®ï¼æ æä½5ç§åéèå1302 SameOperation().app_go(u)1303 if u(resourceId='com.yoosee:id/setting_more_iv').wait(timeout=5):1304 pass1305 else:1306 SameOperation().add_wired(u, video_camera_name)1307 u.press('back')1308 if u(resourceId="com.yoosee:id/ll_defence_state").wait_gone(timeout=3.0):1309 u.swipe_ext("down", scale=0.8)1310 u.xpath(1311 '//*[@resource-id="com.yoosee:id/lv_contact"]/android.widget.RelativeLayout[1]/android.widget.LinearLayout[1]/android.widget.RelativeLayout[2]/android.widget.LinearLayout[1]').click(1312 timeout=5)1313 u(resourceId="com.yoosee:id/iv_full_screen").wait(timeout=5)1314 sleep(5)1315 assert u(resourceId="com.yoosee:id/iv_full_screen").wait_gone(timeout=3.0),'æ æä½5ç§å没éè'1316 SameOperation().quit_app(u)1317 @classmethod1318 def jwt_58(cls, u, video_camera_name): #çæ§çé¢--åæ¢å°æ¨ªå±çæ§1319 SameOperation().app_go(u)1320 if u(resourceId='com.yoosee:id/setting_more_iv').wait(timeout=5):1321 pass1322 else:1323 SameOperation().add_wired(u, video_camera_name)1324 u.press('back')1325 if u(resourceId="com.yoosee:id/ll_defence_state").wait_gone(timeout=3.0):1326 u.swipe_ext("down", scale=0.8)1327 u.xpath(1328 '//*[@resource-id="com.yoosee:id/lv_contact"]/android.widget.RelativeLayout[1]/android.widget.LinearLayout[1]/android.widget.RelativeLayout[2]/android.widget.LinearLayout[1]').click(1329 timeout=5)1330 u(resourceId="com.yoosee:id/iv_full_screen").click(timeout=5)1331 assert u(resourceId='com.yoosee:id/iv_hangup').wait(timeout=5),'没æåæ¢æ¨ªå±'1332 SameOperation().quit_app(u)1333 @classmethod1334 def jwt_59(cls, u, video_camera_name): #çæ§çé¢--å½åæ¾ç¤ºæ£å¨å½åç¶æï¼REC1335 SameOperation().app_go(u)1336 if u(resourceId='com.yoosee:id/setting_more_iv').wait(timeout=5):1337 pass1338 else:1339 SameOperation().add_wired(u, video_camera_name)1340 u.press('back')1341 if u(resourceId="com.yoosee:id/ll_defence_state").wait_gone(timeout=3.0):1342 u.swipe_ext("down", scale=0.8)1343 u.xpath(1344 '//*[@resource-id="com.yoosee:id/lv_contact"]/android.widget.RelativeLayout[1]/android.widget.LinearLayout[1]/android.widget.RelativeLayout[2]/android.widget.LinearLayout[1]').click(1345 timeout=5)1346 u(resourceId="com.yoosee:id/iv_p_video").click(timeout=5)1347 sleep(2)1348 assert u(resourceId='com.yoosee:id/tx_rec').wait(timeout=5), '没ææ¾ç¤ºæ£å¨å½åç¶æï¼REC'1349 SameOperation().quit_app(u)1350 @classmethod1351 def jwt_60(cls, u, video_camera_name): #çæ§çé¢--å½åå°äº1ç§æ¶ï¼å次ç¹å»å½å1352 SameOperation().app_go(u)1353 if u(resourceId='com.yoosee:id/setting_more_iv').wait(timeout=5):1354 pass1355 else:1356 SameOperation().add_wired(u, video_camera_name)1357 u.press('back')1358 if u(resourceId="com.yoosee:id/ll_defence_state").wait_gone(timeout=3.0):1359 u.swipe_ext("down", scale=0.8)1360 u.xpath(1361 '//*[@resource-id="com.yoosee:id/lv_contact"]/android.widget.RelativeLayout[1]/android.widget.LinearLayout[1]/android.widget.RelativeLayout[2]/android.widget.LinearLayout[1]').click(1362 timeout=5)1363 sleep(3)1364 u(resourceId="com.yoosee:id/iv_p_video").click(timeout=5)1365 sleep(1)1366 u(resourceId="com.yoosee:id/iv_p_video").click(timeout=5)1367 # if "è§é¢ç段æ¶é´å¤ªçäº" in u.toast.get_message(5.0, 10.0, "default message"):1368 # print ('success')1369 # break1370 # elif short_i == 4:1371 # print('fail')1372 # assert "è§é¢ç段æ¶é´å¤ªçäº" in u.toast.get_message(5.0, 10.0, "default message"),'æ è§é¢å¤ªçæ示'1373 # sleep(1)1374 assert u(resourceId='com.yoosee:id/tx_rec').wait_gone(timeout=5),'åæ¢å½åäºï¼ä»æ¾ç¤ºæ£å¨å½åç¶æï¼REC'1375 SameOperation().quit_app(u)1376 @classmethod1377 def jwt_61(cls, u, video_camera_name): #çæ§çé¢--å½å大äº5ç§æ¶ï¼å次ç¹å»å½å1378 SameOperation().app_go(u)1379 if u(resourceId='com.yoosee:id/setting_more_iv').wait(timeout=5):1380 pass1381 else:1382 SameOperation().add_wired(u, video_camera_name)1383 u.press('back')1384 if u(resourceId="com.yoosee:id/ll_defence_state").wait_gone(timeout=3.0):1385 u.swipe_ext("down", scale=0.8)1386 u.xpath(1387 '//*[@resource-id="com.yoosee:id/lv_contact"]/android.widget.RelativeLayout[1]/android.widget.LinearLayout[1]/android.widget.RelativeLayout[2]/android.widget.LinearLayout[1]').click(1388 timeout=5)1389 sleep(3)1390 u(resourceId="com.yoosee:id/iv_p_video").click(timeout=5)1391 sleep(6)1392 u(resourceId="com.yoosee:id/iv_p_video").click(timeout=5)1393 assert u(resourceId='com.yoosee:id/tx_rec').wait_gone(timeout=5),'åæ¢å½åäºï¼ä»æ¾ç¤ºæ£å¨å½åç¶æï¼REC'1394 SameOperation().quit_app(u)1395 @classmethod1396 def jwt_62(cls, u, video_camera_name): #çæ§çé¢--æªå¾æååä¿å1397 SameOperation().app_go(u)1398 if u(resourceId='com.yoosee:id/setting_more_iv').wait(timeout=5):1399 pass1400 else:1401 SameOperation().add_wired(u, video_camera_name)1402 u.press('back')1403 if u(resourceId="com.yoosee:id/ll_defence_state").wait_gone(timeout=3.0):1404 u.swipe_ext("down", scale=0.8)1405 u.xpath(1406 '//*[@resource-id="com.yoosee:id/lv_contact"]/android.widget.RelativeLayout[1]/android.widget.LinearLayout[1]/android.widget.RelativeLayout[2]/android.widget.LinearLayout[1]').click(1407 timeout=5)1408 sleep(3)1409 u(resourceId="com.yoosee:id/iv_p_screenshot").click(timeout=5)1410 sleep(1)1411 assert "æªå¾æå" in u.toast.get_message(5.0, 10.0, "default message"),'没æ示æªå¾æå'1412 SameOperation().quit_app(u)1413 @classmethod1414 def jwt_63(cls, u, video_camera_name): #çæ§çé¢--å·¦ä¸è§ææªå¾ç¼©ç¥å¾1415 SameOperation().app_go(u)1416 if u(resourceId='com.yoosee:id/setting_more_iv').wait(timeout=5):1417 pass1418 else:1419 SameOperation().add_wired(u, video_camera_name)1420 u.press('back')1421 if u(resourceId="com.yoosee:id/ll_defence_state").wait_gone(timeout=3.0):1422 u.swipe_ext("down", scale=0.8)1423 u.xpath(1424 '//*[@resource-id="com.yoosee:id/lv_contact"]/android.widget.RelativeLayout[1]/android.widget.LinearLayout[1]/android.widget.RelativeLayout[2]/android.widget.LinearLayout[1]').click(1425 timeout=5)1426 sleep(3)1427 u(resourceId="com.yoosee:id/iv_p_screenshot").click(timeout=5)1428 assert u.xpath('//*[@resource-id="com.yoosee:id/layout_p2p"]/android.widget.ImageView[1]').wait(1429 timeout=8), 'å·¦ä¸è§æ²¡æ¾ç¤ºæªå¾ç¼©ç¥å¾'1430 SameOperation().quit_app(u)1431 @classmethod1432 def jwt_64(cls, u, video_camera_name): #çæ§çé¢--ç¹å»å¯ä»¥æ¥çæªå¾å¤§å¾1433 SameOperation().app_go(u)1434 if u(resourceId='com.yoosee:id/setting_more_iv').wait(timeout=5):1435 pass1436 else:1437 SameOperation().add_wired(u, video_camera_name)1438 u.press('back')1439 if u(resourceId="com.yoosee:id/ll_defence_state").wait_gone(timeout=3.0):1440 u.swipe_ext("down", scale=0.8)1441 u.xpath(1442 '//*[@resource-id="com.yoosee:id/lv_contact"]/android.widget.RelativeLayout[1]/android.widget.LinearLayout[1]/android.widget.RelativeLayout[2]/android.widget.LinearLayout[1]').click(1443 timeout=5)1444 sleep(3)1445 u(resourceId="com.yoosee:id/iv_p_screenshot").click(timeout=5)1446 u.xpath('//*[@resource-id="com.yoosee:id/layout_p2p"]/android.widget.ImageView[1]').click(timeout=5)1447 assert u(resourceId="com.yoosee:id/tv_imagegallay_filesize").wait(timeout=5), 'ç¹å»æ²¡è½æå¼æ¥çæªå¾å¤§å¾'1448 SameOperation().quit_app(u)1449 @classmethod1450 def jwt_65(cls, u, video_camera_name): #çæ§çé¢--æ ç¹å»æä½3ç§åéèæªå¾1451 SameOperation().app_go(u)1452 if u(resourceId='com.yoosee:id/setting_more_iv').wait(timeout=5):1453 pass1454 else:1455 SameOperation().add_wired(u, video_camera_name)1456 u.press('back')1457 if u(resourceId="com.yoosee:id/ll_defence_state").wait_gone(timeout=3.0):1458 u.swipe_ext("down", scale=0.8)1459 u.xpath(1460 '//*[@resource-id="com.yoosee:id/lv_contact"]/android.widget.RelativeLayout[1]/android.widget.LinearLayout[1]/android.widget.RelativeLayout[2]/android.widget.LinearLayout[1]').click(1461 timeout=5)1462 sleep(3)1463 u(resourceId="com.yoosee:id/iv_p_screenshot").click(timeout=5)1464 sleep(3)1465 assert u.xpath('//*[@resource-id="com.yoosee:id/layout_p2p"]/android.widget.ImageView[1]').wait_gone(1466 timeout=3), 'å·¦ä¸è§æ²¡æ¾ç¤ºæªå¾ç¼©ç¥å¾'1467 SameOperation().quit_app(u)1468 @classmethod1469 def jwt_66(cls, u, video_camera_name): #å¿«æ·å
¥å£--æ¶é´è½´æ¥æå½åææ¾çå½ååæ¢å°å¦ä¸å¤©çå½å1470 SameOperation().app_go(u)1471 if u(resourceId='com.yoosee:id/setting_more_iv').wait(timeout=5):1472 pass1473 else:1474 SameOperation().add_wired(u, video_camera_name)1475 u.press('back')1476 if u(resourceId="com.yoosee:id/ll_defence_state").wait_gone(timeout=3.0):1477 u.swipe_ext("down", scale=0.8)1478 u(resourceId="com.yoosee:id/ll_playback").click(timeout=5)1479 u(resourceId="com.yoosee:id/tv_sdcard_playback").click(timeout=5)1480 u(resourceId="com.yoosee:id/fl_videoplayer_parent").wait(timeout=5)1481 u(resourceId='com.yoosee:id/date_tv')[2].click(timeout=5)1482 sleep(6)1483 if u(text="ææ å½å").wait(timeout=5):1484 pass1485 else:1486 if u(resourceId="com.yoosee:id/rl_functin_bar").wait_gone(timeout=3.0):1487 u(resourceId="com.yoosee:id/rl_vedioplayer_area").click(timeout=5)1488 sleep(1)1489 play_status = u(resourceId="com.yoosee:id/iv_playback_fast").info1490 sleep(3)1491 assert play_status['enabled'] == True, 'åæ¢å°å¦ä¸å¤©å½å没æèªå¨ææ¾'1492 SameOperation().quit_app(u)1493 @classmethod1494 def jwt_67(cls, u, video_camera_name): #å¿«æ·å
¥å£--æ¨ªå± - æåé®åæææ¾é®1495 SameOperation().app_go(u)1496 if u(resourceId='com.yoosee:id/setting_more_iv').wait(timeout=5):1497 pass1498 else:1499 SameOperation().add_wired(u, video_camera_name)1500 u.press('back')1501 if u(resourceId="com.yoosee:id/ll_defence_state").wait_gone(timeout=3.0):1502 u.swipe_ext("down", scale=0.8)1503 u(resourceId="com.yoosee:id/ll_playback").click(timeout=5)1504 u(resourceId="com.yoosee:id/tv_sdcard_playback").click(timeout=5)1505 sleep(5)1506 if not u(resourceId="com.yoosee:id/iv_playback_fast").exists:1507 u(resourceId="com.yoosee:id/rl_vedioplayer_area").click(timeout=5)1508 sleep(1)1509 #ç«å±æ¶æ¶é´è½´1510 timeline_icon_coordinates = u(resourceId='com.yoosee:id/fl_videoplayer_parent').center()1511 u(resourceId="com.yoosee:id/iv_half_screen").click(timeout=5)1512 if u(resourceId="com.yoosee:id/ll_landscape_timeline").wait_gone(timeout=3.0):1513 # u.xpath('//android.widget.FrameLayout[1]').click(timeout=5)1514 u.click(timeline_icon_coordinates[0], timeline_icon_coordinates[1])1515 sleep(1)1516 u(resourceId="com.yoosee:id/iv_playback_fast_landscape").wait(timeout=5)1517 play_status = u(resourceId="com.yoosee:id/iv_playback_fast_landscape").info1518 sleep(1)1519 if play_status['enabled'] == True:1520 u(resourceId="com.yoosee:id/play_land_iv").click(timeout=5)1521 sleep(1)1522 play_status = u(resourceId="com.yoosee:id/iv_playback_fast_landscape").info1523 assert play_status['enabled'] == False, 'ä»å¨ææ¾'1524 SameOperation().quit_app(u)1525 @classmethod1526 def jwt_68(cls, u, video_camera_name): #å¿«æ·å
¥å£--æ¨ªå± - å½åæåï¼æ¶é´è½´ä¸å¨1527 SameOperation().app_go(u)1528 if u(resourceId='com.yoosee:id/setting_more_iv').wait(timeout=5):1529 pass1530 else:1531 SameOperation().add_wired(u, video_camera_name)1532 u.press('back')1533 if u(resourceId="com.yoosee:id/ll_defence_state").wait_gone(timeout=3.0):1534 u.swipe_ext("down", scale=0.8)1535 u(resourceId="com.yoosee:id/ll_playback").click(timeout=5)1536 u(resourceId="com.yoosee:id/tv_sdcard_playback").click(timeout=5)1537 sleep(5)1538 if not u(resourceId="com.yoosee:id/iv_playback_fast").exists:1539 u(resourceId="com.yoosee:id/rl_vedioplayer_area").click(timeout=5)1540 sleep(1)1541 # ç«å±æ¶æ¶é´è½´1542 timeline_icon_coordinates = u(resourceId='com.yoosee:id/fl_videoplayer_parent').center()1543 u(resourceId="com.yoosee:id/iv_half_screen").click(timeout=5)1544 if u(resourceId="com.yoosee:id/ll_landscape_timeline").wait_gone(timeout=3.0):1545 # u.xpath('//android.widget.FrameLayout[1]').click(timeout=5)1546 u.click(timeline_icon_coordinates[0], timeline_icon_coordinates[1])1547 sleep(1)1548 u(resourceId="com.yoosee:id/iv_playback_fast_landscape").wait(timeout=5)1549 play_status = u(resourceId="com.yoosee:id/iv_playback_fast_landscape").info1550 sleep(1)1551 if play_status['enabled'] == True:1552 u(resourceId="com.yoosee:id/play_land_iv").click(timeout=5)1553 sleep(1)1554 im_1 = u(resourceId="com.yoosee:id/ll_landscape_timeline").screenshot()1555 im_1.save("timeline_1.jpg")1556 sleep(10)1557 im_2 = u(resourceId="com.yoosee:id/ll_landscape_timeline").screenshot()1558 im_2.save("timeline_2.jpg")1559 im_same = SameOperation().img_statuscheck("timeline_1.jpg","timeline_2.jpg")1560 # print (im_same)1561 assert im_same == 0.0,'å½åæåæ¶é´è½´æå¨'1562 SameOperation().quit_app(u)1563 @classmethod1564 def jwt_69(cls, u, video_camera_name): #å¿«æ·å
¥å£--æ¨ªå± - æåé®åæææ¾é®1565 SameOperation().app_go(u)1566 if u(resourceId='com.yoosee:id/setting_more_iv').wait(timeout=5):1567 pass1568 else:1569 SameOperation().add_wired(u, video_camera_name)1570 u.press('back')1571 if u(resourceId="com.yoosee:id/ll_defence_state").wait_gone(timeout=3.0):1572 u.swipe_ext("down", scale=0.8)1573 u(resourceId="com.yoosee:id/ll_playback").click(timeout=5)1574 u(resourceId="com.yoosee:id/tv_sdcard_playback").click(timeout=5)1575 sleep(5)1576 if not u(resourceId="com.yoosee:id/iv_playback_fast").exists:1577 u(resourceId="com.yoosee:id/rl_vedioplayer_area").click(timeout=5)1578 sleep(1)1579 # ç«å±æ¶æ¶é´è½´1580 timeline_icon_coordinates = u(resourceId='com.yoosee:id/fl_videoplayer_parent').center()1581 u(resourceId="com.yoosee:id/iv_half_screen").click(timeout=5)1582 if u(resourceId="com.yoosee:id/ll_landscape_timeline").wait_gone(timeout=3.0):1583 # u.xpath('//android.widget.FrameLayout[1]').click(timeout=5)1584 u.click(timeline_icon_coordinates[0], timeline_icon_coordinates[1])1585 sleep(1)1586 u(resourceId="com.yoosee:id/iv_playback_fast_landscape").wait(timeout=5)1587 play_status = u(resourceId="com.yoosee:id/iv_playback_fast_landscape").info1588 sleep(1)1589 if play_status['enabled'] == True:1590 u(resourceId="com.yoosee:id/play_land_iv").click(timeout=5)1591 sleep(1)1592 u(resourceId="com.yoosee:id/play_land_iv").click(timeout=5)1593 sleep(1)1594 play_status = u(resourceId="com.yoosee:id/iv_playback_fast_landscape").info1595 assert play_status['enabled'] == True, '没æææ¾'1596 SameOperation().quit_app(u)1597 @classmethod1598 def jwt_70(cls, u, video_camera_name): #å¿«æ·å
¥å£--æ¨ªå± - å½åæåï¼æ¶é´è½´ä¸å¨1599 SameOperation().app_go(u)1600 if u(resourceId='com.yoosee:id/setting_more_iv').wait(timeout=5):1601 pass1602 else:1603 SameOperation().add_wired(u, video_camera_name)1604 u.press('back')1605 if u(resourceId="com.yoosee:id/ll_defence_state").wait_gone(timeout=3.0):1606 u.swipe_ext("down", scale=0.8)1607 u(resourceId="com.yoosee:id/ll_playback").click(timeout=5)1608 u(resourceId="com.yoosee:id/tv_sdcard_playback").click(timeout=5)1609 sleep(5)1610 if not u(resourceId="com.yoosee:id/iv_playback_fast").exists:1611 u(resourceId="com.yoosee:id/rl_vedioplayer_area").click(timeout=5)1612 sleep(1)1613 # ç«å±æ¶æ¶é´è½´1614 timeline_icon_coordinates = u(resourceId='com.yoosee:id/fl_videoplayer_parent').center()1615 u(resourceId="com.yoosee:id/iv_half_screen").click(timeout=5)1616 if u(resourceId="com.yoosee:id/ll_landscape_timeline").wait_gone(timeout=3.0):1617 # u.xpath('//android.widget.FrameLayout[1]').click(timeout=5)1618 u.click(timeline_icon_coordinates[0], timeline_icon_coordinates[1])1619 sleep(1)1620 u(resourceId="com.yoosee:id/iv_playback_fast_landscape").wait(timeout=5)1621 play_status = u(resourceId="com.yoosee:id/iv_playback_fast_landscape").info1622 sleep(1)1623 if play_status['enabled'] == True:1624 u(resourceId="com.yoosee:id/play_land_iv").click(timeout=5)1625 sleep(1)1626 u(resourceId="com.yoosee:id/play_land_iv").click(timeout=5)1627 sleep(2)1628 im_1 = u(resourceId="com.yoosee:id/ll_landscape_timeline").screenshot()1629 im_1.save("timeline_1.jpg")1630 sleep(10)1631 im_2 = u(resourceId="com.yoosee:id/ll_landscape_timeline").screenshot()1632 im_2.save("timeline_2.jpg")1633 im_same = SameOperation().img_statuscheck("timeline_1.jpg","timeline_2.jpg")1634 # print (im_same)1635 assert im_same > 0.0,'å½åæ¶é´è½´æå¨'1636 SameOperation().quit_app(u)1637 @classmethod1638 def jwt_71(cls, u, video_camera_name): #å¿«æ·å
¥å£--ç«å± - å½å±ç¹å»å½å±åæ§ä»¶ä¸æå°çº¢ç¹1639 SameOperation().app_go(u)1640 if u(resourceId='com.yoosee:id/setting_more_iv').wait(timeout=5):1641 pass1642 else:1643 SameOperation().add_wired(u, video_camera_name)1644 u.press('back')1645 if u(resourceId="com.yoosee:id/ll_defence_state").wait_gone(timeout=3.0):1646 u.swipe_ext("down", scale=0.8)1647 u(resourceId="com.yoosee:id/ll_playback").wait(timeout=5)1648 u(resourceId="com.yoosee:id/ll_playback").click(timeout=5)1649 u(resourceId="com.yoosee:id/tv_sdcard_playback").click(timeout=5)1650 sleep(10)1651 if not u(resourceId="com.yoosee:id/iv_playback_fast").exists:1652 u(resourceId="com.yoosee:id/rl_vedioplayer_area").click(timeout=5)1653 sleep(1)1654 u(resourceId="com.yoosee:id/iv_playback_to_dwonload").click(timeout=5)1655 sleep(2)1656 #æ§ä»¶ä¸å°çº¢ç¹1657 assert u(resourceId='com.yoosee:id/iv_state').wait(timeout=8), 'æ§ä»¶æ²¡æå°çº¢ç¹'1658 SameOperation().quit_app(u)1659 @classmethod1660 def jwt_72(cls, u, video_camera_name): #å¿«æ·å
¥å£--ç«å± - å½å±ç»æåå¯å¨æçç¸åä¸ææ¾1661 SameOperation().app_go(u)1662 if u(resourceId='com.yoosee:id/setting_more_iv').wait(timeout=5):1663 pass1664 else:1665 SameOperation().add_wired(u, video_camera_name)1666 # print ('2')1667 if not u(resourceId='com.yoosee:id/setting_more_iv').wait(timeout=5):1668 u.press('back')1669 if u(resourceId="com.yoosee:id/ll_defence_state").wait_gone(timeout=3.0):1670 u.swipe_ext("down", scale=0.8)1671 SameOperation().photo_delete(u)1672 u(resourceId="com.yoosee:id/ll_playback").click(timeout=5)1673 u(resourceId="com.yoosee:id/tv_sdcard_playback").click(timeout=5)1674 sleep(10)1675 if not u(resourceId="com.yoosee:id/iv_playback_fast").exists:1676 u(resourceId="com.yoosee:id/rl_vedioplayer_area").click(timeout=5)1677 sleep(1)1678 u(resourceId="com.yoosee:id/iv_playback_to_dwonload").click(timeout=5)1679 sleep(10)1680 u(resourceId="com.yoosee:id/iv_playback_to_dwonload").click(timeout=5)1681 u.press('back')1682 u(resourceId='com.yoosee:id/icon_setting_img').click(timeout=5)1683 u(resourceId='com.yoosee:id/icon_setting_img').click(timeout=5)1684 u(resourceId='com.yoosee:id/rl_album_low').click(timeout=5)1685 u(resourceId='com.yoosee:id/iv_play').click(timeout=5)1686 u.xpath(1687 '//*[@resource-id="com.yoosee:id/viewer"]/android.widget.RelativeLayout[1]/android.widget.ImageView[2]').click(timeout=5)1688 sleep(2)1689 assert u(resourceId='com.yoosee:id/v_play').wait(timeout=5), 'ä¸è½ææ¾'1690 SameOperation().quit_app(u)1691 @classmethod1692 def jwt_73(cls, u, video_camera_name): #å¿«æ·å
¥å£è´¦æ·å享æ¾ç¤ºè®¿å®¢ç¨æ·ç头åï¼æµç§°ä»¥åæç头账å·1693 SameOperation().app_go(u)1694 # å
å¤æå享çè´¦å·æ¯å¦å·²æ·»å å享ç设å¤1695 SameOperation().log_out(u)1696 sleep(3)1697 SameOperation().log_in(u, "gw_test01@sina.com", "abcd1234")1698 sleep(3)1699 if u(resourceId='com.yoosee:id/ll_device').wait(timeout=5):1700 u.press("back")1701 SameOperation().find_deldevices(u, 'å é¤è®¾å¤')1702 if u(text='å é¤è®¾å¤').wait(timeout=5):1703 u(text='å é¤è®¾å¤').click(timeout=5)1704 u(resourceId='com.yoosee:id/tv_yes').click(timeout=5)1705 SameOperation().log_out(u)1706 sleep(3)1707 SameOperation().log_in(u, phone_num, phone_pwd)1708 if u(resourceId='com.yoosee:id/setting_more_iv').wait(timeout=5):1709 pass1710 else:1711 SameOperation().add_wired(u, video_camera_name)1712 u.press('back')1713 if u(resourceId="com.yoosee:id/ll_defence_state").wait_gone(timeout=3.0):1714 u.swipe_ext("down", scale=0.8)1715 # u(resourceId='com.yoosee:id/setting_more_iv').wait(timeout=5)1716 # u(resourceId='com.yoosee:id/setting_more_iv').click(timeout=5)1717 # u(resourceId='com.yoosee:id/pop_share_ll').click(timeout=5)1718 # u(resourceId='com.yoosee:id/account_share_tv').click(timeout=5)1719 # u(resourceId='com.yoosee:id/tx_save').click(timeout=5)1720 # u.xpath("//android.widget.LinearLayout[1]/android.widget.LinearLayout[1]/android.widget.RelativeLayout[2]").set_text("gw_test01@sina.com")1721 # u(resourceId='com.yoosee:id/confirm_btn').click(timeout=5)1722 # u(resourceId='com.yoosee:id/share_confirm_ll').click(timeout=8)1723 # sleep(3)1724 SameOperation().account_sharing(u)1725 assert u(resourceId='com.yoosee:id/account_tv').get_text() == 'gw_test01@sina.com' and u(resourceId='com.yoosee:id/share_account_tv').get_text() == 'æç头账å·:025611668','æµç§°ä»¥åæç头账å·ä¸æ£ç¡®'1726 SameOperation().quit_app(u)1727 @classmethod1728 def jwt_74(cls, u, video_camera_name): #å¿«æ·å
¥å£è´¦æ·å享æ示已åéå享é请1729 SameOperation().app_go(u)1730 # å
å¤æå享çè´¦å·æ¯å¦å·²æ·»å å享ç设å¤1731 SameOperation().log_out(u)1732 sleep(3)1733 SameOperation().log_in(u, "gw_test01@sina.com", "abcd1234")1734 sleep(3)1735 if u(resourceId='com.yoosee:id/ll_device').wait(timeout=5):1736 u.press("back")1737 SameOperation().find_deldevices(u, 'å é¤è®¾å¤')1738 if u(text='å é¤è®¾å¤').wait(timeout=5):1739 u(text='å é¤è®¾å¤').click(timeout=5)1740 u(resourceId='com.yoosee:id/tv_yes').click(timeout=5)1741 SameOperation().log_out(u)1742 sleep(3)1743 SameOperation().log_in(u, phone_num, phone_pwd)1744 if u(resourceId='com.yoosee:id/setting_more_iv').wait(timeout=5):1745 pass1746 else:1747 SameOperation().add_wired(u, video_camera_name)1748 u.press('back')1749 if u(resourceId="com.yoosee:id/ll_defence_state").wait_gone(timeout=3.0):1750 u.swipe_ext("down", scale=0.8)1751 # u(resourceId='com.yoosee:id/setting_more_iv').click(timeout=5)1752 # u(resourceId='com.yoosee:id/pop_share_ll').click(timeout=5)1753 # u(resourceId='com.yoosee:id/account_share_tv').click(timeout=5)1754 # u(resourceId='com.yoosee:id/tx_save').click(timeout=5)1755 # u.xpath("//android.widget.LinearLayout[1]/android.widget.LinearLayout[1]/android.widget.RelativeLayout[2]").set_text("gw_test01@sina.com")1756 # u(resourceId='com.yoosee:id/confirm_btn').click(timeout=5)1757 # u(resourceId='com.yoosee:id/share_confirm_ll').click(timeout=8)1758 # sleep(3)1759 SameOperation().account_sharing(u)1760 assert u(text='å·²åéå享é请').wait(timeout=5),'没ææ示已åéå享é请'1761 SameOperation().quit_app(u)1762 @classmethod1763 def jwt_75(cls, u, video_camera_name): #å¿«æ·å
¥å£è´¦æ·å享访客账å·å¯å¨è®¾å¤å表ä¸çå°å享弹çªã1764 SameOperation().app_go(u)1765 # å
å¤æå享çè´¦å·æ¯å¦å·²æ·»å å享ç设å¤1766 SameOperation().log_out(u)1767 sleep(3)1768 SameOperation().log_in(u, "gw_test01@sina.com", "abcd1234")1769 sleep(3)1770 if u(resourceId='com.yoosee:id/ll_device').wait(timeout=5):1771 u.press("back")1772 SameOperation().find_deldevices(u, 'å é¤è®¾å¤')1773 if u(text='å é¤è®¾å¤').wait(timeout=5):1774 u(text='å é¤è®¾å¤').click(timeout=5)1775 u(resourceId='com.yoosee:id/tv_yes').click(timeout=5)1776 SameOperation().log_out(u)1777 sleep(3)1778 SameOperation().log_in(u, phone_num, phone_pwd)1779 if u(resourceId='com.yoosee:id/setting_more_iv').wait(timeout=5):1780 pass1781 else:1782 SameOperation().add_wired(u, video_camera_name)1783 u.press('back')1784 if u(resourceId="com.yoosee:id/ll_defence_state").wait_gone(timeout=3.0):1785 u.swipe_ext("down", scale=0.8)1786 SameOperation().account_sharing(u)1787 SameOperation().log_out(u)1788 sleep(3)1789 SameOperation().log_in(u,"gw_test01@sina.com","abcd1234")1790 sleep(3)1791 assert u(resourceId='com.yoosee:id/ll_device').wait(timeout=8), '没ææ¶å°å享弹çªã'1792 SameOperation().quit_app(u)1793 @classmethod1794 def jwt_76(cls, u, video_camera_name): #å¿«æ·å
¥å£è´¦æ·å享弹æ¡æ示âæ¶å°xxxxçå享âã1795 SameOperation().app_go(u)1796 # å
å¤æå享çè´¦å·æ¯å¦å·²æ·»å å享ç设å¤1797 SameOperation().log_out(u)1798 sleep(3)1799 SameOperation().log_in(u, "gw_test01@sina.com", "abcd1234")1800 sleep(3)1801 if u(resourceId='com.yoosee:id/ll_device').wait(timeout=5):1802 u.press("back")1803 SameOperation().find_deldevices(u, 'å é¤è®¾å¤')1804 if u(text='å é¤è®¾å¤').wait(timeout=5):1805 u(text='å é¤è®¾å¤').click(timeout=5)1806 u(resourceId='com.yoosee:id/tv_yes').click(timeout=5)1807 SameOperation().log_out(u)1808 sleep(3)1809 SameOperation().log_in(u, phone_num, phone_pwd)1810 if u(resourceId='com.yoosee:id/setting_more_iv').wait(timeout=5):1811 pass1812 else:1813 SameOperation().add_wired(u, video_camera_name)1814 u.press('back')1815 if u(resourceId="com.yoosee:id/ll_defence_state").wait_gone(timeout=3.0):1816 u.swipe_ext("down", scale=0.8)1817 SameOperation().account_sharing(u)1818 SameOperation().log_out(u)1819 sleep(3)1820 SameOperation().log_in(u,"gw_test01@sina.com","abcd1234")1821 sleep(3)1822 assert 'åä½ å享äºä¸å°æåæº' in u(resourceId='com.yoosee:id/content_tv').get_text(), '没ææ¶å°å¥½åçå享'1823 SameOperation().quit_app(u)1824 @classmethod1825 def jwt_77(cls, u, video_camera_name): #å¿«æ·å
¥å£è´¦æ·å享å享弹çªç¹å»å¿½ç¥å¼¹æ¡æ¶å¤±ã1826 SameOperation().app_go(u)1827 # å
å¤æå享çè´¦å·æ¯å¦å·²æ·»å å享ç设å¤1828 SameOperation().log_out(u)1829 sleep(3)1830 SameOperation().log_in(u, "gw_test01@sina.com", "abcd1234")1831 sleep(3)1832 if u(resourceId='com.yoosee:id/ll_device').wait(timeout=5):1833 u.press("back")1834 SameOperation().find_deldevices(u, 'å é¤è®¾å¤')1835 if u(text='å é¤è®¾å¤').wait(timeout=5):1836 u(text='å é¤è®¾å¤').click(timeout=5)1837 u(resourceId='com.yoosee:id/tv_yes').click(timeout=5)1838 SameOperation().log_out(u)1839 sleep(3)1840 SameOperation().log_in(u, phone_num, phone_pwd)1841 if u(resourceId='com.yoosee:id/setting_more_iv').wait(timeout=5):1842 pass1843 else:1844 SameOperation().add_wired(u, video_camera_name)1845 u.press('back')1846 if u(resourceId="com.yoosee:id/ll_defence_state").wait_gone(timeout=3.0):1847 u.swipe_ext("down", scale=0.8)1848 SameOperation().account_sharing(u)1849 SameOperation().log_out(u)1850 sleep(3)1851 SameOperation().log_in(u,"gw_test01@sina.com","abcd1234")1852 sleep(6)1853 u(text='忽ç¥').click(timeout=5)1854 assert u(resourceId="com.yoosee:id/ll_defence_state").wait_gone(timeout=3.0), 'ç¹å»å¿½ç¥å¼¹æ¡æªæ¶å¤±'1855 SameOperation().quit_app(u)1856 @classmethod1857 def jwt_78(cls, u, video_camera_name): #å¿«æ·å
¥å£è´¦æ·å享跳转å°âæ·»å 设å¤çé¢â1858 SameOperation().app_go(u)1859 #å
å¤æå享çè´¦å·æ¯å¦å·²æ·»å å享ç设å¤1860 SameOperation().log_out(u)1861 sleep(3)1862 SameOperation().log_in(u, "gw_test01@sina.com", "abcd1234")1863 sleep(3)1864 if u(resourceId='com.yoosee:id/ll_device').wait(timeout=5):1865 u.press("back")1866 SameOperation().find_deldevices(u,'å é¤è®¾å¤')1867 if u(text='å é¤è®¾å¤').wait(timeout=5):1868 u(text='å é¤è®¾å¤').click(timeout=5)1869 u(resourceId='com.yoosee:id/tv_yes').click(timeout=5)1870 SameOperation().log_out(u)1871 sleep(3)1872 SameOperation().log_in(u, phone_num, phone_pwd)1873 if u(resourceId='com.yoosee:id/setting_more_iv').wait(timeout=5):1874 pass1875 else:1876 SameOperation().add_wired(u, video_camera_name)1877 u.press('back')1878 if u(resourceId="com.yoosee:id/ll_defence_state").wait_gone(timeout=3.0):1879 u.swipe_ext("down", scale=0.8)1880 SameOperation().account_sharing(u)1881 SameOperation().log_out(u)1882 sleep(3)1883 SameOperation().log_in(u,"gw_test01@sina.com","abcd1234")1884 sleep(3)1885 u(text='æ¥å').click(timeout=5)1886 assert u(text='æ·»å æå').wait(timeout=5), '没æ跳转å°âæ·»å 设å¤çé¢â'1887 SameOperation().quit_app(u)1888 @classmethod1889 def jwt_79(cls, u,video_camera_name): # 设å¤å级弹æ¡ï¼å¼¹åºå级设å¤çå¼¹æ¡1890 u.app_clear('com.yoosee') # æ¸
é¤åºç¨æ°æ®1891 SameOperation().app_go(u)1892 SameOperation().log_in(u, phone_num, phone_pwd)1893 assert u(text='åç°æ°åºä»¶').wait(timeout=10),'没æå级设å¤çå¼¹æ¡'1894 u.press("back")1895 sleep(6)1896 SameOperation().quit_app(u)1897 @classmethod1898 def jwt_80(cls, u, video_camera_name): # 设å¤å级弹æ¡ï¼ç¹å»ç«å³æ´æ°ï¼å级设å¤1899 u.app_clear('com.yoosee') # æ¸
é¤åºç¨æ°æ®1900 SameOperation().app_go(u)1901 SameOperation().log_in(u, phone_num, phone_pwd)1902 u(text='ç«å³æ´æ°').wait(timeout=10)1903 u(text='ç«å³æ´æ°').click()1904 assert u(text='æåæºå级ä¸â¦').wait(timeout=10), '没æå级ä¸'1905 sleep(180)1906 SameOperation().quit_app(u)1907 @classmethod1908 def jwt_81(cls, u, video_camera_name): # 设å¤å级弹æ¡ï¼ç¹å»åå°å级1909 u.app_clear('com.yoosee') # æ¸
é¤åºç¨æ°æ®1910 SameOperation().app_go(u)1911 SameOperation().log_in(u, phone_num, phone_pwd)1912 u(text='ç«å³æ´æ°').wait(timeout=10)1913 u(text='ç«å³æ´æ°').click()1914 sleep(2)1915 u(resourceId='com.yoosee:id/tv_know').click(timeout=5)1916 u(resourceId='com.yoosee:id/tv_background').click(timeout=5)1917 sleep(1)1918 u(resourceId='com.yoosee:id/icon_contact').click(timeout=5)1919 sleep(20)1920 for offline_1 in range(10):1921 u.swipe_ext("down", scale=0.8)1922 sleep(6)1923 if u(resourceId="com.yoosee:id/tv_offline").wait(timeout=8.0):1924 break1925 for offline_2 in range(20):1926 u.swipe_ext("down", scale=0.8)1927 sleep(6)1928 if not u(resourceId="com.yoosee:id/tv_offline").exists:1929 break1930 assert not u(resourceId="com.yoosee:id/tv_offline").exists,'(çäº3åé)设å¤è¿æ¯ç¦»çº¿'1931 SameOperation().quit_app(u)1932 @classmethod1933 def jwt_82(cls, u, video_camera_name): # 设å¤å级弹æ¡ï¼ç¹å»å¼¹æ¡å³ä¸è§âÃâ1934 u.app_clear('com.yoosee') # æ¸
é¤åºç¨æ°æ®1935 SameOperation().app_go(u)1936 SameOperation().log_in(u, phone_num, phone_pwd)1937 u(text='ç«å³æ´æ°').wait(timeout=10)1938 u(resourceId='com.yoosee:id/iv_close_device_update').click(timeout=5)1939 sleep(2)1940 assert not u(text="åç°æ°åºä»¶").exists, 'ç¹å»å¼¹æ¡å³ä¸è§âÃâï¼å¼¹æ¡æ²¡æ¶å¤±'1941 SameOperation().quit_app(u)1942 @classmethod1943 def jwt_83(cls, u,video_camera_name): # 设å¤å表æµå°ææ°ç设å¤åºä»¶ä¸è®¾å¤å表æå¼¹çªæ示1944 u.app_clear('com.yoosee') # æ¸
é¤åºç¨æ°æ®1945 SameOperation().app_go(u)1946 SameOperation().log_in(u, phone_num, phone_pwd)1947 assert u(text='åç°æ°åºä»¶').wait(timeout=10),'设å¤å表没æå级设å¤çå¼¹æ¡'1948 u.press("back")1949 sleep(6)1950 SameOperation().quit_app(u)1951 @classmethod1952 def jwt_84(cls, u, video_camera_name): # 设å¤å表å¯ä»¥æ£å¸¸å级设å¤åºä»¶1953 u.app_clear('com.yoosee') # æ¸
é¤åºç¨æ°æ®1954 SameOperation().app_go(u)1955 SameOperation().log_in(u, phone_num, phone_pwd)1956 u(text='ç«å³æ´æ°').wait(timeout=10)1957 u(text='ç«å³æ´æ°').click()1958 sleep(2)1959 u(resourceId='com.yoosee:id/tv_know').click(timeout=5)1960 u(resourceId='com.yoosee:id/tv_background').click(timeout=5)1961 sleep(1)1962 u(resourceId='com.yoosee:id/icon_contact').click(timeout=5)1963 sleep(20)1964 for offline_1 in range(10):1965 u.swipe_ext("down", scale=0.8)1966 sleep(6)1967 if u(resourceId="com.yoosee:id/tv_offline").wait(timeout=8.0):1968 break1969 for offline_2 in range(20):1970 u.swipe_ext("down", scale=0.8)1971 sleep(6)1972 if not u(resourceId="com.yoosee:id/tv_offline").exists:1973 break1974 assert not u(resourceId="com.yoosee:id/tv_offline").exists,'(çäº3åé)设å¤è¿æ¯ç¦»çº¿'1975 SameOperation().quit_app(u)1976 @classmethod1977 def jwt_85(cls, u, video_camera_name): #设置-ç½ç»è®¾å¤è®¾ç½®é¡µé¢ï¼ç¹å»âåºä»¶æ´æ°âå¼¹åºå¼¹çª1978 SameOperation().app_go(u)1979 if u(resourceId='com.yoosee:id/setting_more_iv').wait(timeout=5):1980 pass1981 else:1982 SameOperation().add_wired(u, video_camera_name)1983 u.press('back')1984 if u(resourceId="com.yoosee:id/ll_defence_state").wait_gone(timeout=3.0):1985 u.swipe_ext("down", scale=0.8)1986 SameOperation().find_deldevices(u, 'åºä»¶æ´æ°')1987 u(resourceId='com.yoosee:id/check_device_update').click(timeout=5)1988 assert u(text='åç°æ°åºä»¶').wait(timeout=6),'没æå级设å¤çå¼¹æ¡'1989 SameOperation().quit_app(u)1990 @classmethod1991 def jwt_86(cls, u, video_camera_name): #设置-ç½ç»è®¾å¤è®¾ç½®é¡µé¢æ£å¸¸å级设å¤åºä»¶1992 SameOperation().app_go(u)1993 if u(resourceId='com.yoosee:id/setting_more_iv').wait(timeout=5):1994 pass1995 else:1996 SameOperation().add_wired(u, video_camera_name)1997 u.press('back')1998 if u(resourceId="com.yoosee:id/ll_defence_state").wait_gone(timeout=3.0):1999 u.swipe_ext("down", scale=0.8)2000 SameOperation().find_deldevices(u, 'åºä»¶æ´æ°')2001 u(resourceId='com.yoosee:id/check_device_update').click(timeout=5)2002 u(text='ç«å³æ´æ°').click()2003 sleep(2)2004 u(resourceId='com.yoosee:id/tv_know').click(timeout=5)2005 u(resourceId='com.yoosee:id/tv_background').click(timeout=5)2006 sleep(2)2007 u.press('back')2008 sleep(20)2009 for offline_1 in range(10):2010 u.swipe_ext("down", scale=0.8)2011 sleep(6)2012 if u(resourceId="com.yoosee:id/tv_offline").wait(timeout=8.0):2013 break2014 for offline_2 in range(20):2015 u.swipe_ext("down", scale=0.8)2016 sleep(6)2017 if not u(resourceId="com.yoosee:id/tv_offline").exists:2018 break2019 assert not u(resourceId="com.yoosee:id/tv_offline").exists, '(çäº1åé)设å¤è¿æ¯ç¦»çº¿'2020 SameOperation().quit_app(u)2021 @classmethod2022 def jwt_87(cls, u, video_camera_name): #æå¼å¸®å©ä¸åé¦H5页é¢2023 SameOperation().app_go(u)2024 if u(resourceId='com.yoosee:id/setting_more_iv').wait(timeout=5):2025 pass2026 else:2027 SameOperation().add_wired(u, video_camera_name)2028 u.press('back')2029 if u(resourceId="com.yoosee:id/ll_defence_state").wait_gone(timeout=3.0):2030 u.swipe_ext("down", scale=0.8)2031 u(resourceId="com.yoosee:id/icon_setting").click(timeout=5)2032 sleep(1)2033 u(resourceId="com.yoosee:id/icon_setting").click(timeout=5)2034 u(resourceId="com.yoosee:id/r_online_problem").click(timeout=5)2035 assert u(text="帮å©ä¸å¿").wait(timeout=5), '没ææå¼å¸®å©ä¸åé¦H5页é¢'2036 SameOperation().quit_app(u)2037 @classmethod2038 def jwt_88(cls, u, video_camera_name): #å
¨å±å±ç¤ºéä¸çå¾ç2039 SameOperation().app_go(u)2040 if u(resourceId='com.yoosee:id/setting_more_iv').wait(timeout=5):2041 pass2042 else:2043 SameOperation().add_wired(u, video_camera_name)2044 u.press('back')2045 if u(resourceId="com.yoosee:id/ll_defence_state").wait_gone(timeout=3.0):2046 u.swipe_ext("down", scale=0.8)2047 u.xpath(2048 '//*[@resource-id="com.yoosee:id/lv_contact"]/android.widget.RelativeLayout[1]/android.widget.LinearLayout[1]/android.widget.RelativeLayout[2]/android.widget.LinearLayout[1]').click(2049 timeout=5)2050 sleep(3)2051 for screenshot_i in range(0,3):2052 u(resourceId="com.yoosee:id/iv_p_screenshot").click(timeout=5)2053 sleep(1)2054 u(resourceId="com.yoosee:id/back_btn").click(timeout=5)2055 u(resourceId="com.yoosee:id/icon_setting").click(timeout=5)2056 sleep(1)2057 u(resourceId="com.yoosee:id/icon_setting").click(timeout=5)2058 u(resourceId="com.yoosee:id/rl_album_low").click(timeout=5)2059 u.xpath('//android.widget.GridView/android.widget.RelativeLayout[1]').click(timeout=5)2060 assert u(resourceId="com.yoosee:id/iv_delete").wait(timeout=5), '没æå
¨å±å±ç¤º'2061 SameOperation().quit_app(u)2062 @classmethod2063 def jwt_89(cls, u, video_camera_name): #å·¦æ»å¨å¯ä»¥æ¥çä¸ä¸ä¸ªå¾ç/è§é¢2064 SameOperation().app_go(u)2065 if u(resourceId='com.yoosee:id/setting_more_iv').wait(timeout=5):2066 pass2067 else:2068 SameOperation().add_wired(u, video_camera_name)2069 u.press('back')2070 if u(resourceId="com.yoosee:id/ll_defence_state").wait_gone(timeout=3.0):2071 u.swipe_ext("down", scale=0.8)2072 u.xpath(2073 '//*[@resource-id="com.yoosee:id/lv_contact"]/android.widget.RelativeLayout[1]/android.widget.LinearLayout[1]/android.widget.RelativeLayout[2]/android.widget.LinearLayout[1]').click(2074 timeout=5)2075 sleep(3)2076 for screenshot_i in range(0,3):2077 u(resourceId="com.yoosee:id/iv_p_screenshot").click(timeout=5)2078 sleep(1)2079 u(resourceId="com.yoosee:id/back_btn").click(timeout=5)2080 u(resourceId="com.yoosee:id/icon_setting").click(timeout=5)2081 sleep(1)2082 u(resourceId="com.yoosee:id/icon_setting").click(timeout=5)2083 u(resourceId="com.yoosee:id/rl_album_low").click(timeout=5)2084 u.xpath('//android.widget.GridView/android.widget.RelativeLayout[1]').click(timeout=5)2085 sleep(1)2086 u.swipe_ext("left", scale=0.8)2087 sleep(2)2088 u(resourceId="com.yoosee:id/tv_imagegallay_curprogress").wait(timeout=5)2089 assert '2/' in u(resourceId="com.yoosee:id/tv_imagegallay_curprogress").get_text(), '没æåæ¢ä¸ä¸å¼ å¾ç/è§é¢'2090 SameOperation().quit_app(u)2091 @classmethod2092 def jwt_90(cls, u, video_camera_name): #å³æ»å¨å¯ä»¥æ¥çä¸ä¸ä¸ªå¾ç/è§é¢2093 SameOperation().app_go(u)2094 if u(resourceId='com.yoosee:id/setting_more_iv').wait(timeout=5):2095 pass2096 else:2097 SameOperation().add_wired(u, video_camera_name)2098 u.press('back')2099 if u(resourceId="com.yoosee:id/ll_defence_state").wait_gone(timeout=3.0):2100 u.swipe_ext("down", scale=0.8)2101 u.xpath(2102 '//*[@resource-id="com.yoosee:id/lv_contact"]/android.widget.RelativeLayout[1]/android.widget.LinearLayout[1]/android.widget.RelativeLayout[2]/android.widget.LinearLayout[1]').click(2103 timeout=5)2104 sleep(3)2105 for screenshot_i in range(0,3):2106 u(resourceId="com.yoosee:id/iv_p_screenshot").click(timeout=5)2107 sleep(1)2108 u(resourceId="com.yoosee:id/back_btn").click(timeout=5)2109 u(resourceId="com.yoosee:id/icon_setting").click(timeout=5)2110 sleep(1)2111 u(resourceId="com.yoosee:id/icon_setting").click(timeout=5)2112 u(resourceId="com.yoosee:id/rl_album_low").click(timeout=5)2113 u.xpath('//android.widget.GridView/android.widget.RelativeLayout[2]').click(timeout=5)2114 sleep(1)2115 u(resourceId="com.yoosee:id/tv_imagegallay_curprogress").wait(timeout=5)2116 u.swipe_ext("right", scale=0.8)2117 sleep(2)2118 u(resourceId="com.yoosee:id/tv_imagegallay_curprogress").wait(timeout=5)2119 assert '1/' in u(resourceId="com.yoosee:id/tv_imagegallay_curprogress").get_text(), '没æåæ¢ä¸ä¸å¼ å¾ç/è§é¢'2120 SameOperation().quit_app(u)2121 @classmethod2122 def jwt_91(cls, u, video_camera_name): #æçç¸åå个å é¤å¼¹åºäºæ¬¡ç¡®è®¤å¼¹æ¡2123 SameOperation().app_go(u)2124 if u(resourceId='com.yoosee:id/setting_more_iv').wait(timeout=5):2125 pass2126 else:2127 SameOperation().add_wired(u, video_camera_name)2128 u.press('back')2129 if u(resourceId="com.yoosee:id/ll_defence_state").wait_gone(timeout=3.0):2130 u.swipe_ext("down", scale=0.8)2131 sleep(2)2132 u.xpath(2133 '//*[@resource-id="com.yoosee:id/lv_contact"]/android.widget.RelativeLayout[1]/android.widget.LinearLayout[1]/android.widget.RelativeLayout[2]/android.widget.LinearLayout[1]').click(2134 timeout=5)2135 sleep(3)2136 for screenshot_i in range(0,3):2137 u(resourceId="com.yoosee:id/iv_p_screenshot").click(timeout=5)2138 sleep(1)2139 u(resourceId="com.yoosee:id/back_btn").click(timeout=5)2140 u(resourceId="com.yoosee:id/icon_setting").click(timeout=5)2141 sleep(1)2142 u(resourceId="com.yoosee:id/icon_setting").click(timeout=5)2143 u(resourceId="com.yoosee:id/rl_album_low").click(timeout=5)2144 u.xpath('//android.widget.GridView/android.widget.RelativeLayout[2]').click(timeout=5)2145 u(resourceId="com.yoosee:id/iv_delete").click(timeout=5)2146 assert u(text="ç¡®å®å é¤?").wait(timeout=5), '没æå¼¹åºäºæ¬¡ç¡®è®¤å¼¹æ¡'2147 SameOperation().quit_app(u)2148 @classmethod2149 def jwt_92(cls, u, video_camera_name): #æçç¸åå个å é¤å¼¹åºäºæ¬¡ç¡®è®¤å¼¹æ¡ï¼ç¹å»å¦2150 SameOperation().app_go(u)2151 if u(resourceId='com.yoosee:id/setting_more_iv').wait(timeout=5):2152 pass2153 else:2154 SameOperation().add_wired(u, video_camera_name)2155 u.press('back')2156 if u(resourceId="com.yoosee:id/ll_defence_state").wait_gone(timeout=3.0):2157 u.swipe_ext("down", scale=0.8)2158 sleep(2)2159 u.xpath(2160 '//*[@resource-id="com.yoosee:id/lv_contact"]/android.widget.RelativeLayout[1]/android.widget.LinearLayout[1]/android.widget.RelativeLayout[2]/android.widget.LinearLayout[1]').click(2161 timeout=5)2162 sleep(3)2163 for screenshot_i in range(0,3):2164 u(resourceId="com.yoosee:id/iv_p_screenshot").click(timeout=5)2165 sleep(1)2166 u(resourceId="com.yoosee:id/back_btn").click(timeout=5)2167 u(resourceId="com.yoosee:id/icon_setting").click(timeout=5)2168 sleep(1)2169 u(resourceId="com.yoosee:id/icon_setting").click(timeout=5)2170 u(resourceId="com.yoosee:id/rl_album_low").click(timeout=5)2171 u.xpath('//android.widget.GridView/android.widget.RelativeLayout[2]').click(timeout=5)2172 u(resourceId="com.yoosee:id/iv_delete").click(timeout=5)2173 u(resourceId="com.yoosee:id/tv_no").click(timeout=5)2174 assert not u(text="ç¡®å®å é¤?").exists, 'ç¹å»å¦äºæ¬¡ç¡®è®¤å¼¹æ¡æ¶å¤±'2175 SameOperation().quit_app(u)2176 @classmethod2177 def jwt_93(cls, u, video_camera_name): # æçç¸åå个å é¤å¼¹åºäºæ¬¡ç¡®è®¤å¼¹æ¡ï¼ç¹å»æ¯2178 SameOperation().app_go(u)2179 if u(resourceId='com.yoosee:id/setting_more_iv').wait(timeout=5):2180 pass2181 else:2182 SameOperation().add_wired(u, video_camera_name)2183 u.press('back')2184 if u(resourceId="com.yoosee:id/ll_defence_state").wait_gone(timeout=3.0):2185 u.swipe_ext("down", scale=0.8)2186 sleep(2)2187 u.xpath(2188 '//*[@resource-id="com.yoosee:id/lv_contact"]/android.widget.RelativeLayout[1]/android.widget.LinearLayout[1]/android.widget.RelativeLayout[2]/android.widget.LinearLayout[1]').click(2189 timeout=5)2190 sleep(3)2191 for screenshot_i in range(0, 3):2192 u(resourceId="com.yoosee:id/iv_p_screenshot").click(timeout=5)2193 sleep(1)2194 u(resourceId="com.yoosee:id/back_btn").click(timeout=5)2195 u(resourceId="com.yoosee:id/icon_setting").click(timeout=5)2196 sleep(1)2197 u(resourceId="com.yoosee:id/icon_setting").click(timeout=5)2198 u(resourceId="com.yoosee:id/rl_album_low").click(timeout=5)2199 u.xpath('//android.widget.GridView/android.widget.RelativeLayout[2]').click(timeout=5)2200 sleep(2)2201 total_img_1 = u(resourceId="com.yoosee:id/tv_imagegallay_curprogress").get_text().strip().split('/')2202 u(resourceId="com.yoosee:id/iv_delete").click(timeout=5)2203 u(resourceId="com.yoosee:id/tv_yes").click(timeout=5)2204 sleep(2)2205 total_img_2 = u(resourceId="com.yoosee:id/tv_imagegallay_curprogress").get_text().strip().split('/')2206 assert int(total_img_1[1]) > int(total_img_2[1]),'没æå é¤æå'2207 SameOperation().quit_app(u)2208 @classmethod2209 def jwt_94(cls, u, video_camera_name): # 设置å¾å翻转2210 SameOperation().app_go(u)2211 if u(resourceId='com.yoosee:id/setting_more_iv').wait(timeout=5):2212 pass2213 else:2214 SameOperation().add_wired(u, video_camera_name)2215 u.press('back')2216 if u(resourceId="com.yoosee:id/ll_defence_state").wait_gone(timeout=3.0):2217 u.swipe_ext("down", scale=0.8)2218 sleep(2)2219 # SameOperation().find_deldevices(u,'ç»é¢ä¸å£°é³')2220 u.xpath(2221 '//*[@resource-id="com.yoosee:id/lv_contact"]/android.widget.RelativeLayout[1]/android.widget.LinearLayout[1]/android.widget.RelativeLayout[2]/android.widget.LinearLayout[1]').click(2222 timeout=5)2223 sleep(3)2224 u(resourceId='com.yoosee:id/bottom_control_rl').wait_gone(timeout=5.0)2225 u.screenshot('image_flipping_1.png')2226 u(resourceId="com.yoosee:id/iv_set").click(timeout=5)2227 u(resourceId="com.yoosee:id/video_control").click(timeout=5)2228 u(resourceId="com.yoosee:id/sv_reverse_img").click(timeout=5)2229 u(resourceId="com.yoosee:id/back_btn").click(timeout=5)2230 u(resourceId="com.yoosee:id/back_btn").click(timeout=5)2231 u(resourceId='com.yoosee:id/center_direction_view').wait(timeout=5)2232 u.screenshot('image_flipping_2.png')2233 fl = SameOperation().img_statuscheck('image_flipping_1.png','image_flipping_2.png')2234 print (fl)2235 assert fl >500,'å¾å没翻转'2236 SameOperation().quit_app(u)2237 @classmethod2238 def jwt_95(cls, u, video_camera_name): # 触åæ¥è¦ï¼éªè¯å¨çº¿æ¥è¦å¼¹çªé¡µé¢2239 SameOperation().app_go(u)2240 if u(resourceId='com.yoosee:id/setting_more_iv').wait(timeout=5):2241 pass2242 else:2243 SameOperation().add_wired(u, video_camera_name)2244 u.press('back')2245 if u(resourceId="com.yoosee:id/ll_defence_state").wait_gone(timeout=3.0):2246 u.swipe_ext("down", scale=0.8)2247 sleep(2)2248 if u(text="ä¸æ¥è¦").exists:2249 u(resourceId="com.yoosee:id/ll_defence_state").click(timeout=5)2250 sleep(3)2251 alarm = 02252 if u(resourceId='com.yoosee:id/alarming').wait(timeout=10):2253 u(resourceId="com.yoosee:id/iv_alarm_close").click(timeout=5)2254 alarm = 12255 u(resourceId="com.yoosee:id/ll_defence_state").click(timeout=5)2256 else:2257 u(resourceId="com.yoosee:id/ll_defence_state").click(timeout=5)2258 sleep(3)2259 if alarm == 0:2260 assert 1 == 0,'没ææ¥è¦å¼¹æ¡é¡µé¢'2261 SameOperation().quit_app(u)2262 @classmethod2263 def jwt_96(cls, u, video_camera_name): # å¨çº¿æ¥æ¶çæ¥è¦æ¶æ¯å¨æºè½å®æ¤æ¬å°æ¶æ¯ä¸æè®°å½2264 SameOperation().app_go(u)2265 if u(resourceId='com.yoosee:id/setting_more_iv').wait(timeout=5):2266 pass2267 else:2268 SameOperation().add_wired(u, video_camera_name)2269 u.press('back')2270 if u(resourceId="com.yoosee:id/ll_defence_state").wait_gone(timeout=3.0):2271 u.swipe_ext("down", scale=0.8)2272 sleep(2)2273 u(resourceId="com.yoosee:id/icon_keyboard").click(timeout=5)2274 if u(resourceId='com.yoosee:id/item_ll').wait(timeout=5):2275 u(resourceId="com.yoosee:id/item_ll").long_click()2276 u(resourceId="com.yoosee:id/tv_select").click(timeout=5)2277 sleep(2)2278 if len(u(resourceId="com.yoosee:id/img_choose")) > 1:2279 u(resourceId="com.yoosee:id/cl_select_all").click(timeout=5)2280 u(resourceId="com.yoosee:id/cl_delete").click(timeout=5)2281 u.xpath('//*[@resource-id="android:id/content"]/android.widget.LinearLayout[1]/android.widget.LinearLayout[1]/android.widget.RelativeLayout[2]').click()2282 u(resourceId="com.yoosee:id/iv_close").click(timeout=5)2283 sleep(190)2284 u(resourceId="com.yoosee:id/icon_contact").click(timeout=5)2285 # if u(text="ä¸æ¥è¦").exists:2286 # u(resourceId="com.yoosee:id/ll_defence_state").click(timeout=5)2287 # sleep(3)2288 # if u(resourceId='com.yoosee:id/alarming').wait(timeout=10):2289 # u(resourceId="com.yoosee:id/iv_alarm_close").click(timeout=5)2290 # u(resourceId="com.yoosee:id/ll_defence_state").click(timeout=5)2291 # else:2292 # u(resourceId="com.yoosee:id/ll_defence_state").click(timeout=5)2293 # sleep(3)2294 u(resourceId="com.yoosee:id/icon_keyboard").click(timeout=5)2295 assert u(resourceId='com.yoosee:id/item_ll').wait(timeout=5),'å¨æºè½å®æ¤æ¬å°æ¶æ¯ä¸æ²¡æè®°å½'2296 SameOperation().quit_app(u)2297 @classmethod2298 def jwt_97(cls, u, video_camera_name): # æ¥è¦æ¨éå¼¹çªå¿½ç¥æ¬æ¬¡è¿åå页é¢2299 SameOperation().app_go(u)2300 if u(resourceId='com.yoosee:id/setting_more_iv').wait(timeout=5):2301 pass2302 else:2303 SameOperation().add_wired(u, video_camera_name)2304 u.press('back')2305 if u(resourceId="com.yoosee:id/ll_defence_state").wait_gone(timeout=3.0):2306 u.swipe_ext("down", scale=0.8)2307 sleep(2)2308 if u(text="ä¸æ¥è¦").exists:2309 u(resourceId="com.yoosee:id/ll_defence_state").click(timeout=5)2310 sleep(3)2311 u(resourceId='com.yoosee:id/alarming').wait(timeout=10)2312 u(resourceId="com.yoosee:id/iv_alarm_close").click(timeout=5)2313 u(resourceId="com.yoosee:id/ll_defence_state").click(timeout=5)2314 sleep(2)2315 assert u(resourceId='com.yoosee:id/setting_more_iv').wait(timeout=5),'忽ç¥æ¬æ¬¡è¿åå页é¢'2316 SameOperation().quit_app(u)2317 @classmethod2318 def jwt_98(cls, u, video_camera_name): # æ¥è¦æ¨éå¼¹çªæµè¯åºç°å¼¹çªé¡µé¢2319 SameOperation().app_go(u)2320 if u(resourceId='com.yoosee:id/setting_more_iv').wait(timeout=5):2321 pass2322 else:2323 SameOperation().add_wired(u, video_camera_name)2324 u.press('back')2325 if u(resourceId="com.yoosee:id/ll_defence_state").wait_gone(timeout=3.0):2326 u.swipe_ext("down", scale=0.8)2327 sleep(2)2328 if u(text="ä¸æ¥è¦").exists:2329 u(resourceId="com.yoosee:id/ll_defence_state").click(timeout=5)2330 sleep(3)2331 alarm = 02332 if u(resourceId='com.yoosee:id/alarming').wait(timeout=10):2333 u(resourceId="com.yoosee:id/iv_alarm_close").click(timeout=5)2334 alarm = 12335 u(resourceId="com.yoosee:id/ll_defence_state").click(timeout=5)2336 else:2337 u(resourceId="com.yoosee:id/ll_defence_state").click(timeout=5)2338 sleep(3)2339 if alarm == 0:2340 assert 1 == 0, '没ææ¥è¦æ¨éå¼¹çªæµè¯åºç°å¼¹çªé¡µé¢'2341 SameOperation().quit_app(u)2342 @classmethod2343 def jwt_99(cls, u, video_camera_name): # æ¥è¦æ¨éå¼¹çªè¿å
¥å°è®¾å¤çæ§é¡µé¢2344 SameOperation().app_go(u)2345 if u(resourceId='com.yoosee:id/setting_more_iv').wait(timeout=5):2346 pass2347 else:2348 SameOperation().add_wired(u, video_camera_name)2349 u.press('back')2350 if u(resourceId="com.yoosee:id/ll_defence_state").wait_gone(timeout=3.0):2351 u.swipe_ext("down", scale=0.8)2352 sleep(2)2353 if u(text="ä¸æ¥è¦").exists:2354 u(resourceId="com.yoosee:id/ll_defence_state").click(timeout=5)2355 sleep(3)2356 u(resourceId='com.yoosee:id/alarming').wait(timeout=10)2357 u(resourceId="com.yoosee:id/iv_alarm_check").click(timeout=5)2358 assert u(resourceId='com.yoosee:id/bottom_control_rl').wait(timeout=5),'没æè¿å
¥è®¾å¤çæ§é¡µé¢'2359 u(resourceId="com.yoosee:id/back_btn").click(timeout=5)2360 u(resourceId="com.yoosee:id/ll_defence_state").click(timeout=5)2361 SameOperation().quit_app(u)2362 @classmethod2363 def jwt_100(cls, u, video_camera_name): # æ¥è¦å¿«æ·é®æ¶å°å¨çº¿æ¥è¦æ¨é2364 SameOperation().app_go(u)2365 if u(resourceId='com.yoosee:id/setting_more_iv').wait(timeout=5):2366 pass2367 else:2368 SameOperation().add_wired(u, video_camera_name)2369 u.press('back')2370 if u(resourceId="com.yoosee:id/ll_defence_state").wait_gone(timeout=3.0):2371 u.swipe_ext("down", scale=0.8)2372 sleep(2)2373 if u(text="ä¸æ¥è¦").exists:2374 u(resourceId="com.yoosee:id/ll_defence_state").click(timeout=5)2375 sleep(3)2376 alarm = 02377 if u(resourceId='com.yoosee:id/alarming').wait(timeout=10):2378 u(resourceId="com.yoosee:id/iv_alarm_close").click(timeout=5)2379 alarm = 12380 u(resourceId="com.yoosee:id/ll_defence_state").click(timeout=5)2381 else:2382 u(resourceId="com.yoosee:id/ll_defence_state").click(timeout=5)2383 sleep(3)2384 if alarm == 0:2385 assert 1 == 0, '没ææ¶å°å¨çº¿æ¥è¦æ¨é'2386 SameOperation().quit_app(u)2387 @classmethod2388 def jwt_101(cls, u, video_camera_name): # 设å¤ä¸»äººç¹å»æºè½æ°æ³¡æ¶æ¯è·³å°æºè½å®æ¤é¡µ2389 u.app_clear('com.yoosee') # æ¸
é¤åºç¨æ°æ®2390 SameOperation().app_go(u)2391 SameOperation().log_in(u, phone_num, phone_pwd)2392 sleep(5)2393 u(resourceId='com.yoosee:id/tv_contact').click(timeout=5)2394 u(text="æ¨éæ¶æ¯æé").wait(timeout=10)2395 try:2396 u(text="æ¶æ¯éç¥è¯´æ").wait(timeout=10)2397 except:2398 u(resourceId="com.yoosee:id/iv_back").click(timeout=5)2399 if u(resourceId='com.yoosee:id/setting_more_iv').wait(timeout=5):2400 pass2401 else:2402 SameOperation().add_wired(u, video_camera_name)2403 u.press('back')2404 if u(resourceId="com.yoosee:id/ll_defence_state").wait_gone(timeout=3.0):2405 u.swipe_ext("down", scale=0.8)2406 #sleep(190)2407 u.swipe_ext("down", scale=0.8)2408 sleep(2)2409 u(resourceId="com.yoosee:id/msgLayout").wait(timeout=5)2410 u(resourceId="com.yoosee:id/msgLayout").click(timeout=5)2411 assert u(resourceId='com.yoosee:id/view_img_video').wait(timeout=5),'没æè·³å°æºè½å®æ¤é¡µ'2412 SameOperation().quit_app(u)2413 @classmethod2414 def jwt_102(cls, u, video_camera_name): # è·³å°æºè½å®æ¤é¡µ,å
³éå¡çæ¾ç¤º2415 u.app_clear('com.yoosee') # æ¸
é¤åºç¨æ°æ®2416 SameOperation().app_go(u)2417 SameOperation().log_in(u, phone_num, phone_pwd)2418 sleep(5)2419 u(resourceId='com.yoosee:id/tv_contact').click(timeout=5)2420 u(text="æ¨éæ¶æ¯æé").wait(timeout=10)2421 try:2422 u(text="æ¶æ¯éç¥è¯´æ").wait(timeout=10)2423 except:2424 u(resourceId="com.yoosee:id/iv_back").click(timeout=5)2425 if u(resourceId='com.yoosee:id/setting_more_iv').wait(timeout=5):2426 pass2427 else:2428 SameOperation().add_wired(u, video_camera_name)2429 u.press('back')2430 if u(resourceId="com.yoosee:id/ll_defence_state").wait_gone(timeout=3.0):2431 u.swipe_ext("down", scale=0.8)2432 #sleep(190)2433 u.swipe_ext("down", scale=0.8)2434 sleep(2)2435 u(resourceId="com.yoosee:id/msgLayout").wait(timeout=5)2436 u(resourceId="com.yoosee:id/msgLayout").click(timeout=5)2437 u(resourceId='com.yoosee:id/view_img_video').wait(timeout=5)2438 u(resourceId='com.yoosee:id/icon_contact').click(timeout=5)2439 assert not u(resourceId="com.yoosee:id/msgLayout").wait(timeout=5), 'ä»åå¨å¡çæ¶æ¯'...
user_center.py
Source:user_center.py
...30 self.d(resourceId="com.vova.android:id/tv_user_name").exists(timeout=3)31 log.i('å·æ°ç»å½æåç¶æ')32 @teststep33 def wait_get_it_gone(self):34 self.d(resourceId="com.vova.android:id/tv_get_it").wait_gone(timeout=10.0)35 @teststep36 def is_page(self):37 if self.d(resourceId="com.vova.android:id/tv_my_orders").wait(timeout=1):38 return True39 else:40 return False41 @teststep42 def click_GetIt_button(self):43 log.i("ç¹å»Get itæé®")44 self.d(resourceId="com.vova.android:id/tv_get_it").click()45 @teststep46 def click_signin_button(self):47 if BasePage.element_is_exists(self.d(resourceId="com.vova.android:id/tv_sign_in"), timeout=0) is False:48 self.find_element_by_swipe_down(self.d(resourceId="com.vova.android:id/tv_sign_in"))49 self.d(resourceId="com.vova.android:id/tv_sign_in").click()50 log.i("ç¹å»SIGN INæé®")51 self.d(resourceId="com.vova.android:id/tv_sign_in").wait_gone(timeout=1.0)52 if self.d(resourceId="com.vova.android:id/tv_sign_in").click_exists(timeout=1.0):53 log.i("äºæ¬¡ç¹å»SIGN INæé®") # å
¼å®¹ä½æ¦çç¹ä¸ä¸çbug54 @teststep55 def clear_GetIt(self):56 while self.d(resourceId="com.vova.android:id/tv_get_it").wait(timeout=3):57 self.click_GetIt_button()58 @teststep59 def click_setting_button(self):60 if BasePage.element_is_exists(self.d(text="YOU MIGHT LIKE"), timeout=0) is False:61 self.find_element_by_swipe_up(self.d(text="YOU MIGHT LIKE")) # å¾ä¸æä¸æåç¹ï¼å
¼å®¹ç¹ä¸ä¸çæ
åµ62 log.i("ç»ä¸æ»å·²åç°settingä½ç½®")63 self.d(resourceId="com.vova.android:id/tv_setting", text='Settings').click()64 log.i("ç¹å»Settingæé®")65 self.d(resourceId="com.vova.android:id/tv_setting", text='Settings').wait_gone(timeout=1.0)66 if self.d(resourceId="com.vova.android:id/tv_setting", text='Settings').click_exists(timeout=1.0):67 log.i("äºæ¬¡ç¹å»Settingæé®") # å
¼å®¹ä½æ¦çç¹ä¸ä¸çbug68 @teststep69 def click_my_orders_button(self):70 if BasePage.element_is_exists(71 self.d(resourceId="com.vova.android:id/tv_my_orders_view_all"), timeout=1) is False:72 self.find_element_by_swipe_down(self.d(resourceId="com.vova.android:id/tv_my_orders_view_all"))73 time.sleep(.5)74 self.d(resourceId="com.vova.android:id/tv_my_orders_view_all").click()75 log.i("ç¹å»orderså表æé®")76 self.d(resourceId="com.vova.android:id/tv_my_orders_view_all").wait_gone(timeout=1.0)77 if self.d(resourceId="com.vova.android:id/tv_my_orders_view_all").click_exists(timeout=1.0):...
test_session.py
Source:test_session.py
...40 assert s(name="Settings").displayed41 s.swipe_up()42 assert s(name="Airplane Mode").wait(2.0, raise_error=False)43 s.swipe_down()44 assert s(name="Airplane Mode").wait_gone(2.0, raise_error=False)45@mark.skip("wda bug")46def test_session_set_text():47 with c.session('com.apple.mobilesafari') as s:48 s(name='URL', className='Button').set_text("status.github.com")49 url = s(name='URL', className='TextField').get()50 assert url.value == 'status.github.com'51@mark.skip("TODO")52def test_session_window_size():53 s = c.session()54 wsize = s.window_size()55 assert wsize.width == 32056 assert wsize.height == 56857@mark.skip("wda bug")58def test_session_send_keys():59 with c.session('com.apple.mobilesafari') as s:60 u = s(label='Address', className='Button')61 u.clear_text()62 s.send_keys('www.github.com')63 assert 'www.github.com' == s(label='Address', className='TextField').get().value64@mark.skip("wait for WDA fix")65def test_session_keyboard_dismiss():66 with c.session('com.apple.mobilesafari') as s:67 u = s(label='Address', className='Button')68 u.clear_text()69 s.send_keys('www.github.com')70 assert s(className='Keyboard').exists71 s.keyboard_dismiss()72 assert not s(className='Keyboard').exists73def test_session_orientation(c: wda.Client):74 c.orientation = wda.PORTRAIT75 with c.session('com.apple.mobilesafari') as s:76 assert s.orientation == wda.PORTRAIT77 s.orientation = wda.LANDSCAPE78 time.sleep(1.0)79 assert s.orientation == wda.LANDSCAPE80 # recover orientation81 s.orientation = wda.PORTRAIT82def test_session_invalid_with_autofix(c: wda.Client):83 c.session("com.apple.Preferences")84 c.session_id = "123"85 assert c.app_current().bundleId == "com.apple.Preferences"86 assert isinstance(c.info, dict)87 assert c.session_id != "123"88@mark.skip("TODO")89def test_session_wait_gone():90 s = c.session()91 elem = s(name="Settings", visible=True)92 with pytest.raises(wda.WDAElementNotDisappearError) as e_info:93 elem.wait_gone(1.0)94 assert not elem.wait_gone(1.0, raise_error=False)95 s.swipe_left()96 assert elem.wait_gone(1.0)97@mark.skip("Require English")98def test_text_contains_matches(c: wda.Client):99 with c.session('com.apple.Preferences') as s:100 s(text='Bluetooth').get()101 assert s(textContains="Blue").exists102 assert not s(text="Blue").exists103 assert s(text="Bluetooth").exists104 assert s(textMatches="Blue?").exists105 assert s(nameMatches="Blue?").exists106 assert not s(textMatches="^lue?").exists107 assert not s(textMatches="^Blue$").exists108 assert s(textMatches=r"^(Blue|Red).*").exists109@pytest.mark.skip("not passed on IRMA")110def test_app_operation(c: wda.Client):...
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!!