@TestDependency

Annotation @TestDependency is used to declare test case dependency on other test classes. One or more test cases can be declared as a dependency. If dependency is declared and any of the following requirements are not met then test case execution will be skipped.

Requirements:

  • Declared dependency test case must be within a scan scope.
  • Declared dependency test case execution must be completed before declaring test case execution.
  • Declared dependency test case outcome must be PASS.

Warning will be printed when test case execution is skipped due to dependency requirements not met.

1
2
3
4
=========================================================================
================ DEPENDENCY REQUIREMENTS ARE NOT MET ====================
===================== TEST CASE WILL BE SKIPPED =========================
=========================================================================
Attribute Description Mandatory/Optional Default Value
dependency() Array of Test Cases Mandatory N/A

Annotation use case(s)

1
@TestDependency(dependency = { TestCase_1.class, TestCase_2.class })

Example test case

1
2
3
4
5
@TestDependency(dependency = { TestCase_1.class, TestCase_2.class })
@TestCase(skip = false, sequence = 1, bugref = "JIRA-1234, JIRA-234", dropRemainingTestsUponFailure = true)
public class TestCase_1 implements TestExecutable {

}