feat: click on coordinate

This commit is contained in:
debugtalk
2022-07-27 12:07:21 +08:00
parent beb16221f2
commit 7ca12a0dbc

View File

@@ -307,8 +307,18 @@ func (w *wdaClient) doAction(action MobileAction) error {
// TODO
return errActionNotImplemented
case uiClick:
// TODO
return errActionNotImplemented
// click on coordinate
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:
// TODO
return errActionNotImplemented