mirror of
https://github.com/httprunner/httprunner.git
synced 2026-08-12 09:05:02 +08:00
feat: log mobile ui action start time and elapsed
This commit is contained in:
@@ -1 +1 @@
|
||||
v5.0.0+2411101040
|
||||
v5.0.0+2411101049
|
||||
|
||||
@@ -737,6 +737,11 @@ func runStepMobileUI(s *SessionRunner, step IStep) (stepResult *StepResult, err
|
||||
log.Warn().Msg("interrupted in mobile UI runner")
|
||||
return stepResult, errors.Wrap(code.InterruptError, "mobile UI runner interrupted")
|
||||
default:
|
||||
actionStartTime := time.Now()
|
||||
actionResult := &ActionResult{
|
||||
Name: string(action.Method),
|
||||
StartTime: actionStartTime.Unix(), // action 开始时间
|
||||
}
|
||||
if action.Params, err = s.caseRunner.parser.Parse(action.Params, stepVariables); err != nil {
|
||||
if !code.IsErrorPredefined(err) {
|
||||
err = errors.Wrap(code.ParseError,
|
||||
@@ -744,7 +749,10 @@ func runStepMobileUI(s *SessionRunner, step IStep) (stepResult *StepResult, err
|
||||
}
|
||||
return stepResult, err
|
||||
}
|
||||
if err := uiDriver.DoAction(action); err != nil {
|
||||
err = uiDriver.DoAction(action)
|
||||
actionResult.Elapsed = time.Since(actionStartTime).Milliseconds()
|
||||
stepResult.Actions = append(stepResult.Actions, actionResult)
|
||||
if err != nil {
|
||||
if !code.IsErrorPredefined(err) {
|
||||
err = errors.Wrap(code.MobileUIDriverError, err.Error())
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user