魅力报告忽略了多个跳过的摩卡测试

时间:2018-07-31 14:34:58

标签: mocha webdriver-io allure

我正在使用webdriverIO和mocha开发框架。最近,我安装了Allure报告程序,以使用jenkins生成HTML报告

虽然我遇到了跳过测试的问题。我有很多测试,其中包含没有任何代码的标头,仍然需要编写。 在摩卡咖啡中,我添加“ it.skip”以跳过这些测试。 跳过测试时,“魅力”报告仅识别每个文件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

我尝试添加一个category.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看到所有跳过的测试吗?

1 个答案:

答案 0 :(得分:3)

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

中修复了它

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

相关问题