fix: err wrap and TapFloat

This commit is contained in:
buyuxiang
2023-01-19 08:59:17 +08:00
parent 1b6eed1739
commit 4c29906f6d
2 changed files with 8 additions and 1 deletions

View File

@@ -180,6 +180,13 @@ func (ad *adbDriver) Tap(x, y int, options ...DataOption) error {
}
func (ad *adbDriver) TapFloat(x, y float64, options ...DataOption) (err error) {
dataOptions := NewDataOptions(options...)
if len(dataOptions.Offset) == 2 {
x += float64(dataOptions.Offset[0])
y += float64(dataOptions.Offset[1])
}
// adb shell input tap x y
_, err = ad.adbClient.RunShellCommand(
"input", "tap", fmt.Sprintf("%.1f", x), fmt.Sprintf("%.1f", y))

View File

@@ -559,7 +559,7 @@ func (r *SessionRunner) Start(givenVars map[string]interface{}) error {
// check if failfast
if r.caseRunner.hrpRunner.failfast {
return errors.New("abort running due to failfast setting")
return errors.Wrap(err, "abort running due to failfast setting")
}
}