This is what I can do in JUnit:
import org.junit.*;
@Ignore
public class FooTest {
//
}
and the entire class will be ignored. How can I do the same in TestNG?
Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.
Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.
Lost your password? Please enter your email address. You will receive a link and will create a new password via email.
Please briefly explain why you feel this question should be reported.
Please briefly explain why you feel this answer should be reported.
Please briefly explain why you feel this user should be reported.
I believe what you want is:
(You can apply the @Test annotation to the class, as well as to methods individually.)
The TestNG documentation has a comprehensive list of the supported annotations, and also describes exclusion/inclusion of tests by group if that’s of any interest. Here’s a quote from the relevant section:
EDIT:
Ignoring a class by applying
@Test(enabled=false)is apparently buggy functionality in some versions of TestNG according to this defect that was raised against TestNG.