Trade Me是新西兰最大的在线拍卖和分类广告网站。
本实践选取了 10 个典型的 Trade Me API,旨在演示 API 自动化测试和 CI 流程。
- nodemailer.js: 通过此脚本向相关人员发送测试报告
- Trade MeSandBox.postman_collection.json: Postman正向案例脚本
- Trade MeSandBox-Negative.postman_collection.json: Postman 反向案例脚本
- fs 模块:第一次安装 Node.js 时生成
- moment 模块:获取当前时间。
- nodemailer 模块:将电子邮件发送给相关人员
通过 Collection Runner 或 Newman 生成报告,以及 Jenkins CI 过程
rem Initialization your local working folders
pushd d:\Software && md postman\collections postman\data postman\reports\hisreports postman\postman_github
rem set your postman home directory, this example is 'D:\Software\postman'
setx "POSTMAN_HOME" "D:\Software\postman" /M
rem clone demo GitHub repository
pushd %POSTMAN_HOME%\postman_github && git init && git clone https://github.com/ifulltest/postman.git
rem copy GitHub demo collections and data to your local working directory
copy %POSTMAN_HOME%\postman_github\postman\collections\* %POSTMAN_HOME%\collections\ && copy %POSTMAN_HOME%\postman_github\postman\data\* %POSTMAN_HOME%\data\*