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