refactor: rename ApplyTapOffset

This commit is contained in:
lilong.129
2025-03-17 17:44:04 +08:00
parent b34a2218fe
commit 9fb53590ca
9 changed files with 29 additions and 25 deletions

View File

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