Commit ce451d60 authored by TesterYao's avatar TesterYao

1

parent a1a4883e
......@@ -10,6 +10,8 @@ def check_ex():
LOG.info('不在微信首页,重新打开微信')
device.stop_app('com.tencent.xin')
device.start_app('com.tencent.xin')
if poco("扫一扫").exists():
poco("快捷操作").click()
def check_wx():
......@@ -25,22 +27,22 @@ def check_wx():
def scan(photo):
block_list = []
LOG.info('打开扫一扫,选择二维码')
poco("快捷操作").click()
poco("扫一扫").click()
poco("快捷操作").wait(timeout=5).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)))
poco(photo).click()
poco(name="完成").click()
LOG.info('扫码完成,开始进行巡查')
poco(photo).wait(timeout=5).click()
poco(name="完成").wait(timeout=5).click()
poco(type="Link").wait(timeout=5)
links = poco(type="Link")
for link in links:
link.click()
LOG.info('开始巡查:' + link.get_name())
sleep(1)
sleep(1.5)
if poco(name="已停止访问该网页").exists():
block_list.append(link.get_name())
poco(name="返回").click()
poco(name="返回").wait(timeout=5).click()
LOG.info('巡查结束,关闭扫码webview!')
poco(name="关闭").click()
poco(name="关闭").wait(timeout=5).click()
return block_list
......@@ -78,4 +80,4 @@ if __name__ == '__main__':
except Exception as e:
print(e)
LOG.error('域名巡查脚本报错,三分钟后重试!')
sleep(180)
\ No newline at end of file
sleep(30)
\ 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