forked from electricbubble/gwda-ext-opencv
-
Notifications
You must be signed in to change notification settings - Fork 1
/
tap_test.go
48 lines (34 loc) · 982 Bytes
/
tap_test.go
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
48
package uixt
import (
"testing"
"github.com/electricbubble/gwda"
)
func TestDriverExt_TapWithNumber(t *testing.T) {
driver, err := gwda.NewUSBDriver(nil)
checkErr(t, err)
driverExt, err := Extend(driver, 0.95)
checkErr(t, err)
pathSearch := "/Users/hero/Documents/temp/2020-05/opencv/flag7.png"
// gwda.SetDebug(true)
err = driverExt.TapWithNumber(pathSearch, 3)
checkErr(t, err)
err = driverExt.TapWithNumberOffset(pathSearch, 3, 0.5, 0.75)
checkErr(t, err)
}
func TestDriverExt_TapWithCoordinate(t *testing.T) {
driver, err := gwda.NewUSBDriver(nil)
checkErr(t, err)
driverExt, err := Extend(driver, 0.95)
checkErr(t, err)
err = driverExt.Tap([]float64{0.4, 0.5})
checkErr(t, err)
}
func TestDriverExt_TapWithOCR(t *testing.T) {
driver, err := gwda.NewUSBDriver(nil)
checkErr(t, err)
driverExt, err := Extend(driver, 0.95)
checkErr(t, err)
// 需要点击文字上方的图标
err = driverExt.TapOffset("抖音", 0.5, -1)
checkErr(t, err)
}