Files
httprunner/examples/uitest/demo_ios_wda_log.json
2025-07-02 20:14:53 +08:00

177 lines
5.3 KiB
JSON

{
"config": {
"name": "验证 WDA 打点数据准确性",
"variables": {
"app_name": "抖音"
},
"ios": [
{
"port": 8700,
"mjpeg_port": 8800,
"log_on": true
}
]
},
"teststeps": [
{
"name": "启动抖音",
"ios": {
"os_type": "ios",
"actions": [
{
"method": "home"
},
{
"method": "app_terminate",
"params": "com.ss.iphone.ugc.Aweme"
},
{
"method": "swipe_to_tap_app",
"params": "$app_name",
"options": {
"identifier": "启动抖音",
"max_retry_times": 5
}
},
{
"method": "sleep",
"params": 5
}
]
},
"validate": [
{
"check": "ui_ocr",
"assert": "exists",
"expect": "推荐",
"msg": "抖音启动失败,「推荐」不存在"
}
]
},
{
"name": "处理青少年弹窗",
"ios": {
"os_type": "ios",
"actions": [
{
"method": "tap_ocr",
"params": "我知道了",
"options": {
"ignore_NotFoundError": true
}
}
]
}
},
{
"name": "进入购物页",
"ios": {
"os_type": "ios",
"actions": [
{
"method": "tap_ocr",
"params": "商城",
"options": {
"identifier": "点击商城"
}
},
{
"method": "sleep",
"params": 5
}
]
}
},
{
"name": "进入推荐页",
"ios": {
"os_type": "ios",
"actions": [
{
"method": "tap_ocr",
"params": "推荐",
"identifier": "点击推荐",
"offset": [
0,
-1
]
},
{
"method": "sleep",
"params": 5
}
]
}
},
{
"name": "向上滑动 2 次",
"ios": {
"os_type": "ios",
"actions": [
{
"method": "swipe_direction",
"params": "up",
"options": {
"identifier": "第 1 次上划"
}
},
{
"method": "sleep",
"params": 2
},
{
"method": "swipe_direction",
"params": "up",
"options": {
"identifier": "第 2 次上划"
}
},
{
"method": "sleep",
"params": 2
},
{
"method": "swipe_direction",
"params": "up",
"options": {
"identifier": "第 3 次上划"
}
},
{
"method": "sleep",
"params": 2
},
{
"method": "tap_xy",
"params": [
0.9,
0.1
],
"options": {
"identifier": "点击进入搜索框"
}
},
{
"method": "sleep",
"params": 2
},
{
"method": "input",
"params": "httprunner 发版记录",
"options": {
"identifier": "输入搜索关键词"
}
},
{
"method": "tap_ocr",
"params": "搜索",
"options": {
"identifier": "点击搜索"
}
}
]
}
}
]
}