diff --git a/hrp/internal/version/VERSION b/hrp/internal/version/VERSION index 5e34404a..0d9f6f29 100644 --- a/hrp/internal/version/VERSION +++ b/hrp/internal/version/VERSION @@ -1 +1 @@ -v5.0.0+2412241024 +v5.0.0+2412241212 diff --git a/hrp/pkg/uixt/action.go b/hrp/pkg/uixt/action.go index 129a8d67..33343f59 100644 --- a/hrp/pkg/uixt/action.go +++ b/hrp/pkg/uixt/action.go @@ -781,7 +781,6 @@ func (dExt *DriverExt) DoAction(action MobileAction) (err error) { CollectEndToEndDelay(dExt, action.GetOptions()...) return nil case ACTION_CallFunction: - log.Info().Interface("name", action.Params).Msg("call function") fn := action.Fn fn() } diff --git a/hrp/step_mobile_ui.go b/hrp/step_mobile_ui.go index da6c6fba..c952e9f3 100644 --- a/hrp/step_mobile_ui.go +++ b/hrp/step_mobile_ui.go @@ -401,10 +401,10 @@ func (s *StepMobile) ClosePopups(options ...uixt.ActionOption) *StepMobile { return s } -func (s *StepMobile) CallFunc(name string, fn func()) *StepMobile { +func (s *StepMobile) Call(name string, fn func()) *StepMobile { s.obj().Actions = append(s.obj().Actions, uixt.MobileAction{ Method: uixt.ACTION_CallFunction, - Params: name, + Params: name, // function description Fn: fn, Options: nil, }) @@ -675,18 +675,38 @@ func runStepMobileUI(s *SessionRunner, step IStep) (stepResult *StepResult, err attachments["error"] = err.Error() // save foreground app + startTime := time.Now() + actionResult := &ActionResult{ + MobileAction: uixt.MobileAction{ + Method: uixt.ACTION_GetForegroundApp, + Params: "[ForDebug] check foreground app", + }, + StartTime: startTime.Unix(), + } if app, err1 := uiDriver.Driver.GetForegroundApp(); err1 == nil { attachments["foreground_app"] = app.AppBaseInfo } else { log.Warn().Err(err1).Msg("save foreground app failed, ignore") } + actionResult.Elapsed = time.Since(startTime).Milliseconds() + stepResult.Actions = append(stepResult.Actions, actionResult) } // automatic handling of pop-up windows on each step finished if !ignorePopup && !s.caseRunner.Config.Get().IgnorePopup { + startTime := time.Now() + actionResult := &ActionResult{ + MobileAction: uixt.MobileAction{ + Method: uixt.ACTION_ClosePopups, + Params: "[ForDebug] close popups handler", + }, + StartTime: startTime.Unix(), + } if err2 := uiDriver.ClosePopupsHandler(); err2 != nil { log.Error().Err(err2).Str("step", step.Name()).Msg("auto handle popup failed") } + actionResult.Elapsed = time.Since(startTime).Milliseconds() + stepResult.Actions = append(stepResult.Actions, actionResult) } // save attachments