UIRecorder安装、录制、回放

Github地址https://github.com/alibaba/uirecorder/blob/master/README_zh-cn.md
UIRecorder使用手册https://www.yuque.com/artist/uirecorder/zslbnp

支持 android ios 和pc端的自动化脚本录制。无线native app(Android, iOS)录制是,是基于macaca实现的:https://macacajs.com

整体组成架构

在这里插入图片描述

UIRecorder录制功能基于macaca实现(包含:jwebdriver、selenium-standalone等),录制生成测试脚本 ——> mocha运行测试用例。mocha-parallel-tests可以并行执行用例插件,这里还会使用chai作为断言库 ——> 然后使用macaca-reporter生成对应的测试报告。
相关插件地址:
macaca:https://macacajs.com
Mocha和chai使用:https://blog.csdn.net/m0_60027772/article/details/125738692
macaca-reporter:https://github.com/macacajs/macaca-reporter
Macaca Reporter官网:https://macacajs.github.io/macaca-reporter/
selenium-standalone:https://github.com/webdriverio/selenium-standalone

UIRecorder安装(移动端要使用macaca服务,这里macaca依赖一并处理)

依赖添加

1、node环境:这里安装的时候和初始化的时候报错使用了两个版本,所以这里使用nvm来管理node环境,方便版本切换。参考安装https://blog.csdn.net/Charissa2017/article/details/104497572
2、JDK 1.8(其他版本也不太好使)
3、Android SDK:参考:https://blog.csdn.net/weixin_43665351/article/details/128780368
4、gradle:按依赖时有可能加载不上,使用brew install gradle安装。有可能还是失败,查看安装https://blog.csdn.net/weixin_43665351/article/details/128780936
5、安装 chrome :https://www.google.com/chrome/

安装UIRecorder
这里使用的node版本是v17.9.1

npm install uirecorder mocha -g

PC录制

1、初始化测试工程
创建新文件夹
uirecorder init # 这里使用node版本v14.20.0,缺的各种依赖一一补上,macaca-reporter安装不上,就全局安装-g
2、开始录制测试用例、启动WebDriver服务器
uirecorder sample/test.spec.js

在这里插入图片描述

3、运行测试用例
  • 运行所有脚本: source run.sh ( Linux|Mac ) 或 run.bat ( Windows )
  • 运行单个脚本: source run.sh sample/test.spec.js ( Linux|Mac ) 或 run.bat sample/test.spec.js ( Windows )
  • 获得测试报告和单步截图
./reports/index.html
./reports/index.xml (JUnit)
./reports/index.json
./截图/

移动端

1、安装并且启动macaca server:
安装Macaca:[https://macacajs.github.io/zh/guide/environment-setup.html#%E5%AE%89%E8%A3%85-node-js](https://macacajs.github.io/zh/guide/environment-setup.html#%E5%AE%89%E8%A3%85-node-js)
连接你的手机或模拟器:[https://macacajs.github.io/app-inspector/zh/guide/install.html#%E7%8E%AF%E5%A2%83%E9%9C%80%E8%A6%81](https://macacajs.github.io/app-inspector/zh/guide/install.html#%E7%8E%AF%E5%A2%83%E9%9C%80%E8%A6%81)
macaca server --port 4444
2、初始化测试工程
创建新文件夹
uirecorder init --mobile  # 这里使用node版本v14.20.0,缺的各种依赖一一补上,macaca-reporter安装不上,就全局安装-g

在这里插入图片描述

3、开始录制测试用例
uirecorder --mobile sample/test.spec.js

在这里插入图片描述
apk测试包下载:https://www.wandoujia.com/apps/32223

4、运行测试用例
  • 运行所有脚本: source run.sh ( Linux|Mac ) 或 run.bat ( Windows )
  • 运行单个脚本: source run.sh sample/test.spec.js ( Linux|Mac ) 或 run.bat sample/test.spec.js ( Windows )
  • 获得测试报告和单步截图
./reports/index.html
./reports/index.xml (JUnit)
./reports/index.json
./截图/

报错和处理记录:

sunxinyang@B-VD1SQ05P-2356 uirecorder_mobile % uirecorder --mobile sample/test.spec.js
    __  ______   ____                           __         
   / / / /  _/  / __ \___  _________  _________/ /__  _____
  / / / // /   / /_/ / _ \/ ___/ __ \/ ___/ __  / _ \/ ___/
 / /_/ // /   / _, _/  __/ /__/ /_/ / /  / /_/ /  __/ /    
 \____/___/  /_/ |_|\___/\___/\____/_/   \__,_/\___/_/    v3.5.3

Official Site: http://uirecorder.com
------------------------------------------------------------------

? 测试脚本文件名: sample/test.spec.js
? App路径 (扩展名: apk, app, zip): /Users/sunxinyang/Desktop/android/wandoujia.apk

录制服务器监听在端口: 63311
录制浏览器已开启
  tap: 同意 ( //*[@resource-id="com.wandoujia.phoenix2:id/mk"] )
   ✓ 执行成功
  tap: 暂不开启 ( //*[@resource-id="com.wandoujia.phoenix2:id/b8e"] )
   ✓ 执行成功
  tap: //*[@resource-id="com.wandoujia.phoenix2:id/awa"]
   ✓ 执行成功
------------------------------------------------------------------
共录制3个步骤 
录制脚本已保存: sample/test.spec.js

录制服务器已关闭
录制浏览器已关闭
sunxinyang@B-VD1SQ05P-2356 uirecorder_mobile % source run.sh sample/test.spec.js

> uirecorderTest@1.0.0 singletest /Users/sunxinyang/Desktop/uirecorder_mobile
> mocha --reporter macaca-reporter --reporter-options reportJSONFilename=index,processAlwaysExitWithZero=true --bail "sample/test.spec.js"

"macaca-reporter" reporter not found
/Users/sunxinyang/Desktop/uirecorder_mobile/node_modules/_mocha@5.2.0@mocha/lib/mocha.js:193
      throw new Error('invalid reporter "' + reporter + '"');
      ^

Error: invalid reporter "macaca-reporter"
    at Mocha.reporter (/Users/sunxinyang/Desktop/uirecorder_mobile/node_modules/_mocha@5.2.0@mocha/lib/mocha.js:193:13)
    at Object.<anonymous> (/Users/sunxinyang/Desktop/uirecorder_mobile/node_modules/_mocha@5.2.0@mocha/bin/_mocha:368:7)
    at Module._compile (internal/modules/cjs/loader.js:1085:14)
    at Object.Module._extensions..js (internal/modules/cjs/loader.js:1114:10)
    at Module.load (internal/modules/cjs/loader.js:950:32)
    at Function.Module._load (internal/modules/cjs/loader.js:790:12)
    at Function.executeUserEntryPoint [as runMain] (internal/modules/run_main.js:75:12)
    at internal/main/run_main_module.js:17:47
npm ERR! code ELIFECYCLE
npm ERR! errno 1
npm ERR! uirecorderTest@1.0.0 singletest: `mocha --reporter macaca-reporter --reporter-options reportJSONFilename=index,processAlwaysExitWithZero=true --bail "sample/test.spec.js"`
npm ERR! Exit status 1
npm ERR! 
npm ERR! Failed at the uirecorderTest@1.0.0 singletest script.
npm ERR! This is probably not a problem with npm. There is likely additional logging output above.

npm ERR! A complete log of this run can be found in:
npm ERR!     /Users/sunxinyang/.npm/_logs/2023-01-29T07_17_21_461Z-debug.log
sunxinyang@B-VD1SQ05P-2356 uirecorder_mobile % source run.sh sample/test.spec.js --reporter macaca-reporter --reporter-options reportJSONFilename=customReportJSONFilename

> uirecorderTest@1.0.0 singletest /Users/sunxinyang/Desktop/uirecorder_mobile
> mocha --reporter macaca-reporter --reporter-options reportJSONFilename=index,processAlwaysExitWithZero=true --bail "sample/test.spec.js"

"macaca-reporter" reporter not found
/Users/sunxinyang/Desktop/uirecorder_mobile/node_modules/_mocha@5.2.0@mocha/lib/mocha.js:193
      throw new Error('invalid reporter "' + reporter + '"');
      ^

Error: invalid reporter "macaca-reporter"
    at Mocha.reporter (/Users/sunxinyang/Desktop/uirecorder_mobile/node_modules/_mocha@5.2.0@mocha/lib/mocha.js:193:13)
    at Object.<anonymous> (/Users/sunxinyang/Desktop/uirecorder_mobile/node_modules/_mocha@5.2.0@mocha/bin/_mocha:368:7)
    at Module._compile (internal/modules/cjs/loader.js:1085:14)
    at Object.Module._extensions..js (internal/modules/cjs/loader.js:1114:10)
    at Module.load (internal/modules/cjs/loader.js:950:32)
    at Function.Module._load (internal/modules/cjs/loader.js:790:12)
    at Function.executeUserEntryPoint [as runMain] (internal/modules/run_main.js:75:12)
    at internal/main/run_main_module.js:17:47
npm ERR! code ELIFECYCLE
npm ERR! errno 1
npm ERR! uirecorderTest@1.0.0 singletest: `mocha --reporter macaca-reporter --reporter-options reportJSONFilename=index,processAlwaysExitWithZero=true --bail "sample/test.spec.js"`
npm ERR! Exit status 1
npm ERR! 
npm ERR! Failed at the uirecorderTest@1.0.0 singletest script.
npm ERR! This is probably not a problem with npm. There is likely additional logging output above.

npm ERR! A complete log of this run can be found in:
npm ERR!     /Users/sunxinyang/.npm/_logs/2023-01-29T07_18_44_248Z-debug.log
sunxinyang@B-VD1SQ05P-2356 uirecorder_mobile % npm i macaca-reporter --save
npm WARN deprecated uuid@3.4.0: Please upgrade  to version 7 or higher.  Older versions may use Math.random() in certain circumstances, which is known to be problematic.  See https://v8.dev/blog/math-random for details.
npm WARN deprecated istanbul@0.4.5: This module is no longer maintained, try this instead:
npm WARN deprecated   npm i nyc
npm WARN deprecated Visit https://istanbul.js.org/integrations for other alternatives.
npm WARN tar zlib: incorrect data check
npm WARN tar zlib: incorrect data check
npm WARN tarball cached data for sax@=0.4.2 (sha512-6Zsl4gnHjiTQfrOzsWdc0bHJepF5KJAVuM5fcyEJrqGyszkx2c55IclWP4D692rJrl1w0tExhbvYKjKNZl5wHg==) seems to be corrupted. Refreshing cache.
npm WARN tar zlib: incorrect data check
npm WARN tarball cached data for handlebars@^4.0.1 (sha512-aAcXm5OAfE/8IXkcZvCepKU3VzW1/39Fb5ZuqMtgI/hT8X2YgoMvBY5dLhq/cpOvw7Lk1nK/UF71aLG/ZnVYRA==) seems to be corrupted. Refreshing cache.
npm WARN tar zlib: incorrect data check
npm WARN tarball tarball data for handlebars@^4.0.1 (sha512-aAcXm5OAfE/8IXkcZvCepKU3VzW1/39Fb5ZuqMtgI/hT8X2YgoMvBY5dLhq/cpOvw7Lk1nK/UF71aLG/ZnVYRA==) seems to be corrupted. Trying one more time.
npm WARN uirecorderTest@1.0.0 No repository field.
npm WARN uirecorderTest@1.0.0 scripts['server'] should probably be scripts['start'].
npm WARN uirecorderTest@1.0.0 No license field.

npm ERR! code ENOENT
npm ERR! syscall rename
npm ERR! path /Users/sunxinyang/Desktop/uirecorder_mobile/node_modules/_form-data@2.1.4@form-data/node_modules/asynckit
npm ERR! dest /Users/sunxinyang/Desktop/uirecorder_mobile/node_modules/_form-data@2.1.4@form-data/node_modules/asynckit
npm ERR! errno -2
npm ERR! enoent ENOENT: no such file or directory, rename '/Users/sunxinyang/Desktop/uirecorder_mobile/node_modules/_form-data@2.1.4@form-data/node_modules/asynckit' -> '/Users/sunxinyang/Desktop/uirecorder_mobile/node_modules/_form-data@2.1.4@form-data/node_modules/asynckit'
npm ERR! enoent This is related to npm not being able to find a file.
npm ERR! enoent 

npm ERR! A complete log of this run can be found in:
npm ERR!     /Users/sunxinyang/.npm/_logs/2023-01-29T07_20_04_159Z-debug.log
sunxinyang@B-VD1SQ05P-2356 uirecorder_mobile % node -v                     
v14.20.0
sunxinyang@B-VD1SQ05P-2356 uirecorder_mobile % npm i -g macaca-reporter 
npm WARN deprecated uuid@3.4.0: Please upgrade  to version 7 or higher.  Older versions may use Math.random() in certain circumstances, which is known to be problematic.  See https://v8.dev/blog/math-random for details.
npm WARN deprecated mkdirp@0.5.1: Legacy versions of mkdirp are no longer supported. Please update to mkdirp 1.x. (Note that the API surface has changed to use Promises in 1.x.)
npm WARN deprecated istanbul@0.4.5: This module is no longer maintained, try this instead:
npm WARN deprecated   npm i nyc
npm WARN deprecated Visit https://istanbul.js.org/integrations for other alternatives.
npm WARN tar zlib: incorrect data check
npm WARN tar zlib: incorrect data check
npm WARN tarball cached data for sax@=0.4.2 (sha512-6Zsl4gnHjiTQfrOzsWdc0bHJepF5KJAVuM5fcyEJrqGyszkx2c55IclWP4D692rJrl1w0tExhbvYKjKNZl5wHg==) seems to be corrupted. Refreshing cache.
npm WARN tar zlib: incorrect data check
npm WARN tarball cached data for handlebars@^4.0.1 (sha512-aAcXm5OAfE/8IXkcZvCepKU3VzW1/39Fb5ZuqMtgI/hT8X2YgoMvBY5dLhq/cpOvw7Lk1nK/UF71aLG/ZnVYRA==) seems to be corrupted. Refreshing cache.
npm WARN tar zlib: incorrect data check
npm WARN tarball tarball data for handlebars@^4.0.1 (sha512-aAcXm5OAfE/8IXkcZvCepKU3VzW1/39Fb5ZuqMtgI/hT8X2YgoMvBY5dLhq/cpOvw7Lk1nK/UF71aLG/ZnVYRA==) seems to be corrupted. Trying one more time.
/Users/sunxinyang/.nvm/versions/node/v14.20.0/bin/macaca-reporter -> /Users/sunxinyang/.nvm/versions/node/v14.20.0/lib/node_modules/macaca-reporter/bin/macaca-reporter.js
/Users/sunxinyang/.nvm/versions/node/v14.20.0/bin/macaca-reporter-merge -> /Users/sunxinyang/.nvm/versions/node/v14.20.0/lib/node_modules/macaca-reporter/bin/merge-reporter.js
+ macaca-reporter@1.9.11
added 15 packages from 4 contributors, removed 621 packages and updated 123 packages in 7.763s
sunxinyang@B-VD1SQ05P-2356 uirecorder_mobile % source run.sh sample/test.spec.js 

> uirecorderTest@1.0.0 singletest /Users/sunxinyang/Desktop/uirecorder_mobile
> mocha --reporter macaca-reporter --reporter-options reportJSONFilename=index,processAlwaysExitWithZero=true --bail "sample/test.spec.js"

(node:87027) Warning: Accessing non-existent property 'VERSION' of module exports inside circular dependency
(Use `node --trace-warnings ...` to show where the warning was created)
(node:87027) Warning: Accessing non-existent property 'VERSION' of module exports inside circular dependency

Error: Cannot find module 'chai'
Require stack:
- /Users/sunxinyang/Desktop/uirecorder_mobile/sample/test.spec.js
    at Function.Module._resolveFilename (internal/modules/cjs/loader.js:902:15)
    at Function.Module._load (internal/modules/cjs/loader.js:746:27)
    at Module.require (internal/modules/cjs/loader.js:974:19)
    at require (internal/modules/cjs/helpers.js:101:18)
    at Object.<anonymous> (/Users/sunxinyang/Desktop/uirecorder_mobile/sample/test.spec.js:4:14)
    at Module._compile (internal/modules/cjs/loader.js:1085:14)
    at Object.Module._extensions..js (internal/modules/cjs/loader.js:1114:10)
    at Module.load (internal/modules/cjs/loader.js:950:32)
    at Function.Module._load (internal/modules/cjs/loader.js:790:12)
    at ModuleWrap.<anonymous> (internal/modules/esm/translators.js:199:29)
    at ModuleJob.run (internal/modules/esm/module_job.js:183:25)
    at async Loader.import (internal/modules/esm/loader.js:178:24)
    at async formattedImport (/Users/sunxinyang/.nvm/versions/node/v14.20.0/lib/node_modules/mocha/lib/nodejs/esm-utils.js:9:14)
    at async Object.exports.requireOrImport (/Users/sunxinyang/.nvm/versions/node/v14.20.0/lib/node_modules/mocha/lib/nodejs/esm-utils.js:42:28)
    at async Object.exports.loadFilesAsync (/Users/sunxinyang/.nvm/versions/node/v14.20.0/lib/node_modules/mocha/lib/nodejs/esm-utils.js:100:20)
    at async singleRun (/Users/sunxinyang/.nvm/versions/node/v14.20.0/lib/node_modules/mocha/lib/cli/run-helpers.js:125:3)
    at async Object.exports.handler (/Users/sunxinyang/.nvm/versions/node/v14.20.0/lib/node_modules/mocha/lib/cli/run.js:370:5)
npm ERR! code ELIFECYCLE
npm ERR! errno 1
npm ERR! uirecorderTest@1.0.0 singletest: `mocha --reporter macaca-reporter --reporter-options reportJSONFilename=index,processAlwaysExitWithZero=true --bail "sample/test.spec.js"`
npm ERR! Exit status 1
npm ERR! 
npm ERR! Failed at the uirecorderTest@1.0.0 singletest script.
npm ERR! This is probably not a problem with npm. There is likely additional logging output above.

npm ERR! A complete log of this run can be found in:
npm ERR!     /Users/sunxinyang/.npm/_logs/2023-01-29T07_24_18_041Z-debug.log
sunxinyang@B-VD1SQ05P-2356 uirecorder_mobile % npm i chai                       
npm WARN checkPermissions Missing write access to /Users/sunxinyang/Desktop/uirecorder_mobile/node_modules/_ansi-styles@3.2.1@ansi-styles/node_modules/color-convert
npm WARN checkPermissions Missing write access to /Users/sunxinyang/Desktop/uirecorder_mobile/node_modules/_asn1@0.2.6@asn1/node_modules/safer-buffer
npm WARN checkPermissions Missing write access to /Users/sunxinyang/Desktop/uirecorder_mobile/node_modules/_bcrypt-pbkdf@1.0.2@bcrypt-pbkdf/node_modules/tweetnacl
npm WARN checkPermissions Missing write access to /Users/sunxinyang/Desktop/uirecorder_mobile/node_modules/_bl@4.1.0@bl/node_modules/inherits
npm WARN checkPermissions Missing write access to /Users/sunxinyang/Desktop/uirecorder_mobile/node_modules/_boom@2.10.1@boom/node_modules/hoek
npm WARN checkPermissions Missing write access to /Users/sunxinyang/Desktop/uirecorder_mobile/node_modules/_brace-expansion@1.1.11@brace-expansion/node_modules/balanced-match
npm WARN checkPermissions Missing write access to /Users/sunxinyang/Desktop/uirecorder_mobile/node_modules/_brace-expansion@1.1.11@brace-expansion/node_modules/concat-map
npm WARN checkPermissions Missing write access to /Users/sunxinyang/Desktop/uirecorder_mobile/node_modules/_chalk@1.1.3@chalk/node_modules/ansi-styles
npm WARN checkPermissions Missing write access to /Users/sunxinyang/Desktop/uirecorder_mobile/node_modules/_chalk@1.1.3@chalk/node_modules/escape-string-regexp
npm WARN checkPermissions Missing write access to /Users/sunxinyang/Desktop/uirecorder_mobile/node_modules/_chalk@1.1.3@chalk/node_modules/has-ansi
npm WARN checkPermissions Missing write access to /Users/sunxinyang/Desktop/uirecorder_mobile/node_modules/_chalk@1.1.3@chalk/node_modules/strip-ansi
npm WARN checkPermissions Missing write access to /Users/sunxinyang/Desktop/uirecorder_mobile/node_modules/_chalk@1.1.3@chalk/node_modules/supports-color
npm WARN checkPermissions Missing write access to /Users/sunxinyang/Desktop/uirecorder_mobile/node_modules/_cliui@5.0.0@cliui/node_modules/wrap-ansi
npm WARN checkPermissions Missing write access to /Users/sunxinyang/Desktop/uirecorder_mobile/node_modules/_combined-stream@1.0.8@combined-stream/node_modules/delayed-stream
npm WARN checkPermissions Missing write access to /Users/sunxinyang/Desktop/uirecorder_mobile/node_modules/_cross-spawn@4.0.2@cross-spawn/node_modules/lru-cache
npm WARN checkPermissions Missing write access to /Users/sunxinyang/Desktop/uirecorder_mobile/node_modules/_cross-spawn@4.0.2@cross-spawn/node_modules/which
npm WARN checkPermissions Missing write access to /Users/sunxinyang/Desktop/uirecorder_mobile/node_modules/_dashdash@1.14.1@dashdash/node_modules/assert-plus
npm WARN checkPermissions Missing write access to /Users/sunxinyang/Desktop/uirecorder_mobile/node_modules/_debug@2.2.0@debug/node_modules/ms
npm WARN checkPermissions Missing write access to /Users/sunxinyang/Desktop/uirecorder_mobile/node_modules/_debug@3.1.0@debug/node_modules/ms
npm WARN checkPermissions Missing write access to /Users/sunxinyang/Desktop/uirecorder_mobile/node_modules/_debug@4.3.4@debug/node_modules/ms
npm WARN checkPermissions Missing write access to /Users/sunxinyang/Desktop/uirecorder_mobile/node_modules/_ecc-jsbn@0.1.2@ecc-jsbn/node_modules/jsbn
npm WARN checkPermissions Missing write access to /Users/sunxinyang/Desktop/uirecorder_mobile/node_modules/_ecc-jsbn@0.1.2@ecc-jsbn/node_modules/safer-buffer
npm WARN checkPermissions Missing write access to /Users/sunxinyang/Desktop/uirecorder_mobile/node_modules/_end-of-stream@1.4.4@end-of-stream/node_modules/once
npm WARN checkPermissions Missing write access to /Users/sunxinyang/Desktop/uirecorder_mobile/node_modules/_find-up@3.0.0@find-up/node_modules/locate-path
npm WARN checkPermissions Missing write access to /Users/sunxinyang/Desktop/uirecorder_mobile/node_modules/_generate-function@2.3.1@generate-function/node_modules/is-property
npm WARN checkPermissions Missing write access to /Users/sunxinyang/Desktop/uirecorder_mobile/node_modules/_generate-object-property@1.2.0@generate-object-property/node_modules/is-property
npm WARN checkPermissions Missing write access to /Users/sunxinyang/Desktop/uirecorder_mobile/node_modules/_getpass@0.1.7@getpass/node_modules/assert-plus
npm WARN checkPermissions Missing write access to /Users/sunxinyang/Desktop/uirecorder_mobile/node_modules/_glob@5.0.15@glob/node_modules/inflight
npm WARN checkPermissions Missing write access to /Users/sunxinyang/Desktop/uirecorder_mobile/node_modules/_glob@5.0.15@glob/node_modules/minimatch
npm WARN checkPermissions Missing write access to /Users/sunxinyang/Desktop/uirecorder_mobile/node_modules/_glob@5.0.15@glob/node_modules/once
npm WARN checkPermissions Missing write access to /Users/sunxinyang/Desktop/uirecorder_mobile/node_modules/_glob@5.0.15@glob/node_modules/path-is-absolute
npm WARN checkPermissions Missing write access to /Users/sunxinyang/Desktop/uirecorder_mobile/node_modules/_glob@7.1.2@glob/node_modules/fs.realpath
npm WARN checkPermissions Missing write access to /Users/sunxinyang/Desktop/uirecorder_mobile/node_modules/_gm@1.23.0@gm/node_modules/array-parallel
npm WARN checkPermissions Missing write access to /Users/sunxinyang/Desktop/uirecorder_mobile/node_modules/_gm@1.23.0@gm/node_modules/array-series
npm WARN checkPermissions Missing write access to /Users/sunxinyang/Desktop/uirecorder_mobile/node_modules/_har-validator@2.0.6@har-validator/node_modules/commander
npm WARN checkPermissions Missing write access to /Users/sunxinyang/Desktop/uirecorder_mobile/node_modules/_har-validator@2.0.6@har-validator/node_modules/is-my-json-valid
npm WARN checkPermissions Missing write access to /Users/sunxinyang/Desktop/uirecorder_mobile/node_modules/_har-validator@2.0.6@har-validator/node_modules/pinkie-promise
npm WARN checkPermissions Missing write access to /Users/sunxinyang/Desktop/uirecorder_mobile/node_modules/_hawk@3.1.3@hawk/node_modules/hoek
npm WARN checkPermissions Missing write access to /Users/sunxinyang/Desktop/uirecorder_mobile/node_modules/_hawk@3.1.3@hawk/node_modules/sntp
npm WARN checkPermissions Missing write access to /Users/sunxinyang/Desktop/uirecorder_mobile/node_modules/_http-signature@1.1.1@http-signature/node_modules/assert-plus
npm WARN checkPermissions Missing write access to /Users/sunxinyang/Desktop/uirecorder_mobile/node_modules/_http-signature@1.1.1@http-signature/node_modules/jsprim
npm WARN checkPermissions Missing write access to /Users/sunxinyang/Desktop/uirecorder_mobile/node_modules/_http-signature@1.1.1@http-signature/node_modules/sshpk
npm WARN checkPermissions Missing write access to /Users/sunxinyang/Desktop/uirecorder_mobile/node_modules/_jszip@2.5.0@jszip/node_modules/pako
npm WARN checkPermissions Missing write access to /Users/sunxinyang/Desktop/uirecorder_mobile/node_modules/_mime-types@2.1.35@mime-types/node_modules/mime-db
npm WARN checkPermissions Missing write access to /Users/sunxinyang/Desktop/uirecorder_mobile/node_modules/_mkdirp@0.5.1@mkdirp/node_modules/minimist
npm WARN checkPermissions Missing write access to /Users/sunxinyang/Desktop/uirecorder_mobile/node_modules/_p-limit@2.3.0@p-limit/node_modules/p-try
npm WARN checkPermissions Missing write access to /Users/sunxinyang/Desktop/uirecorder_mobile/node_modules/_string-width@3.1.0@string-width/node_modules/emoji-regex
npm WARN checkPermissions Missing write access to /Users/sunxinyang/Desktop/uirecorder_mobile/node_modules/_string-width@3.1.0@string-width/node_modules/is-fullwidth-code-point
npm WARN checkPermissions Missing write access to /Users/sunxinyang/Desktop/uirecorder_mobile/node_modules/_strip-ansi@5.2.0@strip-ansi/node_modules/ansi-regex
npm WARN checkPermissions Missing write access to /Users/sunxinyang/Desktop/uirecorder_mobile/node_modules/jquery
npm WARN checkPermissions Missing write access to /Users/sunxinyang/Desktop/uirecorder_mobile/node_modules/jwebdriver
npm WARN checkPermissions Missing write access to /Users/sunxinyang/Desktop/uirecorder_mobile/node_modules/macaca-mocha-parallel-tests
npm WARN checkPermissions Missing write access to /Users/sunxinyang/Desktop/uirecorder_mobile/node_modules/mocha
npm WARN checkPermissions Missing write access to /Users/sunxinyang/Desktop/uirecorder_mobile/node_modules/chai
npm WARN uirecorderTest@1.0.0 No repository field.
npm WARN uirecorderTest@1.0.0 scripts['server'] should probably be scripts['start'].
npm WARN uirecorderTest@1.0.0 No license field.

npm ERR! code ENOENT
npm ERR! syscall access
npm ERR! path /Users/sunxinyang/Desktop/uirecorder_mobile/node_modules/_ansi-styles@3.2.1@ansi-styles/node_modules/color-convert
npm ERR! errno -2
npm ERR! enoent ENOENT: no such file or directory, access '/Users/sunxinyang/Desktop/uirecorder_mobile/node_modules/_ansi-styles@3.2.1@ansi-styles/node_modules/color-convert'
npm ERR! enoent This is related to npm not being able to find a file.
npm ERR! enoent 

npm ERR! A complete log of this run can be found in:
npm ERR!     /Users/sunxinyang/.npm/_logs/2023-01-29T07_24_39_243Z-debug.log
sunxinyang@B-VD1SQ05P-2356 uirecorder_mobile % npm i -g chai                    
+ chai@4.3.7
added 8 packages from 20 contributors in 0.79s
sunxinyang@B-VD1SQ05P-2356 uirecorder_mobile % source run.sh sample/test.spec.js

> uirecorderTest@1.0.0 singletest /Users/sunxinyang/Desktop/uirecorder_mobile
> mocha --reporter macaca-reporter --reporter-options reportJSONFilename=index,processAlwaysExitWithZero=true --bail "sample/test.spec.js"

(node:87037) Warning: Accessing non-existent property 'VERSION' of module exports inside circular dependency
(Use `node --trace-warnings ...` to show where the warning was created)
(node:87037) Warning: Accessing non-existent property 'VERSION' of module exports inside circular dependency

Error: Cannot find module 'chai'
Require stack:
- /Users/sunxinyang/Desktop/uirecorder_mobile/sample/test.spec.js
    at Function.Module._resolveFilename (internal/modules/cjs/loader.js:902:15)
    at Function.Module._load (internal/modules/cjs/loader.js:746:27)
    at Module.require (internal/modules/cjs/loader.js:974:19)
    at require (internal/modules/cjs/helpers.js:101:18)
    at Object.<anonymous> (/Users/sunxinyang/Desktop/uirecorder_mobile/sample/test.spec.js:4:14)
    at Module._compile (internal/modules/cjs/loader.js:1085:14)
    at Object.Module._extensions..js (internal/modules/cjs/loader.js:1114:10)
    at Module.load (internal/modules/cjs/loader.js:950:32)
    at Function.Module._load (internal/modules/cjs/loader.js:790:12)
    at ModuleWrap.<anonymous> (internal/modules/esm/translators.js:199:29)
    at ModuleJob.run (internal/modules/esm/module_job.js:183:25)
    at async Loader.import (internal/modules/esm/loader.js:178:24)
    at async formattedImport (/Users/sunxinyang/.nvm/versions/node/v14.20.0/lib/node_modules/mocha/lib/nodejs/esm-utils.js:9:14)
    at async Object.exports.requireOrImport (/Users/sunxinyang/.nvm/versions/node/v14.20.0/lib/node_modules/mocha/lib/nodejs/esm-utils.js:42:28)
    at async Object.exports.loadFilesAsync (/Users/sunxinyang/.nvm/versions/node/v14.20.0/lib/node_modules/mocha/lib/nodejs/esm-utils.js:100:20)
    at async singleRun (/Users/sunxinyang/.nvm/versions/node/v14.20.0/lib/node_modules/mocha/lib/cli/run-helpers.js:125:3)
    at async Object.exports.handler (/Users/sunxinyang/.nvm/versions/node/v14.20.0/lib/node_modules/mocha/lib/cli/run.js:370:5)
npm ERR! code ELIFECYCLE
npm ERR! errno 1
npm ERR! uirecorderTest@1.0.0 singletest: `mocha --reporter macaca-reporter --reporter-options reportJSONFilename=index,processAlwaysExitWithZero=true --bail "sample/test.spec.js"`
npm ERR! Exit status 1
npm ERR! 
npm ERR! Failed at the uirecorderTest@1.0.0 singletest script.
npm ERR! This is probably not a problem with npm. There is likely additional logging output above.

npm ERR! A complete log of this run can be found in:
npm ERR!     /Users/sunxinyang/.npm/_logs/2023-01-29T07_25_01_855Z-debug.log
sunxinyang@B-VD1SQ05P-2356 uirecorder_mobile % cnpm i chai                      
✔ Installed 1 packages
✔ Linked 8 latest versions
✔ Run 0 scripts
✔ All packages installed (8 packages installed from npm registry, used 398ms(network 395ms), speed 0B/s, json 0(0B), tarball 0B, manifests cache hit 8, etag hit 8 / miss 0)
sunxinyang@B-VD1SQ05P-2356 uirecorder_mobile % source run.sh sample/test.spec.js

> uirecorderTest@1.0.0 singletest /Users/sunxinyang/Desktop/uirecorder_mobile
> mocha --reporter macaca-reporter --reporter-options reportJSONFilename=index,processAlwaysExitWithZero=true --bail "sample/test.spec.js"

(node:87072) Warning: Accessing non-existent property 'VERSION' of module exports inside circular dependency
(Use `node --trace-warnings ...` to show where the warning was created)
(node:87072) Warning: Accessing non-existent property 'VERSION' of module exports inside circular dependency

Error: Cannot find module 'jwebdriver'
Require stack:
- /Users/sunxinyang/Desktop/uirecorder_mobile/sample/test.spec.js
    at Function.Module._resolveFilename (internal/modules/cjs/loader.js:902:15)
    at Function.Module._load (internal/modules/cjs/loader.js:746:27)
    at Module.require (internal/modules/cjs/loader.js:974:19)
    at require (internal/modules/cjs/helpers.js:101:18)
    at Object.<anonymous> (/Users/sunxinyang/Desktop/uirecorder_mobile/sample/test.spec.js:6:20)
    at Module._compile (internal/modules/cjs/loader.js:1085:14)
    at Object.Module._extensions..js (internal/modules/cjs/loader.js:1114:10)
    at Module.load (internal/modules/cjs/loader.js:950:32)
    at Function.Module._load (internal/modules/cjs/loader.js:790:12)
    at ModuleWrap.<anonymous> (internal/modules/esm/translators.js:199:29)
    at ModuleJob.run (internal/modules/esm/module_job.js:183:25)
    at async Loader.import (internal/modules/esm/loader.js:178:24)
    at async formattedImport (/Users/sunxinyang/.nvm/versions/node/v14.20.0/lib/node_modules/mocha/lib/nodejs/esm-utils.js:9:14)
    at async Object.exports.requireOrImport (/Users/sunxinyang/.nvm/versions/node/v14.20.0/lib/node_modules/mocha/lib/nodejs/esm-utils.js:42:28)
    at async Object.exports.loadFilesAsync (/Users/sunxinyang/.nvm/versions/node/v14.20.0/lib/node_modules/mocha/lib/nodejs/esm-utils.js:100:20)
    at async singleRun (/Users/sunxinyang/.nvm/versions/node/v14.20.0/lib/node_modules/mocha/lib/cli/run-helpers.js:125:3)
    at async Object.exports.handler (/Users/sunxinyang/.nvm/versions/node/v14.20.0/lib/node_modules/mocha/lib/cli/run.js:370:5)
npm ERR! code ELIFECYCLE
npm ERR! errno 1
npm ERR! uirecorderTest@1.0.0 singletest: `mocha --reporter macaca-reporter --reporter-options reportJSONFilename=index,processAlwaysExitWithZero=true --bail "sample/test.spec.js"`
npm ERR! Exit status 1
npm ERR! 
npm ERR! Failed at the uirecorderTest@1.0.0 singletest script.
npm ERR! This is probably not a problem with npm. There is likely additional logging output above.

npm ERR! A complete log of this run can be found in:
npm ERR!     /Users/sunxinyang/.npm/_logs/2023-01-29T07_25_50_683Z-debug.log
sunxinyang@B-VD1SQ05P-2356 uirecorder_mobile % cnpm i jwebdriver                
✔ Installed 1 packages
✔ Linked 78 latest versions
✔ Run 0 scripts
deprecate jwebdriver@2.3.6 › request@2.79.0 request has been deprecated, see https://github.com/request/request/issues/3142
deprecate jwebdriver@2.3.6 › request@2.79.0 › har-validator@~2.0.6 this library is no longer supported
deprecate jwebdriver@2.3.6 › request@2.79.0 › hawk@~3.1.3 This module moved to @hapi/hawk. Please make sure to switch over as this distribution is no longer supported and may contain bugs and critical security issues.
deprecate jwebdriver@2.3.6 › request@2.79.0 › uuid@^3.0.0 Please upgrade  to version 7 or higher.  Older versions may use Math.random() in certain circumstances, which is known to be problematic.  See https://v8.dev/blog/math-random for details.
deprecate jwebdriver@2.3.6 › request@2.79.0 › hawk@3.1.3 › cryptiles@2.x.x This version has been deprecated in accordance with the hapi support policy (hapi.im/support). Please upgrade to the latest version to get the best features, bug fixes, and security patches. If you are unable to upgrade at this time, paid support is available for older versions (hapi.im/commercial).
deprecate jwebdriver@2.3.6 › request@2.79.0 › hawk@3.1.3 › sntp@1.x.x This module moved to @hapi/sntp. Please make sure to switch over as this distribution is no longer supported and may contain bugs and critical security issues.
deprecate jwebdriver@2.3.6 › request@2.79.0 › hawk@3.1.3 › boom@2.x.x This version has been deprecated in accordance with the hapi support policy (hapi.im/support). Please upgrade to the latest version to get the best features, bug fixes, and security patches. If you are unable to upgrade at this time, paid support is available for older versions (hapi.im/commercial).
deprecate jwebdriver@2.3.6 › request@2.79.0 › hawk@3.1.3 › hoek@2.x.x This version has been deprecated in accordance with the hapi support policy (hapi.im/support). Please upgrade to the latest version to get the best features, bug fixes, and security patches. If you are unable to upgrade at this time, paid support is available for older versions (hapi.im/commercial).
✔ All packages installed (81 packages installed from npm registry, used 992ms(network 966ms), speed 0B/s, json 0(0B), tarball 0B, manifests cache hit 78, etag hit 78 / miss 0)
sunxinyang@B-VD1SQ05P-2356 uirecorder_mobile % source run.sh sample/test.spec.js

> uirecorderTest@1.0.0 singletest /Users/sunxinyang/Desktop/uirecorder_mobile
> mocha --reporter macaca-reporter --reporter-options reportJSONFilename=index,processAlwaysExitWithZero=true --bail "sample/test.spec.js"

(node:87099) Warning: Accessing non-existent property 'VERSION' of module exports inside circular dependency
(Use `node --trace-warnings ...` to show where the warning was created)
(node:87099) Warning: Accessing non-existent property 'VERSION' of module exports inside circular dependency

Error: Cannot find module 'resemblejs-node'
Require stack:
- /Users/sunxinyang/Desktop/uirecorder_mobile/sample/test.spec.js
    at Function.Module._resolveFilename (internal/modules/cjs/loader.js:902:15)
    at Function.Module._load (internal/modules/cjs/loader.js:746:27)
    at Module.require (internal/modules/cjs/loader.js:974:19)
    at require (internal/modules/cjs/helpers.js:101:18)
    at Object.<anonymous> (/Users/sunxinyang/Desktop/uirecorder_mobile/sample/test.spec.js:8:18)
    at Module._compile (internal/modules/cjs/loader.js:1085:14)
    at Object.Module._extensions..js (internal/modules/cjs/loader.js:1114:10)
    at Module.load (internal/modules/cjs/loader.js:950:32)
    at Function.Module._load (internal/modules/cjs/loader.js:790:12)
    at ModuleWrap.<anonymous> (internal/modules/esm/translators.js:199:29)
    at ModuleJob.run (internal/modules/esm/module_job.js:183:25)
    at async Loader.import (internal/modules/esm/loader.js:178:24)
    at async formattedImport (/Users/sunxinyang/.nvm/versions/node/v14.20.0/lib/node_modules/mocha/lib/nodejs/esm-utils.js:9:14)
    at async Object.exports.requireOrImport (/Users/sunxinyang/.nvm/versions/node/v14.20.0/lib/node_modules/mocha/lib/nodejs/esm-utils.js:42:28)
    at async Object.exports.loadFilesAsync (/Users/sunxinyang/.nvm/versions/node/v14.20.0/lib/node_modules/mocha/lib/nodejs/esm-utils.js:100:20)
    at async singleRun (/Users/sunxinyang/.nvm/versions/node/v14.20.0/lib/node_modules/mocha/lib/cli/run-helpers.js:125:3)
    at async Object.exports.handler (/Users/sunxinyang/.nvm/versions/node/v14.20.0/lib/node_modules/mocha/lib/cli/run.js:370:5)
npm ERR! code ELIFECYCLE
npm ERR! errno 1
npm ERR! uirecorderTest@1.0.0 singletest: `mocha --reporter macaca-reporter --reporter-options reportJSONFilename=index,processAlwaysExitWithZero=true --bail "sample/test.spec.js"`
npm ERR! Exit status 1
npm ERR! 
npm ERR! Failed at the uirecorderTest@1.0.0 singletest script.
npm ERR! This is probably not a problem with npm. There is likely additional logging output above.

npm ERR! A complete log of this run can be found in:
npm ERR!     /Users/sunxinyang/.npm/_logs/2023-01-29T07_26_07_077Z-debug.log
sunxinyang@B-VD1SQ05P-2356 uirecorder_mobile % cnpm i resemblejs-node           
⠹ [0/1] Installing pngjs@3.2.0[jpeg-js@0.2.0] download Error: incorrect data check (jpeg-js@0.2.0) (/Users/sunxinyang/.npminstall_tarball/j/p/e/g/jpeg-js/0.2.0-53e448ec9d263e683266467e9442d2c5a2ef5482.tgz), fail count: 1[0/1] Installing pngjs@3.2.0[jpeg-js@0.2.0] format ungzip error, try to use tar format
✔ Installed 1 packages
✔ Linked 3 latest versions
✔ Run 0 scripts
✔ All packages installed (3 packages installed from npm registry, used 2s(network 2s), speed 1.86MB/s, json 0(0B), tarball 3.56MB, manifests cache hit 3, etag hit 3 / miss 0)
sunxinyang@B-VD1SQ05P-2356 uirecorder_mobile % source run.sh sample/test.spec.js

> uirecorderTest@1.0.0 singletest /Users/sunxinyang/Desktop/uirecorder_mobile
> mocha --reporter macaca-reporter --reporter-options reportJSONFilename=index,processAlwaysExitWithZero=true --bail "sample/test.spec.js"

(node:87148) Warning: Accessing non-existent property 'VERSION' of module exports inside circular dependency
(Use `node --trace-warnings ...` to show where the warning was created)
(node:87148) Warning: Accessing non-existent property 'VERSION' of module exports inside circular dependency


  0 passing (0ms)

>> html reporter generated: /Users/sunxinyang/Desktop/uirecorder_mobile/reports/index.html
>> json reporter generated: /Users/sunxinyang/Desktop/uirecorder_mobile/reports/index.json
>> reporter config generated: /Users/sunxinyang/Desktop/uirecorder_mobile/reports/config.json
sunxinyang@B-VD1SQ05P-2356 uirecorder_mobile % source run.sh                    

> uirecorderTest@1.0.0 paralleltest /Users/sunxinyang/Desktop/uirecorder_mobile
> macaca-mocha-parallel-tests "!(node_modules)/**/*.spec.js" --reporter macaca-reporter --reporter-options reportJSONFilename=index,processAlwaysExitWithZero=true --max-parallel 5 --bail

sh: macaca-mocha-parallel-tests: command not found
npm ERR! code ELIFECYCLE
npm ERR! syscall spawn
npm ERR! file sh
npm ERR! errno ENOENT
npm ERR! uirecorderTest@1.0.0 paralleltest: `macaca-mocha-parallel-tests "!(node_modules)/**/*.spec.js" --reporter macaca-reporter --reporter-options reportJSONFilename=index,processAlwaysExitWithZero=true --max-parallel 5 --bail`
npm ERR! spawn ENOENT
npm ERR! 
npm ERR! Failed at the uirecorderTest@1.0.0 paralleltest script.
npm ERR! This is probably not a problem with npm. There is likely additional logging output above.

npm ERR! A complete log of this run can be found in:
npm ERR!     /Users/sunxinyang/.npm/_logs/2023-01-29T07_51_20_486Z-debug.log
sunxinyang@B-VD1SQ05P-2356 uirecorder_mobile % source run.sh sample/test.spec.js

> uirecorderTest@1.0.0 singletest /Users/sunxinyang/Desktop/uirecorder_mobile
> mocha --reporter macaca-reporter --reporter-options reportJSONFilename=index,processAlwaysExitWithZero=true --bail "sample/test.spec.js"

(node:87522) Warning: Accessing non-existent property 'VERSION' of module exports inside circular dependency
(Use `node --trace-warnings ...` to show where the warning was created)
(node:87522) Warning: Accessing non-existent property 'VERSION' of module exports inside circular dependency


  0 passing (1ms)

>> html reporter generated: /Users/sunxinyang/Desktop/uirecorder_mobile/reports/index.html
>> json reporter generated: /Users/sunxinyang/Desktop/uirecorder_mobile/reports/index.json
>> reporter config generated: /Users/sunxinyang/Desktop/uirecorder_mobile/reports/config.json
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值