Commit ce451d60 authored by TesterYao's avatar TesterYao

1

parent a1a4883e
...@@ -10,6 +10,8 @@ def check_ex(): ...@@ -10,6 +10,8 @@ def check_ex():
LOG.info('不在微信首页,重新打开微信') LOG.info('不在微信首页,重新打开微信')
device.stop_app('com.tencent.xin') device.stop_app('com.tencent.xin')
device.start_app('com.tencent.xin') device.start_app('com.tencent.xin')
if poco("扫一扫").exists():
poco("快捷操作").click()
def check_wx(): def check_wx():
...@@ -25,22 +27,22 @@ def check_wx(): ...@@ -25,22 +27,22 @@ def check_wx():
def scan(photo): def scan(photo):
block_list = [] block_list = []
LOG.info('打开扫一扫,选择二维码') LOG.info('打开扫一扫,选择二维码')
poco("快捷操作").click() poco("快捷操作").wait(timeout=5).click()
poco("扫一扫").click() poco("扫一扫").wait(timeout=5).click()
wait(Template(r"tpl1644909001064.png", record_pos=(0.396, 0.696), resolution=(828, 1792)),timeout=5)
touch(Template(r"tpl1644909001064.png", record_pos=(0.396, 0.696), resolution=(828, 1792))) touch(Template(r"tpl1644909001064.png", record_pos=(0.396, 0.696), resolution=(828, 1792)))
poco(photo).click() poco(photo).wait(timeout=5).click()
poco(name="完成").click() poco(name="完成").wait(timeout=5).click()
LOG.info('扫码完成,开始进行巡查') poco(type="Link").wait(timeout=5)
links = poco(type="Link") links = poco(type="Link")
for link in links: for link in links:
link.click() link.click()
LOG.info('开始巡查:' + link.get_name()) sleep(1.5)
sleep(1)
if poco(name="已停止访问该网页").exists(): if poco(name="已停止访问该网页").exists():
block_list.append(link.get_name()) block_list.append(link.get_name())
poco(name="返回").click() poco(name="返回").wait(timeout=5).click()
LOG.info('巡查结束,关闭扫码webview!') LOG.info('巡查结束,关闭扫码webview!')
poco(name="关闭").click() poco(name="关闭").wait(timeout=5).click()
return block_list return block_list
...@@ -78,4 +80,4 @@ if __name__ == '__main__': ...@@ -78,4 +80,4 @@ if __name__ == '__main__':
except Exception as e: except Exception as e:
print(e) print(e)
LOG.error('域名巡查脚本报错,三分钟后重试!') LOG.error('域名巡查脚本报错,三分钟后重试!')
sleep(180) sleep(30)
\ No newline at end of file \ No newline at end of file
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment