Class UIAutomationTest<THost extends UIAutomationHost>
java.lang.Object
de.renebergelt.juitest.host.testscripts.UIAutomationTest<THost>
- Type Parameters:
THost- Type of the UIAutomationHost which runs this test
- Direct Known Subclasses:
SwingAutomationTest
Interface for automation tests
-
Field Summary
FieldsModifier and TypeFieldDescriptionprotected booleanIndicates if the cancellation of this test has been requestedprotected THostThe Host of this UIAutomationTestprotected AtomicReference<de.renebergelt.juitest.core.AutoResetEvent>The current wait eventstatic de.renebergelt.juitest.core.TimeoutThe default timeout (1 minute) -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionvoidExecuted after a test has runvoidExecuted before every testsvoidcancel()Cancel the execution of this scriptvoidSend teh given log message to the registered TestExucitionListener (if any)voidPause test execution and signal to the test monitor that the current script has been paused.voidresume()Continue execution if this test has been pausedvoidscriptAssert(Supplier<Boolean> condition)Throws an AutomationException when the condition is not satisfied and thus aborts script executionvoidscriptAssert(Supplier<Boolean> condition, String failureMessage)Throws an AutomationException with the given failureMessage when the condition is not satisfied and thus aborts script executionvoidsetContext(THost context)Sets the automation contextvoidsetExecutionListener(de.renebergelt.juitest.core.services.TestExecutionListener executionListener)Set the execution listener
-
Field Details
-
DEFAULT_TIMEOUT
public static final de.renebergelt.juitest.core.Timeout DEFAULT_TIMEOUTThe default timeout (1 minute) -
cancellationRequested
protected boolean cancellationRequestedIndicates if the cancellation of this test has been requested -
context
The Host of this UIAutomationTest -
currentEvent
The current wait event
-
-
Constructor Details
-
UIAutomationTest
public UIAutomationTest()
-
-
Method Details
-
setContext
Sets the automation context- Parameters:
context- The automation context
-
setExecutionListener
public void setExecutionListener(de.renebergelt.juitest.core.services.TestExecutionListener executionListener)Set the execution listener- Parameters:
executionListener- The execution listener instance to inform of the test execution state
-
resume
public void resume()Continue execution if this test has been paused -
pause
Pause test execution and signal to the test monitor that the current script has been paused. test execution will continue once the test monitor sends the continue execution command Test will only be paused, if a TestExecutionListener has been set- Parameters:
message- A message to display to the user
-
cancel
public void cancel()Cancel the execution of this script -
log
Send teh given log message to the registered TestExucitionListener (if any)- Parameters:
message- The log message
-
scriptAssert
public void scriptAssert(Supplier<Boolean> condition) throws de.renebergelt.juitest.core.exceptions.AutomationExceptionThrows an AutomationException when the condition is not satisfied and thus aborts script execution- Parameters:
condition- The condition to check- Throws:
de.renebergelt.juitest.core.exceptions.AutomationException- Thrown, if the condition supplier returns false
-
scriptAssert
public void scriptAssert(Supplier<Boolean> condition, String failureMessage) throws de.renebergelt.juitest.core.exceptions.AutomationExceptionThrows an AutomationException with the given failureMessage when the condition is not satisfied and thus aborts script execution- Parameters:
condition- The condition to checkfailureMessage- The message to use for the AutomationException if the condition check failed- Throws:
de.renebergelt.juitest.core.exceptions.AutomationException- Thrown, if the condition supplier returns false
-
beforeTest
public void beforeTest()Executed before every tests -
afterTest
public void afterTest()Executed after a test has run
-