feat: ApplySwipeOffset

This commit is contained in:
lilong.129
2025-03-17 17:57:10 +08:00
parent 9fb53590ca
commit 182de16751
7 changed files with 33 additions and 2 deletions

View File

@@ -181,11 +181,16 @@ func TestDriverExt_Action_Risk(t *testing.T) {
err = driver.TapXY(0.5, 0.5, option.WithOffsetRandomRange(-10, 10))
assert.Nil(t, err)
// swipe direction with offset
// swipe direction with constant offset
err = driver.Swipe(0.5, 0.5, 0.5, 0.9,
option.WithSwipeOffset(-50, 50, -50, 50))
assert.Nil(t, err)
// swipe direction with random offset
err = driver.Swipe(0.5, 0.5, 0.5, 0.9,
option.WithOffsetRandomRange(-50, 50))
assert.Nil(t, err)
// tap random point in ocr text rect
err = driver.TapByOCR("首页", option.WithTapRandomRect(true))
}