mirror of
https://github.com/httprunner/httprunner.git
synced 2026-09-06 07:57:27 +08:00
refactor: simplify OCR APIs
This commit is contained in:
@@ -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)
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user