mirror of
https://github.com/httprunner/httprunner.git
synced 2026-09-05 07:26:55 +08:00
feat: click on coordinate
This commit is contained in:
+12
-2
@@ -307,8 +307,18 @@ func (w *wdaClient) doAction(action MobileAction) error {
|
|||||||
// TODO
|
// TODO
|
||||||
return errActionNotImplemented
|
return errActionNotImplemented
|
||||||
case uiClick:
|
case uiClick:
|
||||||
// TODO
|
// click on coordinate
|
||||||
return errActionNotImplemented
|
if location, ok := action.Params.([]int); ok {
|
||||||
|
if len(location) != 2 {
|
||||||
|
return fmt.Errorf("invalid click location params: %v", location)
|
||||||
|
}
|
||||||
|
return w.Driver.Tap(location[0], location[1])
|
||||||
|
}
|
||||||
|
// click on xpath
|
||||||
|
if _, ok := action.Params.(string); ok {
|
||||||
|
return errActionNotImplemented
|
||||||
|
}
|
||||||
|
return fmt.Errorf("invalid click params: %v", action.Params)
|
||||||
case uiDoubleClick:
|
case uiDoubleClick:
|
||||||
// TODO
|
// TODO
|
||||||
return errActionNotImplemented
|
return errActionNotImplemented
|
||||||
|
|||||||
Reference in New Issue
Block a user