typescript - 如何在量角器中重新运行失败的黄瓜场景?
问题描述
作为测试的一部分,我使用打字稿语言来开发与量角器兼容的代码,我使用的是 BDD 框架,我在 config.ts 中定义了一些黄瓜选项,如下所示:
capabilities: {
specs: "../example.feature"
}
cucumberOpts: {
compiler: "ts:ts-node/register",
format: "rerun:./reports/rerun.txt",
require: "../../stepdefinations/*.ts",
strict: true
}
onComplete: () =>{
Reporter.createHTMLReport();
}
如格式中所述,我能够在 rerun.txt 中获得失败的场景行号,其中包含以下内容:example.feature:145:439
如何在完成测试套件之前运行此文件,如何重新运行失败的场景 3 次
解决方案
从 2019 年 11 月起,您可以简单地将retry: 3
(或您希望允许的多次重试)添加到您的cucumberOpts
.
关于在重试失败成功后进程仍然返回退出代码 1 的问题,我已经打开了 Protractor 的问题并protractor-cucumber-framework
试图解决这个问题。
推荐阅读
- typescript - 通过类型名称 TypeScript 获取类型
- windows - 无法在 Windows 上的 Git Bash 中退出“输入提交消息以解释为什么这是必要的”
- r - 为什么在 R 编程中运行 Accuracy 函数时出错?
- c# - 在 C# ILoggerFactory 中使用 ILogger 对静态方法进行单元测试为 Null
- azure-active-directory - 用于获取所有 AAD 属性的图形 API
- snowflake-cloud-data-platform - 雪花中是否有任何选项可以保存或加载工作表?
- javascript - 从 vis-timeline 中删除边框/轮廓
- python - 在 Tensorflow v2 中按名称获取张量的规范方法是什么
- batch-file - RunAsInvoker 导致某些安装程序发生错误
- sql - SQL 函数无法返回数组