MCPcopy
hub / github.com/httprunner/httprunner / convertCompatMobileStep

Function convertCompatMobileStep

hrp/testcase.go:363–385  ·  view source on GitHub ↗
(mobileStep *MobileStep)

Source from the content-addressed store, hash-verified

361}
362
363func convertCompatMobileStep(mobileStep *MobileStep) {
364 if mobileStep == nil {
365 return
366 }
367 for i := 0; i < len(mobileStep.Actions); i++ {
368 ma := mobileStep.Actions[i]
369 actionOptions := uixt.NewActionOptions(ma.GetOptions()...)
370 // append tap_cv params to screenshot_with_ui_types option
371 if ma.Method == uixt.ACTION_TapByCV {
372 uiTypes, _ := builtin.ConvertToStringSlice(ma.Params)
373 ma.ActionOptions.ScreenShotWithUITypes = append(ma.ActionOptions.ScreenShotWithUITypes, uiTypes...)
374 }
375 // set default max_retry_times to 10 for swipe_to_tap_texts
376 if ma.Method == uixt.ACTION_SwipeToTapTexts && actionOptions.MaxRetryTimes == 0 {
377 ma.ActionOptions.MaxRetryTimes = 10
378 }
379 // set default max_retry_times to 10 for swipe_to_tap_text
380 if ma.Method == uixt.ACTION_SwipeToTapText && actionOptions.MaxRetryTimes == 0 {
381 ma.ActionOptions.MaxRetryTimes = 10
382 }
383 mobileStep.Actions[i] = ma
384 }
385}
386
387// convertJmespathExpr deals with limited jmespath expression conversion
388func convertJmespathExpr(checkExpr string) string {

Callers 1

MakeCompatMethod · 0.85

Calls 3

NewActionOptionsFunction · 0.92
ConvertToStringSliceFunction · 0.92
GetOptionsMethod · 0.80

Tested by

no test coverage detected