refactor: add WDA/UIA logs to summary

This commit is contained in:
lilong.129
2025-07-04 14:32:23 +08:00
parent 147020cbe5
commit e734424382
+6 -6
View File
@@ -711,16 +711,17 @@ func (r *SessionRunner) Start(givenVars map[string]interface{}) (summary *TestCa
} }
} }
// TODO: move to mobile ui step
// Collect logs from cached drivers // Collect logs from cached drivers
for _, cached := range uixt.ListCachedDrivers() { for _, cached := range uixt.ListCachedDrivers() {
// add WDA/UIA logs to summary client := cached.Item
if !client.GetDevice().LogEnabled() {
continue
}
// add WDA/UIA2 logs to summary
logs := map[string]interface{}{ logs := map[string]interface{}{
"uuid": cached.Key, "uuid": cached.Key,
} }
client := cached.Item
if client.GetDevice().LogEnabled() {
log, err1 := client.StopCaptureLog() log, err1 := client.StopCaptureLog()
if err1 != nil { if err1 != nil {
if err == nil { if err == nil {
@@ -731,7 +732,6 @@ func (r *SessionRunner) Start(givenVars map[string]interface{}) (summary *TestCa
return return
} }
logs["content"] = log logs["content"] = log
}
summary.Logs = append(summary.Logs, logs) summary.Logs = append(summary.Logs, logs)
} }