refactor: rename options pkg to option

This commit is contained in:
lilong.129
2025-02-06 17:50:09 +08:00
parent b22f24cb6b
commit 194b61718f
61 changed files with 554 additions and 548 deletions
+4 -4
View File
@@ -7,7 +7,7 @@ import (
"time"
"github.com/httprunner/httprunner/v5/pkg/uixt"
"github.com/httprunner/httprunner/v5/pkg/uixt/options"
"github.com/httprunner/httprunner/v5/pkg/uixt/option"
)
var (
@@ -29,7 +29,7 @@ func init() {
}
func launchAppDriver(pkgName string) (driver *uixt.DriverExt, err error) {
device, _ := uixt.NewAndroidDevice(options.WithSerialNumber(serial))
device, _ := uixt.NewAndroidDevice(option.WithSerialNumber(serial))
driver, err = device.NewDriver()
if err != nil {
return nil, err
@@ -59,7 +59,7 @@ func launchAppDriver(pkgName string) (driver *uixt.DriverExt, err error) {
}
// 进入推荐页
err = driver.TapByOCR("推荐", options.WithScope(0, 0, 1, 0.3))
err = driver.TapByOCR("推荐", option.WithScope(0, 0, 1, 0.3))
if err != nil {
return nil, err
}
@@ -92,7 +92,7 @@ func watchVideo(driver *uixt.DriverExt) (err error) {
// 切换横屏
err = driver.TapByUIDetection(
options.WithScreenShotUITypes("fullScreen"))
option.WithScreenShotUITypes("fullScreen"))
if err != nil {
// 未找到横屏图标,该页面可能不是横版视频(直播|广告|Feed)
// 退出回到推荐页