mirror of
https://github.com/httprunner/httprunner.git
synced 2026-09-05 15:37:35 +08:00
feat: 支持获取剪贴版
This commit is contained in:
+29
@@ -1043,6 +1043,22 @@ func runStepMobileUI(s *SessionRunner, step IStep) (stepResult *StepResult, err
|
||||
continue
|
||||
}
|
||||
|
||||
if action.Method == option.ACTION_StartToGoal {
|
||||
planningResults, err := uiDriver.StartToGoal(ctx,
|
||||
action.Params.(string), action.GetOptions()...)
|
||||
actionResult.Elapsed = time.Since(actionStartTime).Milliseconds()
|
||||
actionResult.Plannings = planningResults
|
||||
stepResult.Actions = append(stepResult.Actions, actionResult)
|
||||
if err != nil {
|
||||
actionResult.Error = err.Error()
|
||||
if !code.IsErrorPredefined(err) {
|
||||
err = errors.Wrap(code.MobileUIDriverError, err.Error())
|
||||
}
|
||||
return stepResult, err
|
||||
}
|
||||
continue
|
||||
}
|
||||
|
||||
// handle AI operations (ai_action, ai_query, ai_assert) with unified result storage
|
||||
if action.Method == option.ACTION_AIAction || action.Method == option.ACTION_Query || action.Method == option.ACTION_AIAssert {
|
||||
var aiResult *uixt.AIExecutionResult
|
||||
@@ -1070,6 +1086,19 @@ func runStepMobileUI(s *SessionRunner, step IStep) (stepResult *StepResult, err
|
||||
}
|
||||
continue
|
||||
}
|
||||
if action.Method == option.ACTION_GetPasteboard {
|
||||
content, err := uiDriver.GetPasteboard()
|
||||
if err != nil {
|
||||
actionResult.Error = err.Error()
|
||||
if !code.IsErrorPredefined(err) {
|
||||
err = errors.Wrap(code.MobileUIDriverError, err.Error())
|
||||
}
|
||||
return stepResult, err
|
||||
}
|
||||
actionResult.ExtraData = content
|
||||
stepResult.Actions = append(stepResult.Actions, actionResult)
|
||||
continue
|
||||
}
|
||||
|
||||
// handle other non-AI actions
|
||||
sessionData, err := uiDriver.ExecuteAction(ctx, action)
|
||||
|
||||
Reference in New Issue
Block a user