From ecaae817a0d9db211727e8be10968cdf30caa0b5 Mon Sep 17 00:00:00 2001 From: PJ Date: Sun, 31 May 2026 18:01:38 +0530 Subject: [PATCH] feat(mock): record LongPress action --- internal/driver/mock/mock.go | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/internal/driver/mock/mock.go b/internal/driver/mock/mock.go index d03af0a..731148e 100644 --- a/internal/driver/mock/mock.go +++ b/internal/driver/mock/mock.go @@ -18,6 +18,7 @@ const ( ActionInputText ActionKind = "input_text" ActionSwipe ActionKind = "swipe" ActionPressKey ActionKind = "press_key" + ActionLongPress ActionKind = "long_press" ActionHierarchy ActionKind = "hierarchy" ActionScreenshot ActionKind = "screenshot" ActionSnapshot ActionKind = "snapshot" @@ -166,6 +167,14 @@ func (d *Driver) Tap(ctx context.Context, x, y int) error { return nil } +func (d *Driver) LongPress(ctx context.Context, x, y int) error { + if err := d.failure(ActionLongPress); err != nil { + return err + } + d.record(Action{Kind: ActionLongPress, X: x, Y: y}) + return nil +} + func (d *Driver) TapSelector(ctx context.Context, selector string) error { if err := d.failure(ActionTapSelector); err != nil { return err