feat: get wda logs

This commit is contained in:
debugtalk
2022-09-22 21:11:38 +08:00
parent 9004f84791
commit 35225d97ff
17 changed files with 201 additions and 60 deletions

View File

@@ -7,6 +7,8 @@ import (
"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.
@@ -160,5 +162,20 @@ func (r *SessionRunner) GetSummary() *TestCaseSummary {
}
caseSummary.InOut.ExportVars = exportVars
caseSummary.InOut.ConfigVars = r.parsedConfig.Variables
logs := make(map[string]string)
for udid, client := range r.hrpRunner.wdaClients {
log, err := client.GetWDALog()
if err != nil {
logs[udid] = err.Error()
} else {
logs[udid] = log
}
}
logsStr, _ := json.Marshal(logs)
caseSummary.Logs = string(logsStr)
// caseSummary.Log
return caseSummary
}