开发者

Is there a way to count the number of assertions in TestNG?

Actually the title includes the question.

I wou开发者_开发百科ld like to know how many assertions have been evaluated in the tests.


You could use aspectj for this. If you define a pointcut that matches with assert calls, you can keep a counter in an aspect and report that counter after the tests have run.

If you make the pointcut finegrained enough, you could count assertTrue() different from assertEquals(), etc.. if you would want that.


The short answer is no.

What you can do is use your own asserts and maintain a counter there.

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜