refactor: simplify OCR APIs

This commit is contained in:
lilong.129
2023-04-25 22:27:31 +08:00
parent f9bebf7202
commit 3ec27b9afc
13 changed files with 231 additions and 247 deletions
+3 -3
View File
@@ -10,9 +10,9 @@ func TestDriverExtOCR(t *testing.T) {
driverExt, err := iosDevice.NewDriver(nil)
checkErr(t, err)
x, y, width, height, err := driverExt.FindTextByOCR("抖音")
point, err := driverExt.FindScreenTextByOCR("抖音")
checkErr(t, err)
t.Logf("x: %v, y: %v, width: %v, height: %v", x, y, width, height)
driverExt.Driver.TapFloat(x+width*0.5, y+height*0.5-20)
t.Logf("point.X: %v, point.Y: %v", point.X, point.Y)
driverExt.Driver.TapFloat(point.X, point.Y-20)
}