Package org.citrusframework
Interface TestCase
- All Superinterfaces:
Described,Named,TestAction,TestActionContainer
Test case executing a list of
TestAction in sequence.- Since:
- 2006
- Author:
- Christoph Deppisch
-
Method Summary
Modifier and TypeMethodDescriptiondefault voidaddFinalAction(TestAction action) Adds action to finally action chain.voidaddFinalAction(TestActionBuilder<?> builder) Adds action to finally action chain.default voidafterTest(TestContext context) Sequence of test actions after test case.default voidbeforeTest(TestContext context) Sequence of test actions before the test case.voidexecuteAction(TestAction action, TestContext context) Executes a single test action with given test context.voidfinish(TestContext context) Method that will be executed in any case of test case result (success, error) Usually used for clean up tasks.Provides access to the raw test action builders used to construct the list of actions in this test case.Get the test case meta information.getName()Name of test action injected as Spring bean nameGet the package nameClass<?>Gets the value of the testClass property.Retrieve test result.Gets the variables for this test case.default booleanMarks that this test case runs its actions one by one growing over time.voidsetIncremental(boolean incremental) Sets the test runner flag.voidsetPackageName(String packageName) Set the package namevoidsetTestClass(Class<?> type) Set the test class type.voidsetTestResult(TestResult testResult) Sets the test result from outside.voidstart(TestContext context) Starts the test case.Methods inherited from interface org.citrusframework.common.Described
getDescription, setDescriptionMethods inherited from interface org.citrusframework.TestAction
execute, getActor, isDisabledMethods inherited from interface org.citrusframework.container.TestActionContainer
addTestAction, addTestActions, getActionCount, getActionIndex, getActions, getActiveAction, getExecutedActions, getTestAction, setActions, setActiveAction, setExecutedAction
-
Method Details
-
start
Starts the test case. -
beforeTest
Sequence of test actions before the test case. -
afterTest
Sequence of test actions after test case. This operation does not raise andy errors - exceptions will only be logged as warning. This is because we do not want to overwrite errors that may have occurred before in test execution. -
executeAction
Executes a single test action with given test context.- Parameters:
action-context-
-
finish
Method that will be executed in any case of test case result (success, error) Usually used for clean up tasks. -
getMetaInfo
TestCaseMetaInfo getMetaInfo()Get the test case meta information.- Returns:
- the metaInfo
-
getTestClass
Class<?> getTestClass()Gets the value of the testClass property.- Returns:
- the testClass
-
setTestClass
Set the test class type.- Parameters:
type-
-
getPackageName
String getPackageName()Get the package name- Returns:
- the packageName
-
setPackageName
Set the package name- Parameters:
packageName- the packageName to set
-
getName
String getName()Description copied from interface:TestActionName of test action injected as Spring bean name- Specified by:
getNamein interfaceTestAction- Returns:
- name as String
-
setTestResult
Sets the test result from outside.- Parameters:
testResult-
-
getTestResult
TestResult getTestResult()Retrieve test result.- Returns:
-
isIncremental
default boolean isIncremental()Marks that this test case runs its actions one by one growing over time. This is usually the case when using the Java DSL that adds test actions as the Java method is processed. XML test cases ususally build and load all actions beforehand and run all actions in one step.- Returns:
-
setIncremental
void setIncremental(boolean incremental) Sets the test runner flag.- Parameters:
incremental-
-
getVariableDefinitions
Gets the variables for this test case.- Returns:
-
addFinalAction
Adds action to finally action chain.- Parameters:
action-
-
addFinalAction
Adds action to finally action chain.- Parameters:
builder-
-
getActionBuilders
List<TestActionBuilder<?>> getActionBuilders()Provides access to the raw test action builders used to construct the list of actions in this test case.- Returns:
-