commit
Showing
7 changed files
with
52 additions
and
30 deletions
android/exitLogin.air/exitLogin.py
0 → 100644
| 1 | # -*- encoding=utf8 -*- | ||
| 2 | __author__ = "zhanghao" | ||
| 3 | |||
| 4 | from airtest.core.api import * | ||
| 5 | |||
| 6 | def exitLogin(): | ||
| 7 | touch(Template(r"tpl1622181656726.png", record_pos=(0.306, -0.932), resolution=(1080, 2340))) | ||
| 8 | sleep(3) | ||
| 9 | touch(Template(r"tpl1622181674939.png", record_pos=(-0.005, 0.621), resolution=(1080, 2340))) | ||
| 10 | sleep(3) | ||
| 11 | touch(Template(r"tpl1622181688365.png", record_pos=(0.211, 0.129), resolution=(1080, 2340))) | ||
| 12 | sleep(3) | ||
| 13 | assert_exists(Template(r"tpl1622181718756.png", record_pos=(0.0, -0.31), resolution=(1080, 2340)), "验证退出登录正确") | ||
| ... | \ No newline at end of file | ... | \ No newline at end of file |
| ... | @@ -3,33 +3,16 @@ __author__ = "zhanghao" | ... | @@ -3,33 +3,16 @@ __author__ = "zhanghao" |
| 3 | 3 | ||
| 4 | from airtest.core.api import * | 4 | from airtest.core.api import * |
| 5 | 5 | ||
| 6 | auto_setup(__file__, logdir=True) | 6 | def login(): |
| 7 | connect_device("Android:///2PF4C19807005028?cap_method=javacap&touch_method=adb") | 7 | touch(Template(r"tpl1622181202002.png", record_pos=(-0.226, -0.798), resolution=(1080, 2340))) |
| 8 | sleep(3) | 8 | sleep(8) |
| 9 | wake() | 9 | text("13683238581") |
| 10 | sleep(3) | 10 | sleep(3) |
| 11 | 11 | touch(Template(r"tpl1622181244594.png", record_pos=(-0.303, -0.631), resolution=(1080, 2340))) | |
| 12 | start_app("com.borui.gsjk") | 12 | sleep(3) |
| 13 | sleep(8) | 13 | text("6666") |
| 14 | 14 | touch(Template(r"tpl1622181266358.png", record_pos=(0.002, -0.308), resolution=(1080, 2340))) | |
| 15 | touch(Template(r"tpl1622181202002.png", record_pos=(-0.226, -0.798), resolution=(1080, 2340))) | 15 | sleep(6) |
| 16 | sleep(8) | 16 | touch(Template(r"tpl1622181344490.png", record_pos=(0.009, 0.414), resolution=(1080, 2340))) |
| 17 | text("13683238581") | 17 | sleep(10) |
| 18 | sleep(3) | 18 | assert_exists(Template(r"tpl1622181656726.png", record_pos=(0.306, -0.932), resolution=(1080, 2340)), "验证登录正确") |
| 19 | touch(Template(r"tpl1622181244594.png", record_pos=(-0.303, -0.631), resolution=(1080, 2340))) | ||
| 20 | sleep(3) | ||
| 21 | text("6666") | ||
| 22 | touch(Template(r"tpl1622181266358.png", record_pos=(0.002, -0.308), resolution=(1080, 2340))) | ||
| 23 | sleep(6) | ||
| 24 | touch(Template(r"tpl1622181344490.png", record_pos=(0.009, 0.414), resolution=(1080, 2340))) | ||
| 25 | sleep(10) | ||
| 26 | assert_exists(Template(r"tpl1622181656726.png", record_pos=(0.306, -0.932), resolution=(1080, 2340)), "验证登录正确") | ||
| 27 | touch(Template(r"tpl1622181656726.png", record_pos=(0.306, -0.932), resolution=(1080, 2340))) | ||
| 28 | sleep(3) | ||
| 29 | touch(Template(r"tpl1622181674939.png", record_pos=(-0.005, 0.621), resolution=(1080, 2340))) | ||
| 30 | sleep(3) | ||
| 31 | touch(Template(r"tpl1622181688365.png", record_pos=(0.211, 0.129), resolution=(1080, 2340))) | ||
| 32 | sleep(3) | ||
| 33 | assert_exists(Template(r"tpl1622181718756.png", record_pos=(0.0, -0.31), resolution=(1080, 2340)), "验证退出登录正确") | ||
| 34 | |||
| 35 | stop_app("com.borui.gsjk") | ... | ... |
android/run.air/run.py
0 → 100644
| 1 | # -*- encoding=utf8 -*- | ||
| 2 | __author__ = "zhanghao" | ||
| 3 | |||
| 4 | from airtest.core.api import * | ||
| 5 | using("login.air") | ||
| 6 | using("exitLogin.air") | ||
| 7 | |||
| 8 | from login import login | ||
| 9 | from exitLogin import exitLogin | ||
| 10 | |||
| 11 | auto_setup(__file__, logdir=True) | ||
| 12 | connect_device("Android:///2PF4C19807005028?cap_method=javacap&touch_method=adb") | ||
| 13 | sleep(3) | ||
| 14 | wake() | ||
| 15 | sleep(3) | ||
| 16 | |||
| 17 | start_app("com.borui.gsjk") | ||
| 18 | sleep(8) | ||
| 19 | |||
| 20 | login() | ||
| 21 | sleep(3) | ||
| 22 | |||
| 23 | exitLogin() | ||
| 24 | sleep(3) | ||
| 25 | |||
| 26 | stop_app("com.borui.gsjk") |
-
Please register or sign in to post a comment