mirror of
https://github.com/httprunner/httprunner.git
synced 2026-05-11 10:00:23 +08:00
feat: parse ios action params with variables
This commit is contained in:
@@ -1,6 +1,9 @@
|
||||
{
|
||||
"config": {
|
||||
"name": "通过 feed 卡片进入抖音直播间",
|
||||
"variables": {
|
||||
"app_name": "抖音"
|
||||
},
|
||||
"ios": [
|
||||
{
|
||||
"port": 8700,
|
||||
@@ -23,7 +26,7 @@
|
||||
},
|
||||
{
|
||||
"method": "swipe_to_tap_app",
|
||||
"params": "抖音",
|
||||
"params": "$app_name",
|
||||
"max_retry_times": 5
|
||||
},
|
||||
{
|
||||
|
||||
@@ -1,5 +1,7 @@
|
||||
config:
|
||||
name: 通过 feed 卡片进入抖音直播间
|
||||
variables:
|
||||
app_name: 抖音
|
||||
ios:
|
||||
- port: 8700
|
||||
mjpeg_port: 8800
|
||||
@@ -12,7 +14,7 @@ teststeps:
|
||||
- method: app_terminate
|
||||
params: com.ss.iphone.ugc.Aweme
|
||||
- method: swipe_to_tap_app
|
||||
params: 抖音
|
||||
params: $app_name
|
||||
max_retry_times: 5
|
||||
- method: sleep
|
||||
params: 5
|
||||
|
||||
@@ -10,13 +10,16 @@ import (
|
||||
func TestIOSDouyinLive(t *testing.T) {
|
||||
testCase := &hrp.TestCase{
|
||||
Config: hrp.NewConfig("通过 feed 卡片进入抖音直播间").
|
||||
WithVariables(map[string]interface{}{
|
||||
"app_name": "抖音",
|
||||
}).
|
||||
SetIOS(hrp.WithLogOn(true), hrp.WithPort(8700), hrp.WithMjpegPort(8800)),
|
||||
TestSteps: []hrp.IStep{
|
||||
hrp.NewStep("启动抖音").
|
||||
IOS().
|
||||
Home().
|
||||
AppTerminate("com.ss.iphone.ugc.Aweme"). // 关闭已运行的抖音
|
||||
SwipeToTapApp("抖音", hrp.WithMaxRetryTimes(5)).Sleep(5).
|
||||
SwipeToTapApp("$app_name", hrp.WithMaxRetryTimes(5)).Sleep(5).
|
||||
Validate().
|
||||
AssertOCRExists("推荐", "抖音启动失败,「推荐」不存在"),
|
||||
// hrp.NewStep("处理青少年弹窗").
|
||||
|
||||
Reference in New Issue
Block a user