首页 > 解决方案 > 引诱报告忽略了多个跳过的摩卡测试

问题描述

我正在使用 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 看到所有跳过的测试?

标签: mocha.jswebdriver-ioallure

解决方案


这是一个错误。我已经在https://github.com/webdriverio/wdio-allure-reporter/pull/127中修复了它

感谢您报告此事。如果您将来遇到此类错误,请在 github 上提出问题。


推荐阅读