mirror of
https://github.com/httprunner/httprunner.git
synced 2026-05-11 18:11:21 +08:00
fix: hrp run ios UI tests
This commit is contained in:
102
examples/uitest/demo_weixin_live.json
Normal file
102
examples/uitest/demo_weixin_live.json
Normal file
@@ -0,0 +1,102 @@
|
||||
{
|
||||
"config": {
|
||||
"name": "通过 feed 卡片进入微信直播间"
|
||||
},
|
||||
"teststeps": [
|
||||
{
|
||||
"name": "启动微信",
|
||||
"ios": {
|
||||
"actions": [
|
||||
{
|
||||
"method": "home"
|
||||
},
|
||||
{
|
||||
"method": "app_terminate",
|
||||
"params": "com.tencent.xin"
|
||||
},
|
||||
{
|
||||
"method": "swipe_to_tap_app",
|
||||
"params": "微信",
|
||||
"max_retry_times": 5
|
||||
}
|
||||
]
|
||||
},
|
||||
"validate": [
|
||||
{
|
||||
"check": "ui_label",
|
||||
"assert": "exists",
|
||||
"expect": "通讯录",
|
||||
"msg": "微信启动失败,「通讯录」不存在"
|
||||
}
|
||||
]
|
||||
},
|
||||
{
|
||||
"name": "进入直播页",
|
||||
"ios": {
|
||||
"actions": [
|
||||
{
|
||||
"method": "tap",
|
||||
"params": "发现"
|
||||
},
|
||||
{
|
||||
"method": "tap_ocr",
|
||||
"params": "视频号"
|
||||
}
|
||||
]
|
||||
}
|
||||
},
|
||||
{
|
||||
"name": "处理青少年弹窗",
|
||||
"ios": {
|
||||
"actions": [
|
||||
{
|
||||
"method": "tap_ocr",
|
||||
"params": "我知道了",
|
||||
"ignore_NotFoundError": true
|
||||
}
|
||||
]
|
||||
}
|
||||
},
|
||||
{
|
||||
"name": "在推荐页上划,直到出现「轻触进入直播间」",
|
||||
"ios": {
|
||||
"actions": [
|
||||
{
|
||||
"method": "swipe_to_tap_text",
|
||||
"params": "轻触进入直播间",
|
||||
"max_retry_times": 10
|
||||
}
|
||||
]
|
||||
}
|
||||
},
|
||||
{
|
||||
"name": "向上滑动,等待 10s",
|
||||
"ios": {
|
||||
"actions": [
|
||||
{
|
||||
"method": "swipe",
|
||||
"params": "up"
|
||||
},
|
||||
{
|
||||
"method": "sleep",
|
||||
"params": 10
|
||||
},
|
||||
{
|
||||
"method": "screenshot"
|
||||
},
|
||||
{
|
||||
"method": "swipe",
|
||||
"params": "up"
|
||||
},
|
||||
{
|
||||
"method": "sleep",
|
||||
"params": 10
|
||||
},
|
||||
{
|
||||
"method": "screenshot"
|
||||
}
|
||||
]
|
||||
}
|
||||
}
|
||||
]
|
||||
}
|
||||
@@ -34,7 +34,7 @@ func TestIOSWeixinLive(t *testing.T) {
|
||||
SwipeUp().Sleep(10).ScreenShot(), // 再上划 1 次,等待 10s,截图保存
|
||||
},
|
||||
}
|
||||
fmt.Println(testCase)
|
||||
|
||||
if err := testCase.Dump2JSON("demo_weixin_live.json"); err != nil {
|
||||
t.Fatal(err)
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user