change: update wda logs

This commit is contained in:
debugtalk
2022-09-28 13:12:58 +08:00
parent 8a8c075654
commit 59e501a453
10 changed files with 41 additions and 15 deletions
+8 -3
View File
@@ -5,8 +5,11 @@ import (
"time"
"github.com/gorilla/websocket"
"github.com/pkg/errors"
"github.com/rs/zerolog/log"
"github.com/httprunner/httprunner/v4/hrp/internal/json"
)
// SessionRunner is used to run testcase and its steps.
@@ -162,15 +165,17 @@ func (r *SessionRunner) GetSummary() (*TestCaseSummary, error) {
caseSummary.InOut.ConfigVars = r.parsedConfig.Variables
// add WDA/UIA logs to summary
logs := make(map[string]string)
logs := make(map[string]interface{})
for udid, client := range r.hrpRunner.uiClients {
log, err := client.GetLogs()
if err != nil {
return nil, err
return caseSummary, err
}
logs[udid] = log
}
caseSummary.Logs = logs
logsBytes, _ := json.Marshal(logs)
caseSummary.Logs = string(logsBytes)
return caseSummary, nil
}