自动化学习笔记1
1.例子比较多,postman这个工具,简单的get post 可以进行参数化编写,
2.mock数据,关键还是业务接口数据的mock,启用mock sever服务。
3.单元测试,mocha
Mocha是一个功能丰富的JavaScript测试框架,运行在Node.js和浏览器中,使异步测试变得简单有趣。MOCA测试连续运行,允许灵活且准确的报告,同时将异常异常映射到正确的测试用例。托管在GitHub上。
chai/jest
安装mocha:
npm install --global mocha
Password:
/usr/local/bin/mocha -> /usr/local/lib/node_modules/mocha/bin/mocha
/usr/local/bin/_mocha -> /usr/local/lib/node_modules/mocha/bin/_mocha
+ [email protected]
added 92 packages from 520 contributors in 4.43s
appledeMacBook-Pro-3:RNLearn apple$ sudo npm install --save-dev mochawesome
npm WARN saveError ENOENT: no such file or directory, open '/Users/apple/RNLearn/package.json'
npm notice created a lockfile as package-lock.json. You should commit this file.
npm WARN enoent ENOENT: no such file or directory, open '/Users/apple/RNLearn/package.json'
npm WARN [email protected] requires a peer of [email protected]>=5 but none is installed. You must install peer dependencies yourself.
npm WARN RNLearn No description
npm WARN RNLearn No repository field.
npm WARN RNLearn No README data
npm WARN RNLearn No license field.
+ [email protected]
added 57 packages from 35 contributors in 8.3s
转发:
http://www.ruanyifeng.com/blog/2015/12/a-mocha-tutorial-of-examples.html