@AfterMethodpublic void changeStatusToNew(Method method){
if (method.getName().equalsIgnoreCase("changeStatus")) { // Do Test Case Specific thing
} //Call Generic Teardown super.tearDown();}
--
You received this message because you are subscribed to the Google Groups "testng-users" group.
To unsubscribe from this group and stop receiving emails from it, send an email to testng-users...@googlegroups.com.
To post to this group, send email to testng...@googlegroups.com.
Visit this group at https://groups.google.com/group/testng-users.
For more options, visit https://groups.google.com/d/optout.
Possibly but I would do it exactly like you did. That’s why TestNG passes you the method in your @AfterMethod
: so you can perform method specific actions should you need to.
Cucumber has an elegant way to handle this, something called tagged hooks, Can we implement something like this in TestNG?
Look at the link below for tagged hooks.
http://zsoltfabok.com/blog/2012/09/cucumber-jvm-hooks/