# Play back a use case through the command line

After a successful manual playback of a use case recorded through the tool, a script can be written in a command line call to automate it.

# A simple playback

# 打开自动化测试窗口
cli auto-replay --project /Users/username/demo
# 打开自动化测试窗口并回放全部测试用例
cli auto-replay --project /Users/username/demo --replay-all

Other tools can refer to the instructions:

# Custom configuration

Tool version1.06.2210092and above support incoming configuration file paths--replay-config-path]]Modify simulator model / test account used for playback, etc.

cli auto-replay --project /Users/username/demo --replay-config-path /Users/username/your/path/autoreplay.config.json --replay-all

Please note: The replay-config-pathshould be the path to a valid json file, supported by the following parameters:

export interface IWIReplayConfig {
  simulator: {
    device: string // 目前仅支持工具内置的模拟器
  }
  account: string // 测试账号openid,目前仅支持工具内置的测试账号
}

Autoreplay.config.jsonfile reference is as follows:

{
  "simulator": {
    "device":"iPhone 12/13 Pro Max"
  },
  "account": "o6zAJs7UlU8WQeD35GAJZ9kTeAyc"
}