mirror of
https://github.com/httprunner/httprunner.git
synced 2026-05-15 20:38:44 +08:00
fix: SwipeRelative error code
This commit is contained in:
@@ -19,14 +19,14 @@ func assertRelative(p float64) bool {
|
||||
func (dExt *DriverExt) SwipeRelative(fromX, fromY, toX, toY float64, options ...ActionOption) error {
|
||||
if !assertRelative(fromX) || !assertRelative(fromY) ||
|
||||
!assertRelative(toX) || !assertRelative(toY) {
|
||||
return errors.Wrap(code.MobileUISwipeError,
|
||||
return errors.Wrap(code.InvalidCaseError,
|
||||
fmt.Sprintf("fromX(%f), fromY(%f), toX(%f), toY(%f) must be less than 1",
|
||||
fromX, fromY, toX, toY))
|
||||
}
|
||||
|
||||
windowSize, err := dExt.Driver.WindowSize()
|
||||
if err != nil {
|
||||
return errors.Wrap(code.MobileUISwipeError, err.Error())
|
||||
return errors.Wrap(code.DeviceGetInfoError, err.Error())
|
||||
}
|
||||
width := windowSize.Width
|
||||
height := windowSize.Height
|
||||
|
||||
Reference in New Issue
Block a user