mirror of
https://github.com/httprunner/httprunner.git
synced 2026-05-12 10:59:42 +08:00
fix: failed to parse in android ui automation
This commit is contained in:
@@ -4,9 +4,9 @@ import (
|
||||
"fmt"
|
||||
"time"
|
||||
|
||||
"github.com/rs/zerolog/log"
|
||||
|
||||
"github.com/httprunner/httprunner/v4/hrp/internal/uixt"
|
||||
"github.com/pkg/errors"
|
||||
"github.com/rs/zerolog/log"
|
||||
)
|
||||
|
||||
var (
|
||||
@@ -466,6 +466,13 @@ func runStepAndroid(s *SessionRunner, step *TStep) (stepResult *StepResult, err
|
||||
}
|
||||
screenshots := make([]string, 0)
|
||||
|
||||
// override step variables
|
||||
stepVariables, err := s.MergeStepVariables(step.Variables)
|
||||
if err != nil {
|
||||
return
|
||||
}
|
||||
parser := s.GetParser()
|
||||
|
||||
// init uiaClient driver
|
||||
uiaClient, err := s.hrpRunner.initUIClient(&step.Android.AndroidDevice)
|
||||
if err != nil {
|
||||
@@ -511,6 +518,9 @@ func runStepAndroid(s *SessionRunner, step *TStep) (stepResult *StepResult, err
|
||||
|
||||
// run actions
|
||||
for _, action := range actions {
|
||||
if action.Params, err = parser.Parse(action.Params, stepVariables); err != nil {
|
||||
return stepResult, errors.Wrap(err, "parse action params failed")
|
||||
}
|
||||
if err := uiaClient.DoAction(action); err != nil {
|
||||
return stepResult, err
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user