mirror of
https://github.com/httprunner/httprunner.git
synced 2026-09-07 16:40:50 +08:00
feat: 支持获取剪贴版
This commit is contained in:
@@ -1 +1 @@
|
|||||||
v5.0.0-250802
|
v5.0.0-250811
|
||||||
|
|||||||
@@ -67,6 +67,7 @@ type ActionResult struct {
|
|||||||
Plannings []*uixt.PlanningExecutionResult `json:"plannings,omitempty"` // store planning results for start_to_goal actions, which contains multiple sub-actions
|
Plannings []*uixt.PlanningExecutionResult `json:"plannings,omitempty"` // store planning results for start_to_goal actions, which contains multiple sub-actions
|
||||||
AIResult *uixt.AIExecutionResult `json:"ai_result,omitempty"` // store unified AI execution result for ai_query/ai_action/ai_assert actions
|
AIResult *uixt.AIExecutionResult `json:"ai_result,omitempty"` // store unified AI execution result for ai_query/ai_action/ai_assert actions
|
||||||
uixt.SessionData // store session data for other actions besides start_to_goal
|
uixt.SessionData // store session data for other actions besides start_to_goal
|
||||||
|
ExtraData interface{} `json:"extra_data,omitempty"`
|
||||||
}
|
}
|
||||||
|
|
||||||
// one testcase contains one or multiple steps
|
// one testcase contains one or multiple steps
|
||||||
|
|||||||
+29
@@ -1043,6 +1043,22 @@ func runStepMobileUI(s *SessionRunner, step IStep) (stepResult *StepResult, err
|
|||||||
continue
|
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
|
// 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 {
|
if action.Method == option.ACTION_AIAction || action.Method == option.ACTION_Query || action.Method == option.ACTION_AIAssert {
|
||||||
var aiResult *uixt.AIExecutionResult
|
var aiResult *uixt.AIExecutionResult
|
||||||
@@ -1070,6 +1086,19 @@ func runStepMobileUI(s *SessionRunner, step IStep) (stepResult *StepResult, err
|
|||||||
}
|
}
|
||||||
continue
|
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
|
// handle other non-AI actions
|
||||||
sessionData, err := uiDriver.ExecuteAction(ctx, action)
|
sessionData, err := uiDriver.ExecuteAction(ctx, action)
|
||||||
|
|||||||
Reference in New Issue
Block a user