Top Methods
org.testng.annotations

public @Interface AfterTest

extends Annotation
Annotations
@Retention:RUNTIME
@Target:METHOD
@Documented
Imports
java.lang.annotation.Documented, .Retention, .Target

Method Summary

Modifier and TypeMethod and Description
public boolean

Returns:

the value (default false)
alwaysRun
()

For before methods (beforeSuite, beforeTest, beforeTestClass and beforeTestMethod, but not beforeGroups): if set to true, this configuration method will be run regardless of what groups it belongs to.

public String[]

Returns:

the value
dependsOnGroups
()

The list of groups this method depends on.

public String[]

Returns:

the value
dependsOnMethods
()

The list of methods this method depends on.

public String

Returns:

the value (default empty)
description
()

The description for this method.

public boolean

Returns:

the value (default true)
enabled
()

Whether methods on this class/method are enabled.

public String[]

Returns:

the value
groups
()

The list of groups this class/method belongs to.

public boolean

Returns:

the value (default true)
inheritGroups
()

If true, this @Configuration method will belong to groups specified in the @Test annotation on the class (if any).

public long

Returns:

the value (default 0)
timeOut
()

The maximum number of milliseconds this method should take.

Inherited from java.lang.annotation.Annotation:
annotationTypeequalshashCodetoString

Method Detail

alwaysRunback to summary
public boolean alwaysRun()

For before methods (beforeSuite, beforeTest, beforeTestClass and beforeTestMethod, but not beforeGroups): if set to true, this configuration method will be run regardless of what groups it belongs to.
For after methods (afterSuite, afterClass, ...): if set to true, this configuration method will be run even if one or more methods invoked previously failed or was skipped.

Returns:boolean

the value (default false)

dependsOnGroupsback to summary
public String[] dependsOnGroups()

The list of groups this method depends on. Every method member of one of these groups is guaranteed to have been invoked before this method. Furthermore, if any of these methods was not a SUCCESS, this test method will not be run and will be flagged as a SKIP.

Returns:String[]

the value

dependsOnMethodsback to summary
public String[] dependsOnMethods()

The list of methods this method depends on. There is no guarantee of the order in which the methods depended upon will be run, but you are guaranteed that all these methods will be run before the test method that contains this annotation is run. Furthermore, if any of these methods was not a SUCCESS, this test method will not be run and will be flagged as a SKIP.

If some of these methods have been overloaded, all the overloaded versions will be run.

Returns:String[]

the value

descriptionback to summary
public String description()

The description for this method. The string used will appear in the HTML report and also on standard output if verbose > 2.

Returns:String

the value (default empty)

enabledback to summary
public boolean enabled()

Whether methods on this class/method are enabled.

Returns:boolean

the value (default true)

groupsback to summary
public String[] groups()

The list of groups this class/method belongs to.

Returns:String[]

the value

inheritGroupsback to summary
public boolean inheritGroups()

If true, this @Configuration method will belong to groups specified in the @Test annotation on the class (if any).

Returns:boolean

the value (default true)

timeOutback to summary
public long timeOut()

The maximum number of milliseconds this method should take. If it hasn't returned after this time, this method will fail and it will cause test methods depending on it to be skipped.

Returns:long

the value (default 0)