Annotation Type Ignore


  • @Retention(RUNTIME)
    @Target({METHOD,TYPE,PACKAGE})
    public @interface Ignore
    Alternative of @Test(enabled=false)

    Notice that @Ignore on a class will disable all test methods of the class.

    Ignoring a class will ignore tests from child classes too.

    Ignoring a package will ignore all tests in the package and its sub-packages

    A package annotation is done in package-info.java. For example:

     @Ignore
     package test.ignorePackage;
    
     import org.testng.annotations.Ignore;
     
    • Optional Element Summary

      Optional Elements 
      Modifier and Type Optional Element Description
      java.lang.String value  
    • Element Detail

      • value

        java.lang.String value
        Default:
        ""