-
Notifications
You must be signed in to change notification settings - Fork 4
/
test.js
46 lines (42 loc) · 907 Bytes
/
test.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
const robot = require('./index.js');
var sleep = (time)=>{
return new Promise(function(resolve, reject) {
setTimeout(()=>{resolve()},time)
});
}
var start = async ()=>{
console.log('start');
await sleep(3000)
robot.wheelDown()
await sleep(100)
robot.wheelUp()
await sleep(1000)
await sleep(1000)
robot.moveTo(100,100)
await sleep(1000)
robot.moveTo(121,185)
await sleep(1000)
robot.doubleClick()
await sleep(1000)
robot.moveTo(400,150)
await sleep(1000)
robot.rightClick()
await sleep(1000)
robot.leftClick()
await sleep(1000)
robot.moveTo(800, 200)
await sleep(1000)
robot.leftDown()
await sleep(1000)
robot.leftUp()
await sleep(1000)
robot.rightDown()
await sleep(1000)
robot.rightUp()
await sleep(1000)
robot.screenShot('./screenshot.png')
await sleep(1000)
robot.sendKeys('S D F G H {ENTER}')
console.log('end');
}
start()