-
Notifications
You must be signed in to change notification settings - Fork 1
/
test_wx.js
47 lines (40 loc) · 1.07 KB
/
test_wx.js
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
auto.waitFor();
var app = "微信";
launchApp(app);
// console.log('进入');
function rand_sleep(base) {
sleep(random(base * 1000, (base + 1) * 1000));
}
rand_sleep(5);
swipe(500, 500, 500, 2000, 100);
rand_sleep(1);
var ssb = id("ko8").text("随申办").findOne();
click(ssb.bounds().centerX(), ssb.bounds().centerY());
rand_sleep(3);
click(420, 1240);
function capScreen() {
rand_sleep(2);
path = "/storage/emulated/0/DCIM/Screenshots/核酸检测报告.jpg";
// 请求横屏截图
// 1、开启线程,找到点击立即开始,并且触发事件(只需要执行一次就可以)
threads.start(function () {
var beginBtn;
if (
(beginBtn = classNameContains("Button")
.textContains("立即开始")
.findOne(2000))
) {
beginBtn.click();
}
});
requestScreenCapture(true);
// 2、请求截图
if (!requestScreenCapture()) {
toast("请求截图失败");
exit();
}
// 截图
rand_sleep(1);
captureScreen(path);
}
// capScreen();