1 package org.testng.annotations; 2 3 import java.lang.annotation.Retention; 4 import java.lang.annotation.Target; 5 6 @Retention(java.lang.annotation.RetentionPolicy.RUNTIME) 7 @Target(java.lang.annotation.ElementType.METHOD) 8 public @interface AfterGroups { 9 /** 10 * The list of groups that this configuration method will run after. If 11 * specified it overrides the list of groups provided through 12 * {@link #groups()} attribute. This method is guaranteed to run shortly 13 * after the last test method that belongs to any of these groups is 14 * invoked. 15 */ value()16 public String[] value() default {}; 17 18 /** 19 * Whether methods on this class/method are enabled. 20 */ enabled()21 public boolean enabled() default true; 22 23 /** 24 * The list of groups this class/method belongs to. The list also describes the groups 25 * that this configuration method will be run after (if no {@link #value()} attribute is defined). 26 */ groups()27 public String[] groups() default {}; 28 29 /** 30 * The list of groups this method depends on. Every method 31 * member of one of these groups is guaranteed to have been 32 * invoked before this method. Furthermore, if any of these 33 * methods was not a SUCCESS, this test method will not be 34 * run and will be flagged as a SKIP. 35 */ dependsOnGroups()36 public String[] dependsOnGroups() default {}; 37 38 /** 39 * The list of methods this method depends on. There is no guarantee 40 * on the order on which the methods depended upon will be run, but you 41 * are guaranteed that all these methods will be run before the test method 42 * that contains this annotation is run. Furthermore, if any of these 43 * methods was not a SUCCESS, this test method will not be 44 * run and will be flagged as a SKIP. 45 * 46 * If some of these methods have been overloaded, all the overloaded 47 * versions will be run. 48 */ dependsOnMethods()49 public String[] dependsOnMethods() default {}; 50 51 /** 52 * For before methods (beforeSuite, beforeTest, beforeTestClass and 53 * beforeTestMethod, but not beforeGroups): 54 * If set to true, this configuration method will be run 55 * regardless of what groups it belongs to. 56 * <br> 57 * For after methods (afterSuite, afterClass, ...): 58 * If set to true, this configuration method will be run 59 * even if one or more methods invoked previously failed or 60 * was skipped. 61 */ alwaysRun()62 public boolean alwaysRun() default false; 63 64 /** 65 * If true, this @Configuration method will belong to groups specified in the 66 * @Test annotation on the class (if any). 67 */ inheritGroups()68 public boolean inheritGroups() default true; 69 70 /** 71 * The description for this method. The string used will appear in the 72 * HTML report and also on standard output if verbose >= 2. 73 */ description()74 public String description() default ""; 75 76 /** 77 * The maximum number of milliseconds this method should take. 78 * If it hasn't returned after this time, this method will fail and 79 * it will cause test methods depending on it to be skipped. 80 */ timeOut()81 public long timeOut() default 0; 82 } 83