mirror of
https://github.com/priyanshujain/sanderling.git
synced 2026-10-02 19:17:10 +00:00
feat(mock): record LongPress action
This commit is contained in:
1 parent
fc54e86b17
commit
ecaae817a0
1 file changed
+9
@@ -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
|
||||
|
||||
Reference in new issue
Block a user