mirror of
https://github.com/httprunner/httprunner.git
synced 2026-09-05 23:51:25 +08:00
change: update wda logs
This commit is contained in:
+8
-3
@@ -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
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user