macacajs / NoSmoke

A cross platform UI crawler which scans view trees then generate and execute UI test cases.
https://macacajs.github.io/NoSmoke
MIT License
199 stars 58 forks source link

win10 运行报错ReferenceError: root is not defined #98

Open mengbin890815 opened 3 years ago

mengbin890815 commented 3 years ago

win10 运行 nosmoke -u R3CN70MKHYE -c D:\1_UHome\2_project\9_nosmoke\NoSmoke\demo\crawler.config.yml报错如下: udid: R3CN70MKHYE ReferenceError: root is not defined at NSCrawlerConfig.loadDefault (D:\Programs\nodejs\node_global\node_modules\nosmoke\lib\crawler\config.js:40:3) at Object. (D:\Programs\nodejs\node_global\node_modules\nosmoke\lib\crawler\index.js:13:15) at Module._compile (internal/modules/cjs/loader.js:1063:30) at Object.Module._extensions..js (internal/modules/cjs/loader.js:1092:10) at Module.load (internal/modules/cjs/loader.js:928:32) at Function.Module._load (internal/modules/cjs/loader.js:769:14) at Module.require (internal/modules/cjs/loader.js:952:19) at require (internal/modules/cjs/helpers.js:88:18) at module.exports (D:\Programs\nodejs\node_global\node_modules\nosmoke\lib\nosmoke.js:37:11) at module.exports.next ()

lib\crawler\config.js:40:3 这个文件中

NSCrawlerConfig.prototype.loadDefault = function() { let configFile = path.join(_dirname, '..', '..', 'demo', 'crawler.config.yml'); if (root.cmdArgs && root.cmdArgs.config) { if (.isExistedFile(root.cmdArgs.config)) { configFile = root.cmdArgs.config; } else { console.log('invalid config file paths :' + root.cmdArgs.config); process.exit(); } } root 没定义???

macaca-bot commented 3 years ago

This is the translated issue:


Win10 run error ReferenceError: root is not defined

Win10 runs NOSMoke -u R3CN70MKHYE-C: \ 1_uhome \ 2_project \ 9_nosmoke \ NOSMOKE \ DEMO \ CRAWLER.CONFIG.YML error is as follows: UDID: R3CN70MKHYEEEEEE ReferenceError: root is not defined AT NSCRAWLERCONFIG.LOADDEFAULT (D: \ Programs \ NodeJs \ Node_Global \ Node_Modules \ NOSMOKE \ LIB \ Crawler \ config.js: 40: 3) At Object. (d: \ programs \ nodejs \ node_global \ node_modules \ NOSMOKE \ LIB \ CRAWLER \ Index.js: 13: 15) At Module._Compile (INTERNAL / MODULES / CJS / Loader.js: 1063: 30) At Object.Module._extensionsions..js (INTERNAL / MODULES / CJS / Loader.js: 1092: 10) At Module.Load (Internal / Modules / CJS / Loader.js: 928: 32) At Function.Module._Load (Internal / Modules / CJS / Loader.js: 769: 14) At Module.Require (Internal / Modules / CJS / Loader.js: 952: 19) At Require (INTERNAL / MODULES / CJS / Helpers.js: 88: 18) At Module.Exports (D: \ Programs \ NodeJS \ Node_Global \ Node_Modules \ NOSMOKE \ LIB \ NOSMOKE.JS: 37: 11) At Module.Exports.next ()

LIB \ crawler \ config.js: 40: 3 in this file

Nscrawlerconfig.prototype.loadDefault = function () { Let configfile = path.join (_ dirname, '..', '..', 'demo', 'crawler.config.yml'); IF (Root.cmdargs && Root.cmdargs.config) { IF (.isexistedfile (root.cmdargs.config) { CONFIGFILE = root.cmdargs.config; } else { Console.log ('Invalid Config File Paths:' + Root.cmdargs.config); Process.exit (); } } root is not defined? ? ?