fix: miss device serial for mobile step

This commit is contained in:
lilong.129
2024-09-25 16:08:09 +08:00
parent dc3728951c
commit 1fa3c567b9
5 changed files with 228 additions and 5 deletions

View File

@@ -56,4 +56,9 @@ func TestHarmonyDouyinE2E(t *testing.T) {
if err := testCase.Dump2JSON("harmony_e2e_delay_test.json"); err != nil {
t.Fatal(err)
}
err := hrp.Run(t, testCase)
if err != nil {
t.Fatal(err)
}
}

View File

@@ -0,0 +1,149 @@
{
"config": {
"name": "直播_抖音_端到端时延_harmony",
"variables": {
"device": "${ENV(SerialNumber)}",
"ups": "${ENV(LIVEUPLIST)}"
},
"harmony": [
{
"connect_key": "$device",
"log_on": true
}
]
},
"teststeps": [
{
"name": "启动抖音",
"harmony": {
"actions": [
{
"method": "app_terminate",
"params": "com.ss.hm.ugc.aweme"
},
{
"method": "swipe_to_tap_app",
"params": "com.ss.hm.ugc.aweme",
"options": {
}
},
{
"method": "home"
},
{
"method": "swipe_to_tap_app",
"params": "抖音",
"options": {
"max_retry_times": 5,
"offset": [
0,
-50
]
}
},
{
"method": "sleep",
"params": 20
}
]
},
"validate": [
{
"check": "ui_ocr",
"assert": "exists",
"expect": "推荐",
"msg": "进入抖音失败"
}
]
},
{
"name": "点击放大镜",
"harmony": {
"actions": [
{
"method": "tap_xy",
"params": [
0.9,
0.08
],
"options": {
}
},
{
"method": "sleep",
"params": 5
}
]
}
},
{
"name": "输入账号名称",
"harmony": {
"actions": [
{
"method": "input",
"params": "$ups",
"options": {
}
},
{
"method": "sleep",
"params": 5
}
]
}
},
{
"name": "点击搜索",
"harmony": {
"actions": [
{
"method": "tap_ocr",
"params": "搜索",
"options": {
}
},
{
"method": "sleep",
"params": 5
}
]
}
},
{
"name": "端到端采集",
"harmony": {
"actions": [
{
"method": "tap_ocr",
"params": "直播中",
"options": {
"ignore_NotFoundError": true,
"index": -1
}
},
{
"method": "live_e2e",
"options": {
"interval": 5,
"timeout": 120
}
},
{
"method": "tap_cv",
"options": {
"screenshot_with_ui_types": [
"close"
]
}
}
]
},
"loops": 5
}
]
}