diff --git a/examples/uitest/android_follow_live_test.json b/examples/uitest/android_follow_live_test.json new file mode 100644 index 00000000..e1c57a25 --- /dev/null +++ b/examples/uitest/android_follow_live_test.json @@ -0,0 +1,192 @@ +{ + "config": { + "name": "直播_抖音_关注天窗_android", + "variables": { + "device": "${ENV(SerialNumber)}", + "ups": "${ENV(LIVEUPLIST)}" + }, + "android": [ + { + "serial": "$device", + "log_on": true, + "close_popup": true + } + ] + }, + "teststeps": [ + { + "name": "启动抖音", + "android": { + "actions": [ + { + "method": "app_terminate", + "params": "com.ss.android.ugc.aweme" + }, + { + "method": "app_launch", + "params": "com.ss.android.ugc.aweme" + }, + { + "method": "home" + }, + { + "method": "swipe_to_tap_app", + "params": "抖音", + "max_retry_times": 5, + "offset": [ + 0, + -50 + ] + }, + { + "method": "sleep", + "params": 20 + } + ] + } + }, + { + "name": "处理青少年弹窗", + "android": { + "actions": [ + { + "method": "tap_ocr", + "params": "我知道了", + "ignore_NotFoundError": true + } + ] + }, + "validate": [ + { + "check": "ui_ocr", + "assert": "exists", + "expect": "推荐", + "msg": "进入抖音失败" + } + ] + }, + { + "name": "点击关注", + "android": { + "actions": [ + { + "method": "tap_ocr", + "params": "关注", + "index": -1 + }, + { + "method": "sleep", + "params": 10 + } + ] + } + }, + { + "name": "点击直播标签,进入直播间", + "android": { + "actions": [ + { + "method": "swipe_to_tap_texts", + "params": "${split_by_comma($ups)}", + "identifier": "click_live", + "wait_time": 1, + "direction": [ + 0.6, + 0.2, + 0.4, + 0.2 + ], + "offset": [ + 0, + -50 + ] + } + ] + } + }, + { + "name": "等待1分钟", + "android": { + "actions": [ + { + "method": "sleep", + "params": 30 + } + ] + } + }, + { + "name": "上滑进入下一个直播间", + "android": { + "actions": [ + { + "method": "swipe", + "params": [ + 0.9, + 0.9, + 0.9, + 0.1 + ], + "identifier": "slide_in_live" + }, + { + "method": "sleep", + "params": 30 + } + ] + } + }, + { + "name": "再上滑进入下一个直播间", + "android": { + "actions": [ + { + "method": "swipe", + "params": [ + 0.9, + 0.9, + 0.9, + 0.1 + ], + "identifier": "slide_in_live" + }, + { + "method": "sleep", + "params": 30 + } + ] + } + }, + { + "name": "返回主界面,并打开本地时间戳", + "android": { + "actions": [ + { + "method": "home" + }, + { + "method": "swipe_to_tap_app", + "params": "local", + "max_retry_times": 5, + "offset": [ + 0, + -50 + ] + }, + { + "method": "sleep", + "params": 10 + } + ] + }, + "validate": [ + { + "check": "ui_ocr", + "assert": "exists", + "expect": "16", + "msg": "打开本地时间戳失败" + } + ] + } + ] +} \ No newline at end of file diff --git a/hrp/pkg/uixt/service_vedem.go b/hrp/pkg/uixt/service_vedem.go index e2c4330b..3d7c6e68 100644 --- a/hrp/pkg/uixt/service_vedem.go +++ b/hrp/pkg/uixt/service_vedem.go @@ -217,6 +217,10 @@ func (s *veDEMImageService) GetImage(imageBuf *bytes.Buffer, options ...ActionOp for _, uiType := range actionOptions.ScreenShotWithUITypes { bodyWriter.WriteField("uiTypes", uiType) } + + // 临时支持直播使用高精度集群 + bodyWriter.WriteField("ocrCluster", "default_1600") + if actionOptions.ScreenShotWithOCRCluster != "" { bodyWriter.WriteField("ocrCluster", actionOptions.ScreenShotWithOCRCluster) }