UI Recorder 自动化测试 配置项(六)

配置项

一、配置文件

  • config.json:UIRecorder 工程相关配置
{
    "webdriver": {
        "host": "127.0.0.1",                      // WebDriver服务host
        "port": "4444",                           // WebDriver服务端口
        "browsers": "chrome, ie 11, firefox",     // 回归测试浏览器类型/版本
        "chromeOptions": {                        
          "w3c": false
        }
    },                                        
    "vars": {},                                   // 全局变量
    "reporter": {
        "distDir": ""                             // 自定义生成报告路径
    },
    "screenshots": {
        "captureAll": true                        // false 代表只在回归不通过步骤截图
    },
    "recorder": {
        "pathAttrs": "data-id,data-name,type,data-type,role,data-role,data-value",
        "attrValueBlack": "",
        "classValueBlack": "",
        "hideBeforeExpect": ""
    }
}
  • hosts:hosts文件
127.0.0.1 localhost

  回归测试指定 WebDriver 版本,参考 selenium-standalone 配置 command :https://www.npmjs.com/package/selenium-standalone#command-line-interface ,修改工程目录 package.jsoninstalldriver 命令即可。(一般建议使用最新版本,降低后续维护成本)

posted @ 2020-08-11 15:33  LaMw  阅读(361)  评论(0编辑  收藏  举报