1.YAML基本语法(参考的菜鸟教程)
2.pyCharm导入YAML模块
点击file → setting,然后按下图操作;
在输入框中输入“pyYAML”,勾选右下方“specify version”点击下拉选框选择需要的版本,点击“Install Package”,安装完成即可导入;
3.在项目下创建yaml文件:new →file,文件名为devices.yaml
4.devices.yaml 脚本内容如下
- devices:
platformName: Android
appPackage: com.xxxxxx.activities
appActivity: com.xxxxxx.activities.activity.init.InitActivity
deviceName: 127.0.0.1:62025
automationName: uiautomator2
noReset: True
udid: MKJNW18110003732
unicodeKeyboard: True
resetKeyboard: True
- publish:
allow_btn: //*[@text='始终允许']
cancleBtn: //*[@resource-id='com.xxxxxx.activities:id/negativeButton'