UI Recorder 自動化測試 配置項(六)
阿新 • • 發佈:2020-08-11
配置項
一、配置檔案
- 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.json
下 installdriver
命令即可。(一般建議使用最新版本,降低後續維護成本)