jasmine - 如果以前执行的套件在量角器中失败,如何停止运行套件?
问题描述
我正在使用带有茉莉花框架的量角器。如果以前的套件失败,我需要解决方案来停止运行套件的执行。
我有如下三套测试套件: 1. 健康检查 - 测试所有 Web 服务是否返回 200 响应。2. 冒烟测试 - 检查前端的基本功能是否良好。3. 回归测试 - 测试所有特征。
我的要求是,如果健康检查测试用例失败,则不要运行冒烟测试用例。
这可以通过以下两种方式实现: 1. Jenkins 2. 在脚本中使用 process.exit(1)
但是,这两个不适合我的需要。
有没有办法通过量角器或茉莉花的方式来满足我的需求?
解决方案
您可以使用package.json
. 例如:
...
"scripts": {
"health": "launch here only health",
"smoke": "launch here only smoke",
"regression": "launch here only regression",
"test": "npm run health && npm run smoke && npm run regression",
},
...
您将使用npm run test
. 如果某些命令出现错误,其他命令将不会被执行。
推荐阅读
- javascript - moment().fromNow() 取决于用户的 PC 时间
- javascript - 如何指定数组索引?
- python - 如何在句子中使用'而不让它认为它的结束?
- docker - 用于删除所有 docker 容器的 Jenkins 管道脚本 - Windows :(
- php - 如何在 Laravel 的动态菜单上制作(或构思)多种语言?
- python - TypeError:int64 类型的对象不是 JSON 可序列化的
- entity-framework-6 - Entity Framework 6.4 使用 Azure Functions V3 引发 NullReferenceException
- ruby - 将 PDF417 代码字/二进制数组转换为 ID 自动化条形码字体代码
- ios - 检查 UICollectionView Cell 在哪一列?
- optimization - 如何使用 Optim 最小化 Julia 中的多元成本函数?