change: update tests

This commit is contained in:
lilong.129
2025-06-26 19:39:54 +08:00
parent 32d2f7d27d
commit a6d6b5bad2
5 changed files with 51 additions and 43 deletions

View File

@@ -8,8 +8,7 @@
{
"port": 8700,
"mjpeg_port": 8800,
"log_on": true,
"xctest_bundle_id": "com.gtf.wda.runner.xctrunner"
"log_on": true
}
]
},
@@ -17,6 +16,7 @@
{
"name": "启动抖音",
"ios": {
"os_type": "ios",
"actions": [
{
"method": "home"
@@ -28,8 +28,10 @@
{
"method": "swipe_to_tap_app",
"params": "$app_name",
"identifier": "启动抖音",
"max_retry_times": 5
"options": {
"identifier": "启动抖音",
"max_retry_times": 5
}
},
{
"method": "sleep",
@@ -49,11 +51,14 @@
{
"name": "处理青少年弹窗",
"ios": {
"os_type": "ios",
"actions": [
{
"method": "tap_ocr",
"params": "我知道了",
"ignore_NotFoundError": true
"options": {
"ignore_NotFoundError": true
}
}
]
}
@@ -61,11 +66,14 @@
{
"name": "进入购物页",
"ios": {
"os_type": "ios",
"actions": [
{
"method": "tap_ocr",
"params": "商城",
"identifier": "点击商城"
"options": {
"identifier": "点击商城"
}
},
{
"method": "sleep",
@@ -77,11 +85,14 @@
{
"name": "进入推荐页",
"ios": {
"os_type": "ios",
"actions": [
{
"method": "tap_ocr",
"params": "推荐",
"identifier": "点击推荐"
"options": {
"identifier": "点击推荐"
}
},
{
"method": "sleep",
@@ -93,29 +104,36 @@
{
"name": "向上滑动 2 次",
"ios": {
"os_type": "ios",
"actions": [
{
"method": "swipe",
"method": "swipe_direction",
"params": "up",
"identifier": "第 1 次上划"
"options": {
"identifier": "第 1 次上划"
}
},
{
"method": "sleep",
"params": 2
},
{
"method": "swipe",
"method": "swipe_direction",
"params": "up",
"identifier": "第 2 次上划"
"options": {
"identifier": "第 2 次上划"
}
},
{
"method": "sleep",
"params": 2
},
{
"method": "swipe",
"method": "swipe_direction",
"params": "up",
"identifier": "第 3 次上划"
"options": {
"identifier": "第 3 次上划"
}
},
{
"method": "sleep",
@@ -127,7 +145,9 @@
0.9,
0.1
],
"identifier": "点击进入搜索框"
"options": {
"identifier": "点击进入搜索框"
}
},
{
"method": "sleep",
@@ -135,8 +155,17 @@
},
{
"method": "input",
"params": "httprunner",
"identifier": "输入搜索关键词"
"params": "httprunner 发版记录",
"options": {
"identifier": "输入搜索关键词"
}
},
{
"method": "tap_ocr",
"params": "搜索",
"options": {
"identifier": "点击搜索"
}
}
]
}

View File

@@ -43,7 +43,8 @@ func TestWDALog(t *testing.T) {
SwipeUp(option.WithIdentifier("第 2 次上划")).Sleep(2).
SwipeUp(option.WithIdentifier("第 3 次上划")).Sleep(2).
TapXY(0.9, 0.1, option.WithIdentifier("点击进入搜索框")).Sleep(2).
Input("httprunner", option.WithIdentifier("输入搜索关键词")),
Input("httprunner 发版记录", option.WithIdentifier("输入搜索关键词")).
TapByOCR("搜索", option.WithIdentifier("点击搜索")),
},
}