java - Ignoring method in TestNG assert messages -
when test fails assert in testng test method outputs message containing method name so
mytestfixture:49->when_clicking_x_y_happens:49 expected:<foo...> was:<bar...> so far good. however, when having asserts in method test method displays weird message:
mytestfixture:49->testhelper.verifyxyzwasdisplayed:49 expected:<foo...> was:<bar...> here verifyxyzwasdisplayed testhelper class displayed in message. more helpful if message contained test method name instead. can somehow annotate method ignore when testng creates assert message?
i guess testhelper.verifyxyzwasdisplayed() method has assert*() in it. means assertionerror thrown point @ line assertion used.
instead, make return boolean true if condition met, use:
asserttrue(testhelper.verifyxyzwasdisplayed(blah));
Comments
Post a Comment