Inject test data to Junit reports for failed tests (failsafe plugin used) -
i have several tests cases in list using failsafe , junit per below:
@test public void testresults() { (testcase test : testcaselist) { int result = test.getactualresult(); int expected = test.getexpectedresult(); if (result != expected) { system.out.println("failed test " + test.gettestinfo()); } assertequals(result, expected); } }
i want report :
failed test <test description here> java.lang.assertionerror: expected: <4> but: <2>
instead of just:
java.lang.assertionerror: expected: <4> but: <2>
is there way junit or other framework?
you can add message assert:
assertequals(test.gettestinfo(), result, expected);
this creates following report:
java.lang.assertionerror: <test description here> expected: <4> but: <2>
Comments
Post a Comment