| |
void addDaemonLog(byte[] data, String name=None, String comment=None, String externalizename=None) |
| Parameters |
data |
The byte array retrieved via DaemonRunContext.getRunLog().
|
name |
An optional name for the daemon log node. If unspecified the ID of the Daemon is
used.
|
comment |
An optional comment for the daemon log node.
|
externalizename |
An optional name to externalize the daemon log and save it as a partial log of a
split run log.
|
| |
void addResetListener(ResetListener listener) |
| Parameters |
listener |
The Listener that should be added. The listener should implement the interface
de.qfs.apps.qftest.extensions.qftest.ResetListener.
|
| |
void addTestRunListener(TestRunListener listener) |
| Parameters |
listener |
The listener to register.
|
| |
String callProcedure(String name, Map parameters=None) |
| Parameters |
name |
The fully qualified name of the Procedure.
|
parameters |
The parameters for the Procedure. This should be a
dictionary. Its keys and values can be arbitrary values. They
are converted to strings for the call.
|
| Returns | The value returned from the Procedure through an optional
Return node. |
| |
int callTest(String name, Map parameters=None) |
| Parameters |
name |
The fully qualified name of the Test case or Test set.
|
parameters |
The parameters for the Test case or Test set. This should be a
dictionary. Its keys and values can be arbitrary values. They
are converted to strings for the call.
|
| Returns | The final state of the execution. Either rc.OK,
rc.WARNING, rc.ERROR, rc.EXCEPTION, rc.SKIPPED or rc.NOT_IMPLEMENTED. |
| |
int callTestAsProcedure(String name, Map parameters=None) |
| Parameters |
name |
The fully qualified name of the Test case or Test set.
|
parameters |
The parameters for the Test case or Test set. This should be a
dictionary. Its keys and values can be arbitrary values. They
are converted to strings for the call.
|
| Returns | The final state of the execution. Either rc.OK,
rc.WARNING, rc.ERROR, rc.EXCEPTION, rc.SKIPPED or rc.NOT_IMPLEMENTED. |
| |
Boolean check(boolean condition, String message, int level=rc.ERROR, boolean report=true, boolean nowrap=false) |
| Parameters |
condition |
The condition to evaluate.
|
message |
The message to log. It will be preceded by "Check OK: " or
"Check failed: " depending on the result. For the old-style XML or HTML
report the message will be treated like a Check node if it
starts with an '!' character.
|
level |
The error level in case of failure. The following constants are
defined in the run context:
-
rc.OK
-
rc.WARNING
-
rc.ERROR
-
rc.EXCEPTION
If the level is rc.EXCEPTION, a
UserException will be thrown if the check fails.
|
report |
If true, the check will appear in the report. Only applicable if level <=
rc.WARNING.
|
nowrap |
If true, lines of the message will not be wrapped in the report. Use for
potentially long messages.
|
| Returns | The result of the check. |
| |
Boolean checkEqual(Object actual, Object expected, String message, int level=rc.ERROR, boolean report=true, boolean nowrap=false) |
| Parameters |
actual |
The actual value.
|
expected |
The expected value.
|
message |
The message to log. It will be preceded by "Check OK: " or
"Check failed: " depending on the result. In case of failure, the expected and
actual values will also be logged.
|
level |
The error level in case of failure. The following constants are
defined in the run context:
-
rc.OK
-
rc.WARNING
-
rc.ERROR
-
rc.EXCEPTION
If the level is rc.EXCEPTION, a
UserException will be thrown if the check fails.
|
report |
If true, the check will appear in the report. Only applicable if level <=
rc.WARNING.
|
nowrap |
If true, lines of the message will not be wrapped in the report. Use for
potentially long messages.
|
| Returns | The result of the check. |
| |
Boolean checkImage(ImageRep actual, ImageRep expected, String message, int level=rc.ERROR, boolean report=true, boolean nowrap=false) |
| Parameters |
actual |
The actual value ImageRep object.
|
expected |
The expected ImageRep object.
|
message |
The message to log. It will be preceded by "Check OK: " or
"Check failed: " depending on the result. In case of failure, the expected and
actual values will also be logged.
For the old-style XML or HTML
report the message will be treated like a Check node if it
starts with an '!' character.
|
level |
The error level in case of failure. The following constants are
defined in the run context:
-
rc.OK
-
rc.WARNING
-
rc.ERROR
-
rc.EXCEPTION
If the level is rc.EXCEPTION, a
UserException will be thrown if the check fails.
|
report |
If true, the check will appear in the report. Only applicable if level <=
rc.WARNING.
|
nowrap |
If true, lines of the message will not be wrapped in the report. Use for
potentially long messages.
|
| Returns | The result of the check. |
| |
Object[] checkImageAdvanced(ImageRep actual, ImageRep expected, String message, String algorithm, int level=rc.ERROR, boolean report=true, boolean nowrap=false) |
| Parameters |
actual |
The actual value ImageRep object.
|
expected |
The expected ImageRep object.
|
message |
The message to log. It will be preceded by "Check OK: " or
"Check failed: " depending on the result. In case of failure, the expected and
actual values will also be logged.
For the old-style XML or HTML
report the message will be treated like a Check node if it
starts with an '!' character.
|
algorithm |
The algorithm to use for the comparison as described in "Details about the algorithm for image comparison".
|
level |
The error level in case of failure. The following constants are
defined in the run context:
-
rc.OK
-
rc.WARNING
-
rc.ERROR
-
rc.EXCEPTION
If the level is rc.EXCEPTION, a
UserException will be thrown if the check fails.
|
report |
If true, the check will appear in the report. Only applicable if level <=
rc.WARNING.
|
nowrap |
If true, lines of the message will not be wrapped in the report. Use for
potentially long messages.
|
| Returns | An array with following content:
The result of the check as Boolean.
The result of the check as probability.
The transformed image of the expected image as ImageRep, depending on the algorithm.
The transformed image of the actual image as ImageRep, depending on the algorithm.
Further information where appropriate.
|
| |
void clearGlobals() |
| |
void clearProperties(String group) |
| Parameters |
group | The group name of the properties or resources. |
| |
void clearTestRunListeners() |
| |
String expand(String text) |
| Parameters |
text |
The string to expand.
|
| Returns | The expanded string. |
| |
Object fromServer(String name) |
| Parameters |
name |
The name of the variable.
|
| Returns | The value of the variable. |
| |
Object fromSUT(String client, String name) |
| Parameters |
client |
The name of the SUT client.
|
name |
The name of the variable.
|
| Returns | The value of the variable. |
| |
Boolean getBool(String varname) |
| Parameters |
varname | The name of the variable. |
| Returns | The value of the variable. |
| |
Boolean getBool(String group, String name) |
| Parameters |
group | The name of the group. |
name | The name of the resource or property. |
| Returns | The value of the resource or property. |
| |
Exception getCaughtException() |
| Returns | The caught exception. |
| |
Component getComponent(String id, int timeout=0, boolean hidden=false) |
| Parameters |
id |
The QF-Test ID of the Component node that
represents the component in the test suite.
|
timeout |
This parameter is ignored and always 0 for SUT scripts that are running on the event
dispatch thread of the respective GUI engine because it is not possible to free this
thread in a safe way in order to wait for the respective component.
|
hidden |
If true, find invisible components as well. Useful for
menu items.
|
| Returns |
The actual Java component. For sub-items, a pair of
the form (component, index) is returned, where the
type of index depends on the type of the item. For
tree nodes it is a javax.swing.tree.TreePath
object, for tablecells a pair of the form (row,
column) and an integer for all other kinds of items.
Note Column indexes returned are always given
in table coordinates, not in model coordinates.
|
| |
List getConnectedClients() |
| Returns |
A list with the names of the currently connected SUT clients, an empty list in case
there are none.
|
| |
Map getGlobalObjects() |
| Returns | The global variables of the current context. |
| |
Properties getGlobals() |
| Returns | The global variables of the current context with their values as Strings. |
| |
Map getGroupObjects(String group) |
| Parameters |
group | The group name of the properties or resources. |
| Returns |
The variables bound for the given group or null if no such group exists.
|
| |
Integer getInt(String varname) |
| Parameters |
varname | The name of the variable. |
| Returns | The value of the variable. |
| |
Integer getInt(String group, String name) |
| Parameters |
group | The name of the group. |
name | The name of the resource or property. |
| Returns | The value of the resource or property. |
| |
Object getJson(String varname, boolean expand=true) |
| Parameters |
varname | The name of the variable. |
expand | Whether to expand the value of the variable recursively.
For more information please refer to The expand parameter. |
| Returns | The object by deserializing the variable value. |
| |
Object getJson(String group, String name, boolean expand=true) |
| Parameters |
varname | The name of the variable. |
expand | Whether to expand the value of the variable recursively.
For more information please refer to The expand parameter. |
| Returns | The object by deserializing the variable value. |
| |
Object getLastComponent() |
| Returns | The last component addressed by QF-Test. |
| |
Exception getLastException() |
| Returns | The most recent exception that was thrown. |
| |
Object getLastItem() |
| Returns | The last item addressed by QF-Test. |
| |
Map getLocalObjects(nonEmpty=false) |
| Parameters |
nonEmpty |
True to get the first non-empty set of bindings, false to get the innermost bindings
even when empty.
|
| Returns | The innermost local variable bindings of the current context. |
| |
Properties getLocals(nonEmpty=false) |
| Parameters |
nonEmpty |
True to get the first non-empty set of bindings, false to get the innermost bindings
even when empty.
|
| Returns | The innermost local variable bindings of the current context as Strings. |
| |
Number getNum(String varname) |
| Parameters |
varname | The name of the variable. |
| Returns | The value of the variable. |
| |
Number getNum(String group, String name) |
| Parameters |
group | The name of the group. |
name | The name of the resource or property. |
| Returns | The value of the resource or property. |
| |
Object getObj(String varname, boolean expand=true) |
| Parameters |
varname | The name of the variable. |
expand | Whether to expand the value of the variable recursively.
For more information please refer to The expand parameter. |
| Returns | The object value of the variable. |
| |
Object getObj(String group, String name, boolean expand=true) |
| Parameters |
group | The name of the group. |
name | The name of the resource or property. |
expand | Whether to expand the value of the variable recursively.
For more information please refer to The expand parameter. |
| Returns | The object value of the resource or property. |
| |
Object getOption(String name) |
| Parameters |
name | The name of the option, a constant from the
Options class which is automatically imported in Jython and Groovy
scripts. The names of the options that can be read in this way are documented in
"Options".
|
| Returns |
The current value of the option.
|
| |
Object getOverrideElement(String id) |
| Parameters |
id | The QF-Test ID or SmartID previously used to override the GUI element. |
| Returns | The GUI element previously registered for the given ID. None/null if no GUI element was
registered or the element is no longer valid. |
| |
Pattern getPattern(String varname, boolean expand=true) |
| Parameters |
varname | The name of the variable. |
expand | Whether to expand the value of the variable recursively.
For more information please refer to The expand parameter. |
| Returns | A Java pattern object with the value of the variable
as regular expression. |
| |
Pattern getPattern(String group, String name, boolean expand=true) |
| Parameters |
group | The name of the group. |
name | The name of the resource or property. |
expand | Whether to expand the value of the variable recursively.
For more information please refer to The expand parameter. |
| Returns | A Java Pattern-Object with the value of the resource or property
as regular expression. |
| |
Properties getProperties(String group) |
| Parameters |
group | The group name of the properties or resources. |
| Returns |
The variables bound for the given group together with their values as Strings or null if no such group exists.
|
| |
String getPropertyGroupNames() |
| Returns |
A string listing all the names of all user defined property groups. Names
are sorted alphabetically and separated by newlines.
|
| |
String getStr(String varname, boolean expand=true) |
| Parameters |
varname | The name of the variable. |
expand | Whether to expand the value of the variable recursively.
For more information please refer to The expand parameter. |
| Returns | The value of the variable as String. |
| |
String getStr(String group, String name, boolean expand=true) |
| Parameters |
group | The name of the group. |
name | The name of the resource or property. |
expand | Whether to expand the value of the variable recursively.
For more information please refer to The expand parameter. |
| Returns | The value of the resource or property as String. |
| |
VariableData getWrapped(String name, boolean expand=true) |
| Parameters |
name | The name of the resource or property. |
expand | Whether to expand the value of the variable recursively.
For more information please refer to The expand parameter. |
| Returns | Wrapper object of the resource or property as VariableData. |
| |
VariableData getWrapped(String group, String name, boolean expand=true) |
| Parameters |
group | The name of the group. |
name | The name of the resource or property. |
expand | Whether to expand the value of the variable recursively.
For more information please refer to The expand parameter. |
| Returns | Wrapper object of the resource or property as VariableData. |
| |
String id(String id) |
| Parameters |
id | The QF-Test component ID. |
| Returns | The QF-Test component ID. |
| |
boolean isOptionSet(String name) |
| Parameters |
name | The name of the option, a constant from the
Options class which is automatically imported in Jython and Groovy
scripts. The names of the options that can be read in this way are documented in
"Options".
|
| Returns |
True if the option has been set, false otherwise.
|
| |
boolean isResetListenerRegistered(ResetListener listener) |
| Parameters |
listener |
The ResetListener to check, if it is registered.
|
| Returns |
True if the ResetListener has been registered, otherwise False.
|
| |
void logDiagnostics(String client) |
| Parameters |
client | The name of the SUT client from which
to get the information. |
| |
void logError(String msg, boolean nowrap=false) |
| Parameters |
msg | The message to log. |
nowrap |
If true, lines of the message will not be wrapped in the report. Use for potentially
long messages.
|
| |
void logImage(ImageRep image, String title=None, boolean dontcompactify=false, boolean report=false) |
| Parameters |
image | The ImageRep object to log. |
title |
An optional title for the image.
|
dontcompactify |
If true, the message will never be removed from a compact run log.
|
report |
True to log the image in the report (implies dontcompactify).
|
| |
void logMessage(String msg, boolean dontcompactify=false, boolean report=false, boolean nowrap=false) |
| Parameters |
msg | The message to log. |
dontcompactify | If true, the message will never be removed from a
compact run log. |
report | If true, the message will appear in the report. |
nowrap |
If true, lines of the message will not be wrapped in the report. Use for potentially
long messages.
|
| |
void logWarning(String msg, boolean report=true, boolean nowrap=false) |
| Parameters |
msg | The message to log. |
report | If true (the default), the warning will be listed in the
report. Set this to false to exclude this specific warning from the report. |
nowrap |
If true, lines of the message will not be wrapped in the report. Use for potentially
long messages.
|
| |
void overrideElement(String id, Component com) |
| Parameters |
id | The QF-Test ID or SmartID of the GUI element to override. |
com |
The GUI element to return as the resolved target. None/null to revert to the default
mechanism.
|
| |
void popOption(String name) |
| Parameters |
name | The name of the option to unset, a constant from the
Options class which is automatically imported in Jython and Groovy
scripts. The constants for options that can be set in this way are documented in
"Options".
|
| |
void pushOption(String name, object value) |
| Parameters |
name | The name of the option, a constant from the
Options class which is automatically imported in Jython and Groovy
scripts. The names of the options that can be set in this way are documented in
"Options".
|
value |
The value to set, typically a boolean, a number or a constant from the
Options class for options edited via a drop-down list. For hotkey
options like the hotkey for pausing test run ("Don't Panic" key) this value should be a string like "F12" or
"Shift-F6". Supported modifiers are "Shift", "Control" or "Ctrl", "Alt" and "Meta"
and combinations thereof. Key specifiers are prepended with "VK_" and then looked up
in the class java.awt.event.KeyEvent. Case is irrelevant for both, so
"shift-alt-enter" will work as well.
|
| |
void removeResetListener(ResetListener listener) |
| Parameters |
listener |
The ResetListener to remove.
|
| |
void removeTestRunListener(TestRunListener listener) |
| Parameters |
listener |
The listener to remove.
|
| |
void resetDependencies(String namespace=None) |
| Parameters |
namespace |
An optional namespace to reset the dependencies for.
|
| |
void resolveDependency(String dependency, String namespace=None, Map parameters=None) |
| Parameters |
dependency |
The fully qualified name of the Dependency to resolve.
|
namespace |
An optional namespace to resolve the Dependency in.
|
parameters |
The parameters for the Dependency. This should be a
dictionary. Its keys and values can be arbitrary values. They
are converted to strings for the call.
|
| |
void returnValue(object value) |
| Parameters |
value |
An arbitrary value for the variable.
NoteWhen returning a value from a SUT script, the
object will be serialized. If this representation needs more than
25 MB of RAM, the String value of the object will be transmitted instead.
|
| |
void rollbackAllDependencies() |
| |
void rollbackDependencies(String namespace=None) |
| Parameters |
namespace |
An optional namespace to unroll the dependencies in.
|
| |
void setGlobal(String name, object value) |
| Parameters |
name | The name of the variable. |
value |
An arbitrary value for the variable. A
value of None unsets the variable.
NoteWhen accessing the variable from a SUT script, the
object will be serialized. If this representation needs more than
25 MB of RAM, the String value of the object will be transmitted instead.
|
| |
void setGlobalJson(String name, Object value) |
| Parameters |
name | The name of the variable. |
value |
An arbitrary value for the variable. It is automatically
stringified into a JSON string. A value of None unsets the variable.
|
| |
void setGroupObject(String group, String name, Object value) |
| Parameters |
group |
The name of the group. A new group is created automatically if necessary.
|
name | The name of the object, e.g the resource or property. |
value |
An arbitrary value for the object (also named "property"). A
value of None unsets the object.
Note This method also works for the special groups 'env' and 'system'.
This way, environment variables or system properties can be defined.
Values in other special groups (like 'qftest') can usually not be overridden.
In that case, a ReadOnlyPropertyException is thrown.
Note Alias of setProperty.
|
| |
void setLocal(String name, Object value) |
| Parameters |
name | The name of the variable. |
value |
An arbitrary value for the variable. A
value of None unsets the variable.
NoteWhen accessing the variable from a SUT script, the
object will be serialized. If this representation needs more than
25 MB of RAM, the String value of the object will be transmitted instead.
|
| |
void setLocalJson(String name, Object value) |
| Parameters |
name | The name of the variable. |
value |
An arbitrary value for the variable. It is automatically
stringified into a JSON string. A value of None unsets the variable.
|
| |
void setOption(String name, object value) |
| Parameters |
name | The name of the option, a constant from the
Options class which is automatically imported in Jython and Groovy
scripts. The names of the options that can be set in this way are documented in
"Options".
|
value |
The value to set, typically a boolean, a number or a constant from the
Options class for options edited via a drop-down list. For hotkey
options like the hotkey for pausing test run ("Don't Panic" key) this value should be a string like "F12" or
"Shift-F6". Supported modifiers are "Shift", "Control" or "Ctrl", "Alt" and "Meta"
and combinations thereof. Key specifiers are prepended with "VK_" and then looked up
in the class java.awt.event.KeyEvent. Case is irrelevant for both, so
"shift-alt-enter" will work as well.
|
| |
void setProperty(String group, String name, object value) |
| Parameters |
group |
The name of the group. A new group is created automatically if necessary.
|
name | The name of the resource or property. |
value |
An arbitrary value for the property. A
value of None unsets the property.
Note This method also works for the special groups 'system' and
'env' and can be used as a means to set environment variables and system properties.
Values in other special groups like 'qftest' mostly cannot be set or changed that way, trying
to do so triggers a ReadOnlyPropertyException.
|
| |
void skipTestCase() |
| |
void skipTestSet() |
| |
void stopTest() |
| |
void stopTestCase(boolean expectedFail=false) |
| Parameters |
expectedFail | If true, mark possible errors in this test case as
expected failures. |
| |
void stopTestSet() |
| |
void syncThreads(String name, int timeout, int count=-1, boolean throw=true, int remote=0) |
| Parameters |
name | An identifier for the synchronization point. |
timeout | The maximum time to wait in milliseconds. |
count |
The number of threads to wait for. Default value -1 means all threads in the current
QF-Test instance.
|
throw |
Whether to throw an exception (default) or just log an error if the timeout is
exceeded without all threads reaching the synchronization point.
|
remote |
The number of QF-Test instances - potentially running on different machines - to
synchronize. Default 0 means don't do remote synchronization.
|
| |
void toServer(...) |
| |
void toSUT(String client, ...) |
| Parameters |
client |
The name of the SUT client.
|
| |
void unsetOption(String name) |
| Parameters |
name | The name of the option to unset, a constant from the
Options class which is automatically imported in Jython and Groovy
scripts. The constants for options that can be set in this way are documented in
"Options".
|
| |
RunContext withDefault(Object defaultResult) |
| Parameters |
defaultResult | The object which will be returned if a variable has no value. |
| Returns |
A new run context (rc) objekt, which has the given default value set for variable access.
|
| |