mirror of
https://github.com/priyanshujain/sanderling.git
synced 2026-10-04 20:17:09 +00:00
refactor(mock): record DoubleTap and DoubleTapSelector actions
This commit is contained in:
1 parent
198c9364fa
commit
ffa84af591
1 file changed
+18
@@ -15,6 +15,8 @@ const (
|
|||||||
ActionTerminate ActionKind = "terminate"
|
ActionTerminate ActionKind = "terminate"
|
||||||
ActionTap ActionKind = "tap"
|
ActionTap ActionKind = "tap"
|
||||||
ActionTapSelector ActionKind = "tap_selector"
|
ActionTapSelector ActionKind = "tap_selector"
|
||||||
|
ActionDoubleTap ActionKind = "double_tap"
|
||||||
|
ActionDoubleTapSelector ActionKind = "double_tap_selector"
|
||||||
ActionInputText ActionKind = "input_text"
|
ActionInputText ActionKind = "input_text"
|
||||||
ActionSwipe ActionKind = "swipe"
|
ActionSwipe ActionKind = "swipe"
|
||||||
ActionPressKey ActionKind = "press_key"
|
ActionPressKey ActionKind = "press_key"
|
||||||
@@ -183,6 +185,22 @@ func (d *Driver) TapSelector(ctx context.Context, selector string) error {
|
|||||||
return nil
|
return nil
|
||||||
}
|
}
|
||||||
|
|
||||||
|
func (d *Driver) DoubleTap(ctx context.Context, x, y int) error {
|
||||||
|
if err := d.failure(ActionDoubleTap); err != nil {
|
||||||
|
return err
|
||||||
|
}
|
||||||
|
d.record(Action{Kind: ActionDoubleTap, X: x, Y: y})
|
||||||
|
return nil
|
||||||
|
}
|
||||||
|
|
||||||
|
func (d *Driver) DoubleTapSelector(ctx context.Context, selector string) error {
|
||||||
|
if err := d.failure(ActionDoubleTapSelector); err != nil {
|
||||||
|
return err
|
||||||
|
}
|
||||||
|
d.record(Action{Kind: ActionDoubleTapSelector, Selector: selector})
|
||||||
|
return nil
|
||||||
|
}
|
||||||
|
|
||||||
func (d *Driver) InputText(ctx context.Context, text string) error {
|
func (d *Driver) InputText(ctx context.Context, text string) error {
|
||||||
if err := d.failure(ActionInputText); err != nil {
|
if err := d.failure(ActionInputText); err != nil {
|
||||||
return err
|
return err
|
||||||
|
|||||||
Reference in new issue
Block a user