Feat/yuhongzheng/pre auto install

* fix: fix rotate tap swipe error
* fix: default input frequency from 60 to 10
* fix: error getting window size during screen rotation
* fix: kuake input unicode error
* feat: android input by appium ime
* feat: android swipe and tap with duration
* fix: format import file
* fix: format import file
* feat: 新增按控件点击,获取设备应用,修改日志获取
* feat: 新增ui2控件点击
* fix: format file
* fix: format file
* Merge branch 'video-release' into 'feat/yuhongzheng/pre_auto_install'
* merge
* Merge branch 'feat/yuhongzheng/pre_auto_install' of…
* fix: close reader
* Merge branch 'video-release' into 'feat/yuhongzheng/pre_auto_install'
* fix: format code
* Merge branch 'feat/yuhongzheng/pre_auto_install' of…
* fix: test send key

https://code.byted.org/iesqa/httprunner/merge_requests/34
This commit is contained in:
余泓铮
2024-05-10 07:02:41 +00:00
parent 912b4b943d
commit 3b4367cac4
20 changed files with 1108 additions and 134 deletions

View File

@@ -2,6 +2,7 @@ package uixt
import (
"fmt"
"github.com/rs/zerolog/log"
)
func (dExt *DriverExt) TapAbsXY(x, y float64, options ...ActionOption) error {
@@ -15,9 +16,19 @@ func (dExt *DriverExt) TapXY(x, y float64, options ...ActionOption) error {
return fmt.Errorf("x, y percentage should be <= 1, got x=%v, y=%v", x, y)
}
x = x * float64(dExt.windowSize.Width)
y = y * float64(dExt.windowSize.Height)
orientation, err := dExt.Driver.Orientation()
if err != nil {
log.Warn().Err(err).Msgf("tap (%v, %v) get orientation failed, use default orientation",
x, y)
orientation = OrientationPortrait
}
if orientation == OrientationPortrait {
x = x * float64(dExt.windowSize.Width)
y = y * float64(dExt.windowSize.Height)
} else {
x = x * float64(dExt.windowSize.Height)
y = y * float64(dExt.windowSize.Width)
}
return dExt.TapAbsXY(x, y, options...)
}
@@ -86,7 +97,19 @@ func (dExt *DriverExt) DoubleTapXY(x, y float64) error {
if x > 1 || y > 1 {
return fmt.Errorf("x, y percentage should be < 1, got x=%v, y=%v", x, y)
}
orientation, err := dExt.Driver.Orientation()
if err != nil {
log.Warn().Err(err).Msgf("tap (%v, %v) get orientation failed, use default orientation",
x, y)
orientation = OrientationPortrait
}
if orientation == OrientationPortrait {
x = x * float64(dExt.windowSize.Width)
y = y * float64(dExt.windowSize.Height)
} else {
x = x * float64(dExt.windowSize.Height)
y = y * float64(dExt.windowSize.Width)
}
x = x * float64(dExt.windowSize.Width)
y = y * float64(dExt.windowSize.Height)
return dExt.Driver.DoubleTapFloat(x, y)