I don\'t have much experience with TestNG annotations, however I am trying to build a test suite using TestNG framework and POM design pattern for a retail website. I am plannin
You can use TestNG's annotation transformer to set the disabled
property of a @Test
annotation to true or false.
Example:
public class MyTransformer implements IAnnotationTransformer {
public void transform(ITest annotation, Class testClass,
Constructor testConstructor, Method testMethod){
if (isTestDisabled(testMethod.getName()))) {
annotation.setEnabled(false);
}
}
public boolean isTestDisabled(String testName){
// Do whatever you like here to determine if test is disabled or not
}
}