【发布时间】:2016-11-03 08:52:41
【问题描述】:
是否可以设置跳过特定测试的消息(提及原因),以便在报告者中使用它。
describe('xxx', function() {
checkToSkip(1)("test1", function() {\*test goes here*\});
checkToSkip(4)("test2", function() {\*test goes here*\});
});
function checkToSkip(now) {
return now > 3 ? it : xit;
//return now > 3 ? it : it.skip;
}
这里 'test1' 将被跳过,因为 'checkToSkip' 返回 'xit'(或 it.skip)。是否可以向记者传达跳过测试的原因?如下所示(或任何其他可能的方式)。
checkToSkip(4)("test2", function() { \\ test goes here}, "My Skip message!!!!" );
注意:我在 webdriverIO 中使用 mocha。
谢谢。
【问题讨论】:
-
下面的线程解释了使用 Jasmine 问题的解决方案。我在摩卡中寻找类似的东西。 stackoverflow.com/questions/31688650/…
标签: mocha.js webdriver-io