mirror of
https://github.com/priyanshujain/sanderling.git
synced 2026-10-04 20:17:09 +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"
|
ActionInputText ActionKind = "input_text"
|
||||||
ActionSwipe ActionKind = "swipe"
|
ActionSwipe ActionKind = "swipe"
|
||||||
ActionPressKey ActionKind = "press_key"
|
ActionPressKey ActionKind = "press_key"
|
||||||
|
ActionLongPress ActionKind = "long_press"
|
||||||
ActionHierarchy ActionKind = "hierarchy"
|
ActionHierarchy ActionKind = "hierarchy"
|
||||||
ActionScreenshot ActionKind = "screenshot"
|
ActionScreenshot ActionKind = "screenshot"
|
||||||
ActionSnapshot ActionKind = "snapshot"
|
ActionSnapshot ActionKind = "snapshot"
|
||||||
@@ -166,6 +167,14 @@ func (d *Driver) Tap(ctx context.Context, x, y int) error {
|
|||||||
return nil
|
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 {
|
func (d *Driver) TapSelector(ctx context.Context, selector string) error {
|
||||||
if err := d.failure(ActionTapSelector); err != nil {
|
if err := d.failure(ActionTapSelector); err != nil {
|
||||||
return err
|
return err
|
||||||
|
|||||||
Reference in new issue
Block a user