{
    "config": {
        "name": "抓取抖音视频信息",
        "variables": {
            "device": "${ENV(SerialNumber)}"
        },
        "android": [
            {
                "serial": "$device"
            }
        ]
    },
    "teststeps": [
        {
            "name": "启动 app",
            "android": {
                "actions": [
                    {
                        "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": "滑动消费 feed 至少 10 个，live 至少 3 个；滑动过程中，70% 随机间隔 0-5s，30% 随机间隔 5-10s",
            "android": {
                "actions": [
                    {
                        "method": "video_crawler",
                        "params": {
                            "feed": {
                                "sleep_random": [
                                    0,
                                    5,
                                    0.7,
                                    5,
                                    10,
                                    0.3
                                ],
                                "target_count": 5,
                                "target_labels": [
                                    {
                                        "regex": true,
                                        "scope": [
                                            0,
                                            0.5,
                                            1,
                                            1
                                        ],
                                        "target": 1,
                                        "text": "^广告$"
                                    },
                                    {
                                        "regex": true,
                                        "scope": [
                                            0,
                                            0.5,
                                            1,
                                            1
                                        ],
                                        "target": 1,
                                        "text": "^图文$"
                                    },
                                    {
                                        "regex": true,
                                        "scope": [
                                            0,
                                            0.5,
                                            1,
                                            1
                                        ],
                                        "text": "^特效\\|"
                                    },
                                    {
                                        "regex": true,
                                        "scope": [
                                            0,
                                            0.5,
                                            1,
                                            1
                                        ],
                                        "text": "^模板\\|"
                                    },
                                    {
                                        "regex": true,
                                        "scope": [
                                            0,
                                            0.5,
                                            1,
                                            1
                                        ],
                                        "text": "^购物\\|"
                                    }
                                ]
                            },
                            "live": {
                                "sleep_random": [
                                    15,
                                    20
                                ],
                                "target_count": 3
                            },
                            "timeout": 600
                        }
                    }
                ]
            }
        },
        {
            "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"
                }
            ]
        }
    ]
}