mirror of
https://github.com/httprunner/httprunner.git
synced 2026-07-10 23:12:41 +08:00
change: return error if action not implemented
This commit is contained in:
@@ -1 +1 @@
|
|||||||
v5.0.0+2501062030
|
v5.0.0+2501071515
|
||||||
|
|||||||
@@ -10,6 +10,7 @@ import (
|
|||||||
"github.com/rs/zerolog"
|
"github.com/rs/zerolog"
|
||||||
"github.com/rs/zerolog/log"
|
"github.com/rs/zerolog/log"
|
||||||
|
|
||||||
|
"github.com/httprunner/httprunner/v4/hrp/code"
|
||||||
"github.com/httprunner/httprunner/v4/hrp/internal/builtin"
|
"github.com/httprunner/httprunner/v4/hrp/internal/builtin"
|
||||||
)
|
)
|
||||||
|
|
||||||
@@ -783,6 +784,11 @@ func (dExt *DriverExt) DoAction(action MobileAction) (err error) {
|
|||||||
case ACTION_CallFunction:
|
case ACTION_CallFunction:
|
||||||
fn := action.Fn
|
fn := action.Fn
|
||||||
fn()
|
fn()
|
||||||
|
return nil
|
||||||
|
default:
|
||||||
|
log.Warn().Str("action", string(action.Method)).Msg("action not implemented")
|
||||||
|
return errors.Wrapf(code.InvalidCaseError,
|
||||||
|
"UI action %v not implemented", action.Method)
|
||||||
}
|
}
|
||||||
return nil
|
return nil
|
||||||
}
|
}
|
||||||
@@ -793,8 +799,6 @@ type SleepConfig struct {
|
|||||||
Milliseconds int64 `json:"milliseconds,omitempty"`
|
Milliseconds int64 `json:"milliseconds,omitempty"`
|
||||||
}
|
}
|
||||||
|
|
||||||
var errActionNotImplemented = errors.New("UI action not implemented")
|
|
||||||
|
|
||||||
// getSimulationDuration returns simulation duration by given params (in seconds)
|
// getSimulationDuration returns simulation duration by given params (in seconds)
|
||||||
func getSimulationDuration(params []float64) (milliseconds int64) {
|
func getSimulationDuration(params []float64) (milliseconds int64) {
|
||||||
if len(params) == 1 {
|
if len(params) == 1 {
|
||||||
|
|||||||
Reference in New Issue
Block a user