mirror of
https://github.com/httprunner/httprunner.git
synced 2026-09-07 08:27:35 +08:00
add: default scope and error codes mapping
This commit is contained in:
@@ -141,6 +141,12 @@ var errorsMap = map[error]int{
|
|||||||
OCRServiceConnectionError: 82,
|
OCRServiceConnectionError: 82,
|
||||||
OCRResponseError: 83,
|
OCRResponseError: 83,
|
||||||
OCRTextNotFoundError: 84,
|
OCRTextNotFoundError: 84,
|
||||||
|
|
||||||
|
CVEnvMissedError: 90,
|
||||||
|
CVRequestError: 91,
|
||||||
|
CVServiceConnectionError: 92,
|
||||||
|
CVResponseError: 93,
|
||||||
|
CVImageNotFoundError: 94,
|
||||||
}
|
}
|
||||||
|
|
||||||
func IsErrorPredefined(err error) bool {
|
func IsErrorPredefined(err error) bool {
|
||||||
|
|||||||
@@ -1 +1 @@
|
|||||||
v4.3.3.2306281303
|
v4.3.3.2307131714
|
||||||
@@ -613,6 +613,9 @@ func (dExt *DriverExt) DoAction(action MobileAction) error {
|
|||||||
}
|
}
|
||||||
return fmt.Errorf("invalid %s params: %v", ACTION_TapByOCR, action.Params)
|
return fmt.Errorf("invalid %s params: %v", ACTION_TapByOCR, action.Params)
|
||||||
case ACTION_TapByCV:
|
case ACTION_TapByCV:
|
||||||
|
if len(action.Scope) != 4 {
|
||||||
|
action.Scope = []float64{0, 0, 1, 1}
|
||||||
|
}
|
||||||
if imagePath, ok := action.Params.(string); ok {
|
if imagePath, ok := action.Params.(string); ok {
|
||||||
return dExt.TapByCV(
|
return dExt.TapByCV(
|
||||||
imagePath,
|
imagePath,
|
||||||
|
|||||||
Reference in New Issue
Block a user