TestNG in IntelliJ - Test Results view
Hello,
I have searched in the forum to find an answer to my problem but I have not found something that really satisfy my needs.
I am looking for something like that but I am not able to get it.
My configuration is the following:
May be I have done something wrong but I am not able to find a quick way to fix my issue.
Could you please tell me what's wrong? or is it a bug of the IDE?
Best Regards,
Eugenio
Please sign in to leave a comment.
AFAIK If you want to have result of tests look like on your first screenshot you have to make your test parametrized, e.g.
@Test(dataProvider = "parametersForTestAdd")
public void testAdd(Integer a, Integer b, Integer expected)
throws Exception {
final Integer actual = a + b;
assertThat(actual, is(expected));
}
@DataProvider
public Object[][] parametersForTestAdd() {
return new Object[][] {
new Object[] { 2, 2, 4 },
new Object[] { 3, 3, 6 }
};
}
Remember to override toString() in case of complex type of parameters to have nice display as shown in your example test result.
Hello,
thanks a lot for you replay, I have forgotten to say I have done that.
I have found the issue, the button "hide passed" was selected so, after having pressed it I can see all the tests inside of a class.
Thanks a lot again.
Eu