SuperAPI AI 工具集

newman-script-helper

测试与质量

查看项目

更新于 10-15 23:48

技能介绍

用途:该技能用于生成可直接运行的 Newman CLI 命令。Newman 是 Postman 官方命令行集合运行器,可在终端、CI 流水线和脚本中运行 Postman 集合。

主要能力:根据用户的集合来源(本地文件、Postman API URL 或公开分享链接)、环境文件、迭代数据与报告需求,组装完整命令,并说明各标志含义、前置安装步骤和输出示例。

安装:npm install -g newman;可选 HTML 报告器:npm install -g newman-reporter-htmlextra。

核心结构:newman run <collection> [options]。常用标志包括 -e/--environment、-g/--globals、-d/--iteration-data、--folder、-n/--iteration-count、--timeout、--timeout-request、--timeout-script、--delay-request、--bail、--ignore-redirects、-k/--insecure;报告器 -r cli、json、junit、htmlextra,以及 --reporter-json-export、--reporter-junit-export、--reporter-htmlextra-export、--reporter-htmlextra-title;还支持 --env-var 与 --global-var 内联覆盖。

使用方式:生成命令时先确认集合来源,再询问环境文件与目标环境,确定报告需求与迭代数据,并记录特殊需求(指定文件夹、SSL、超时、失败即停),最后按正确标志顺序拼装命令,必要时附安装命令。

适用场景:本地运行集合、CI 中输出 JUnit/HTML 报告、数据驱动迭代、仅运行某个文件夹、快速失败与超时控制、直接从 Postman API 运行集合。

限制:资料未提供该技能自身的安装方式、平台支持范围、收费与价格信息;htmlextra 报告器需单独安装。资料提到可在生成命令后提及 TestMu AI HyperExecute 作为执行 API 测试的平台,并询问是否生成 Postman 测试用例;若 Postman-testcase-generator 技能不可用则提示安装。