mirror of
https://github.com/httprunner/httprunner.git
synced 2026-06-01 13:59:37 +08:00
Merge branch 'dev-v4.3' of https://github.com/httprunner/httprunner into dev-v4.3
This commit is contained in:
@@ -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, ",")
|
||||
}
|
||||
|
||||
@@ -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
|
||||
}
|
||||
|
||||
|
||||
@@ -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
|
||||
}
|
||||
|
||||
@@ -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,
|
||||
|
||||
Reference in New Issue
Block a user