feat: mark tap/swipe UI operation

This commit is contained in:
lilong.129
2025-05-05 16:31:13 +08:00
parent 6569121d5d
commit cfc71819d2
12 changed files with 438 additions and 88 deletions

View File

@@ -118,6 +118,14 @@ func (wd *BrowserDriver) Drag(fromX, fromY, toX, toY float64, options ...option.
}
_, err = wd.HttpPOST(data, wd.sessionId, "ui/drag")
// mark UI operation
if actionOptions.MarkOperationEnabled {
if markErr := MarkUIOperation(wd, ACTION_Drag, []float64{fromX, fromY, toX, toY}); markErr != nil {
log.Warn().Err(markErr).Msg("Failed to mark drag operation")
}
}
return
}
@@ -529,6 +537,14 @@ func (wd *BrowserDriver) TapFloat(x, y float64, options ...option.ActionOption)
"duration": duration,
}
_, err := wd.HttpPOST(data, wd.sessionId, "ui/tap")
// mark UI operation
if actionOptions.MarkOperationEnabled {
if markErr := MarkUIOperation(wd, ACTION_TapAbsXY, []float64{x, y}); markErr != nil {
log.Warn().Err(markErr).Msg("Failed to mark tap operation")
}
}
return err
}