mocha.js - 引诱报告忽略了多个跳过的摩卡测试
问题描述
我正在使用 webdriverIO 和 mocha 开发一个框架。最近我安装了 Allure 报告器来使用 jenkins 生成 HTML 报告
不过,我面临跳过测试的问题。我有很多测试由一个没有任何代码的标题组成,仍然需要编写。在 mocha 中,我添加“it.skip”以跳过这些测试。跳过测试时,Allure 报告仅识别每个文件 1 个跳过的测试。
运行以下代码时,Allure 返回 1 个通过测试、1 个失败测试和 1 个跳过测试
describe('Allure test', function() {
it.skip('1. this is a skipped test without any code', function () {
})
it.skip('2. this is another skipped test without any code', function () {
});
it('3. this is an enabled test that has a successfull assert', function () {
chai.expect("foo", "foo should equal foo").to.contain("foo")
});
it('4. this is an enabled test that has a failed assert', function () {
chai.expect("foo", "foo should equal foo").to.contain("bar")
});
});
我真的很希望我的魅力报告显示跳过了多少测试,以便能够显示还剩下多少工作。
默认的 mocha 日志可以很好地处理这个问题,它显示了这个:
Number of specs: 1
1 passing (4.00s)
2 skipped
1 failing
我还使用了 wdio spec 报告器,它显示它是这样的,这也很好:
1 passing (2s)
2 pending
1 failing
我尝试使用 categories.json 文件来操作 Allure 类别,但我无法改变任何东西。我尝试将此作为测试,但将其添加到我的魅力结果文件夹中没有任何改变:
[
{
"name": "Ignored tests",
"matchedStatuses": ["skipped", "Skipped", "pending", "Pending", "failed", "Failed", "broken", "Broken", "skip", "Skip", "failing", "Failing", "passes", "Passes"]
}
]
我使用的工具和版本是:
`-- wdio-mocha-framework@0.6.2
`-- wdio-allure-reporter@0.6.3
`-- webdriverio@4.13.1
谁能告诉我如何让 Allure 看到所有跳过的测试?
解决方案
这是一个错误。我已经在https://github.com/webdriverio/wdio-allure-reporter/pull/127中修复了它
感谢您报告此事。如果您将来遇到此类错误,请在 github 上提出问题。
推荐阅读
- php - 从 CTP 添加自定义 WooCommerce 下拉结帐字段
- regex - 对不包含特定单词的句子使用正则表达式匹配
- javascript - 查找最大大小为 L 且总和为 N 或更少的所有可能数组的算法
- css - 有没有办法在 PyCharm 中使用 CSS?
- sql-server - 当我知道我的数据库文件将驻留在 SSD 驱动器上时,我是否应该以不同的方式设计我的数据库表和关系?
- kotlin - 无法从请求中捕获正文
- powershell - PowerShell 如何使用 -replace 在两个不同的字符之间进行清理
- python - 使用 Tesseract OCR 从扫描的 pdf 文件夹中提取文本
- java - 从 Firebase 获取数据列表并在不同的活动/片段中共享的最佳实践
- python - 将平面上的 3D 坐标转置到新的 2D 坐标系