refactor: android ui automation

This commit is contained in:
xucong053
2022-09-28 14:10:50 +08:00
parent 3a661a5be5
commit 5753955668
13 changed files with 1912 additions and 1772 deletions
+10 -7
View File
@@ -241,14 +241,17 @@ func (dExt *DriverExt) StartLogRecording(identifier string) error {
func (dExt *DriverExt) GetLogs() (interface{}, error) {
log.Info().Msg("stop WDA log recording")
data := map[string]interface{}{"action": "stop"}
reply, err := dExt.triggerWDALog(data)
if err != nil {
log.Error().Err(err).Msg("failed to get WDA logs")
return "", errors.Wrap(err, "failed to get WDA logs")
if _, ok := dExt.Driver.(*wdaDriver); ok {
data := map[string]interface{}{"action": "stop"}
reply, err := dExt.triggerWDALog(data)
if err != nil {
return "", errors.Wrap(err, "failed to get WDA logs")
}
return reply.Value, nil
} else {
// TODO: Android log recording
}
return reply.Value, nil
return "", nil
}
func (dExt *DriverExt) triggerWDALog(data map[string]interface{}) (*wdaResponse, error) {