xploreraj
xploreraj

Reputation: 4362

Is there a way to run @Test(enabled = false) tests forcibly?

There are many tests that are disabled as above, I want to run full suite xml without manually changing the parameter to true which will be a tedious effort. Is there any way?

Upvotes: 0

Views: 186

Answers (2)

juherr
juherr

Reputation: 5740

You just have to use an IAnnotationTransformer and register it as a listener.

public class RunAllTests implements IAnnotationTransformer {
    public void transform(ITest annotation, Class<?> testClass,
      Constructor testConstructor, Method testMethod) {
        annotation.setEnabled(true);
    }
}

Upvotes: 1

gsone
gsone

Reputation: 1231

You can try using AspectJ and create pointcuts in order to annotate @Test(enabled = false). However I'm not sure what will happened if you annotate with @Test(enabled = true) if there previous was set @Test(enabled = false). You can first verify that before go to AspectJ.

Upvotes: 0

Related Questions