test: drag direction with random offset

This commit is contained in:
lilong.129
2025-03-17 18:13:10 +08:00
parent 5e2f33b362
commit 7d8efaa540
2 changed files with 7 additions and 2 deletions

View File

@@ -1 +1 @@
v5.0.0-beta-2503171806
v5.0.0-beta-2503171813

View File

@@ -170,7 +170,7 @@ func TestDriverExt_ClosePopupsHandler(t *testing.T) {
assert.Nil(t, err)
}
func TestDriverExt_Action_Risk(t *testing.T) {
func TestDriverExt_Action_Offset(t *testing.T) {
driver := setupADBDriverExt(t)
// tap point with constant offset
@@ -191,6 +191,11 @@ func TestDriverExt_Action_Risk(t *testing.T) {
option.WithOffsetRandomRange(-50, 50))
assert.Nil(t, err)
// drag direction with random offset
err = driver.Drag(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))
assert.Nil(t, err)