Merge branch 'dev-v4.3' of https://github.com/httprunner/httprunner into dev-v4.3

This commit is contained in:
debugtalk
2022-10-13 20:47:11 +08:00
7 changed files with 313 additions and 6 deletions

View File

@@ -28,6 +28,7 @@ var Functions = map[string]interface{}{
"md5": MD5, // call with one argument
"parameterize": loadFromCSV,
"P": loadFromCSV,
"split_by_comma": splitByComma, // call with one argument
"environ": os.Getenv,
"ENV": os.Getenv,
"load_ws_message": loadMessage,
@@ -225,3 +226,7 @@ func multipartContentType(w *TFormDataWriter) string {
}
return w.Writer.FormDataContentType()
}
func splitByComma(s string) []string {
return strings.Split(s, ",")
}

View File

@@ -63,6 +63,9 @@ func GetAndroidDeviceOptions(dev *AndroidDevice) (deviceOptions []AndroidDeviceO
if dev.Port != 0 {
deviceOptions = append(deviceOptions, WithAdbPort(dev.Port))
}
if dev.LogOn {
deviceOptions = append(deviceOptions, WithAdbLogOn(true))
}
return
}

View File

@@ -429,14 +429,17 @@ func (dExt *DriverExt) DoAction(action MobileAction) error {
ACTION_SwipeToTapText, action.Params)
case ACTION_SwipeToTapTexts:
if texts, ok := action.Params.([]interface{}); ok {
var textList []string
for _, t := range texts {
textList = append(textList, t.(string))
}
action.Params = textList
}
if texts, ok := action.Params.([]string); ok {
var point PointF
findText := func(d *DriverExt) error {
var err error
var ts []string
for _, t := range texts {
ts = append(ts, t.(string))
}
points, err := d.GetTextXYs(ts)
points, err := d.GetTextXYs(texts)
if err != nil {
return err
}

View File

@@ -263,7 +263,7 @@ func (s *StepMobile) SwipeToTapText(text string, options ...uixt.ActionOption) *
return &StepMobile{step: s.step}
}
func (s *StepMobile) SwipeToTapTexts(texts []string, options ...uixt.ActionOption) *StepMobile {
func (s *StepMobile) SwipeToTapTexts(texts interface{}, options ...uixt.ActionOption) *StepMobile {
action := uixt.MobileAction{
Method: uixt.ACTION_SwipeToTapTexts,
Params: texts,