change: update examples

This commit is contained in:
lilong.129
2023-04-18 19:33:15 +08:00
parent 58f1fec2fa
commit 409808f297
5 changed files with 102 additions and 81 deletions
@@ -0,0 +1,140 @@
{
"config": {
"name": "点播_抖音_滑动场景_随机间隔_android",
"variables": {
"device": "${ENV(SerialNumber)}"
},
"android": [
{
"serial": "$device"
}
]
},
"teststeps": [
{
"name": "启动抖音",
"android": {
"actions": [
{
"method": "app_terminate",
"params": "com.ss.android.ugc.aweme"
},
{
"method": "app_launch",
"params": "com.ss.android.ugc.aweme"
},
{
"method": "sleep",
"params": 5
}
]
},
"validate": [
{
"check": "ui_foreground_app",
"assert": "equal",
"expect": "com.ss.android.ugc.aweme",
"msg": "app [com.ss.android.ugc.aweme] should be in foreground"
}
]
},
{
"name": "处理青少年弹窗",
"android": {
"actions": [
{
"method": "tap_ocr",
"params": "我知道了",
"ignore_NotFoundError": true
}
]
}
},
{
"name": "在推荐页上划,直到出现「点击进入直播间」",
"android": {
"actions": [
{
"method": "swipe_to_tap_text",
"params": "点击进入直播间",
"identifier": "进入直播间",
"max_retry_times": 10
}
]
}
},
{
"name": "滑动 Feed 5 次,60% 随机间隔 0-5s40% 随机间隔 5-10s",
"android": {
"actions": [
{
"method": "swipe",
"params": "up"
},
{
"method": "sleep_random",
"params": [
0,
5,
0.6,
5,
10,
0.4
]
}
]
},
"loops": 5
},
{
"name": "向上滑动,等待 10s",
"android": {
"actions": [
{
"method": "swipe",
"params": "up",
"identifier": "第一次上划"
},
{
"method": "sleep",
"params": 10
},
{
"method": "screenshot"
},
{
"method": "swipe",
"params": "up",
"identifier": "第二次上划"
},
{
"method": "sleep",
"params": 10
},
{
"method": "screenshot"
}
]
}
},
{
"name": "exit",
"android": {
"actions": [
{
"method": "app_terminate",
"params": "com.ss.android.ugc.aweme"
}
]
},
"validate": [
{
"check": "ui_foreground_app",
"assert": "not_equal",
"expect": "com.ss.android.ugc.aweme",
"msg": "app [com.ss.android.ugc.aweme] should not be in foreground"
}
]
}
]
}