Tester¶
Tester object. Use it to perform assertions during test playback and output relevant information to the report. You do not need to record or learn this object, it is always automatically available in any test.
Property Summary¶
Property | Description |
---|---|
Fail | Test status, test failed. |
Info | Test status, test is neither passed nor failed. |
Pass | Test status, test passed. |
Unresolved | Test status, test status is unresolved, test terminated unexpectedly. |
Action Summary¶
Action | Description |
---|---|
AddImageToReport | Adds image to the report. |
Assert | Checks if condition is 'true' and saves corresponding Report entry. |
AssertContains | Checks if str contains substr somewhere and saves corresponding Report entry. |
AssertEndsWith | Checks that str has substr in the end and saves corresponding Report entry. |
AssertEqual | Checks if obj1 equals to obj2 and saves corresponding Report entry. |
AssertFalse | Checks if val is false and saves corresponding Report entry. |
AssertGreater | Checks if n1 greater than n2 and saves corresponding Report entry. |
AssertGreaterOrEqual | Checks if n1 greater or equal than n2 and saves corresponding Report entry. |
AssertImage | Checks if 'img1' equals to image stored at 'path' and saves corresponding Report entry. |
AssertLess | Checks if n1 is less than n2 and saves corresponding Report entry. |
AssertLessOrEqual | Checks if n1 differs from n2 and saves corresponding Report entry. |
AssertNotContains | Checks that str does not contain substr anywhere and saves corresponding Report entry. |
AssertNotEqual | Checks if obj1 differs from obj2 and saves corresponding Report entry. |
AssertNotNull | Checks if val is NotNull and saves corresponding Report entry. |
AssertNotSet | Checks if val is not set (i.e. |
AssertNull | Checks if val is null and saves corresponding Report entry. |
AssertSet | Checks if val is set (i.e. |
AssertStartsWith | Checks if str begins with substr and saves corresponding Report entry. |
BeginTest | Marks beginning of a test with a given name. |
BlockTest | Stops test execution and exits with Blocked status. |
CaptureDesktopImage | Captures screenshot of the desktop and adds it to the report. |
CaptureObjectImage | Captures screenshot of an object and adds it to the report. |
CaptureWindowImage | Captures screenshot of an application window matched by title and class and adds it to the report. |
DumpCmdArgsJson | Dump node.json with all arguments. |
EndTest | Marks end of a currently executed test. |
ExpectFailure | Set Tester to expect a failed assertion with given message or data. |
ExpectFailureDone | If messageOrData is set, checks that given assertion failed at least once. |
FailTest | Stops test execution and sets it's status to failed. |
GetEntryTestName | Retrieves the name of the test that was run by the user. |
GetParam | Read parameter field passed into the Test function by field name. |
GetReportAttribute | Gets report attribute previously set by PushReportAttribute or SetReportAttribute. |
GetTestName | Returns name of the running test. |
GetTestStatus | Gets status of currently executed test. |
IgnoreStatus | In IgnoreStatus mode the assertion status is always treated as "Info". |
Message | Writes a message to the report. |
MessageBox | Shows message box to user. |
MessageBoxPrompt | Shows message box with question to the user and checks if user presses "Yes" or "No". |
PopReportAttribute | Resets an attribute to its previous value. |
PushReportAttribute | Maintains "stacked" attributes. |
ResetReportAttribute | Removes report attribute previously set by SetReportAttribute. |
SetReportAttribute | Set persistent attribute. |
SoftAssert | Is identical to Tester.Assert. |
SoftAssertAll | Fail test if there were any previous failures. |
SoftAssertContains | Checks if str contains substr somewhere and saves corresponding Report entry. |
SoftAssertEndsWith | Checks that str has substr in the end and saves corresponding Report entry. |
SoftAssertEqual | Checks if obj1 equals to obj2 and saves corresponding Report entry. |
SoftAssertFalse | Checks if val is false and saves corresponding Report entry. |
SoftAssertGreater | Checks if n1 greater than n2 and saves corresponding Report entry. |
SoftAssertGreaterOrEqual | Checks if n1 greater or equal than n2 and saves corresponding Report entry. |
SoftAssertImage | Checks if 'img1' equals to image stored at 'path' and saves corresponding Report entry. |
SoftAssertLess | Checks if n1 is less than n2 and saves corresponding Report entry. |
SoftAssertLessOrEqual | Checks if n1 differs from n2 and saves corresponding Report entry. |
SoftAssertNotContains | Checks that str does not contain substr anywhere and saves corresponding Report entry. |
SoftAssertNotEqual | Checks if obj1 differs from obj2 and saves corresponding Report entry. |
SoftAssertNotNull | Checks if val is NotNull and saves corresponding Report entry. |
SoftAssertNotSet | Checks if val is not set (i.e. |
SoftAssertNull | Checks if val is null and saves corresponding Report entry. |
SoftAssertSet | Checks if val is set (i.e. |
SoftAssertStartsWith | Checks if str begins with substr and saves corresponding Report entry. |
SuppressReport | In SuppressReport mode all assertions are ignored. |
Property Detail¶
Fail¶
Test status, test failed. Constant, equal to 0.
Type: number
Info¶
Test status, test is neither passed nor failed. Constant, equal to -2.
Type: number
Pass¶
Test status, test passed. Constant, equal to 1.
Type: number
Unresolved¶
Test status, test status is unresolved, test terminated unexpectedly. Constant, equal to -1.
Type: number
Action Detail¶
AddImageToReport¶
Adds image to the report.
Tester.AddImageToReport(path, caption)
Parameters:
Name | Type | Description |
---|---|---|
path | string | Path to an image |
caption | string | Caption for the entry added to the report |
Assert¶
Checks if condition is 'true' and saves corresponding Report entry. Assertion is an atomic piece of verification. Assertion may contain some additional data (links, images, comments) set via 'data' parameter.
Tester.Assert(message, condition, data, tags)
Parameters:
Name | Type | Description |
---|---|---|
message | string | Message to put in the report. |
condition | boolean | If 'true' - assertion is considered passed. |
data | SeSReportLink | SeSReportText | SeSReportImage | object[] | string | Additional information to put in the report. If 'string' is passed, then data is considered as additional comment attribute. Or 'array' may be passed. Each entry in the array should be one of: SeSReportLink, SeSReportImage, SeSReportText, SeSReportFile. Optional. |
tags | object | Hash of attributes to set for this particular log entry. Optional. |
AssertContains¶
Checks if str
contains substr
somewhere and saves corresponding Report entry.
Assertion is an atomic piece of verification. Assertion may contain some
additional data (links, images, comments) set via 'data' parameter.
Tester.AssertContains(message, str, substr, data, tags)
Parameters:
Name | Type | Description |
---|---|---|
message | string | Message to put in the report. |
str | string | String to search in. |
substr | string | Substring to find. |
data | SeSReportLink | SeSReportText | SeSReportImage | Object[] | Additional information to put in the report. If 'string' is passed, then data is considered as additional comment attribute. Or 'array' may be passed. Each entry in the array should be one of: SeSReportLink, SeSReportImage, SeSReportText, SeSReportFile. Optional. |
tags | object | Hash of attributes to set for this particular log entry. Optional. |
AssertEndsWith¶
Checks that str
has substr
in the end and saves corresponding Report entry.
Assertion is an atomic piece of verification. Assertion may contain some
additional data (links, images, comments) set via 'data' parameter.
Tester.AssertEndsWith(message, str, substr, data, tags)
Parameters:
Name | Type | Description |
---|---|---|
message | string | Message to put in the report. |
str | string | String to search in. |
substr | string | Substring to find. |
data | SeSReportLink | SeSReportText | SeSReportImage | Object[] | Additional information to put in the report. If 'string' is passed, then data is considered as additional comment attribute. Or 'array' may be passed. Each entry in the array should be one of: SeSReportLink, SeSReportImage, SeSReportText, SeSReportFile. Optional. |
tags | object | Hash of attributes to set for this particular log entry. Optional. |
AssertEqual¶
Checks if obj1 equals to obj2 and saves corresponding Report entry. Assertion is an atomic piece of verification. Assertion may contain some additional data (links, images, comments) set via 'data' parameter.
Tester.AssertEqual(message, obj1, obj2, data, tags)
Parameters:
Name | Type | Description |
---|---|---|
message | string | Message to put in the report. |
obj1 | object | First object to compare. |
obj2 | object | Second object to compare. |
data | SeSReportLink | SeSReportText | SeSReportImage | Object[] | Additional information to put in the report. If 'string' is passed, then data is considered as additional comment attribute. Or 'array' may be passed. Each entry in the array should be one of: SeSReportLink, SeSReportImage, SeSReportText, SeSReportFile. Optional. |
tags | object | Hash of attributes to set for this particular log entry. Optional. |
AssertFalse¶
Checks if val
is false
and saves corresponding Report entry.
Assertion is an atomic piece of verification. Assertion may contain some
additional data (links, images, comments) set via 'data' parameter.
Tester.AssertFalse(message, val, data, tags)
Parameters:
Name | Type | Description |
---|---|---|
message | string | Message to put in the report. |
val | object | Value to check. |
data | SeSReportLink | SeSReportText | SeSReportImage | Object[] | Additional information to put in the report. If 'string' is passed, then data is considered as additional comment attribute. Or 'array' may be passed. Each entry in the array should be one of: SeSReportLink, SeSReportImage, SeSReportText, SeSReportFile. Optional. |
tags | object | Hash of attributes to set for this particular log entry. Optional. |
AssertGreater¶
Checks if n1 greater than n2 and saves corresponding Report entry. Assertion is an atomic piece of verification. Assertion may contain some additional data (links, images, comments) set via 'data' parameter.
Tester.AssertGreater(message, n1, n2, data, tags)
Parameters:
Name | Type | Description |
---|---|---|
message | string | Message to put in the report. |
n1 | number | First value to compare. |
n2 | number | Second value to compare. |
data | SeSReportLink | SeSReportText | SeSReportImage | Object[] | Additional information to put in the report. If 'string' is passed, then data is considered as additional comment attribute. Or 'array' may be passed. Each entry in the array should be one of: SeSReportLink, SeSReportImage, SeSReportText, SeSReportFile. Optional. |
tags | object | Hash of attributes to set for this particular log entry. Optional. |
AssertGreaterOrEqual¶
Checks if n1 greater or equal than n2 and saves corresponding Report entry. Assertion is an atomic piece of verification. Assertion may contain some additional data (links, images, comments) set via 'data' parameter.
Tester.AssertGreaterOrEqual(message, n1, n2, data, tags)
Parameters:
Name | Type | Description |
---|---|---|
message | string | Message to put in the report. |
n1 | number | First value to compare. |
n2 | number | Second value to compare. |
data | SeSReportLink | SeSReportText | SeSReportImage | Object[] | Additional information to put in the report. If 'string' is passed, then data is considered as additional comment attribute. Or 'array' may be passed. Each entry in the array should be one of: SeSReportLink, SeSReportImage, SeSReportText, SeSReportFile. Optional. |
tags | object | Hash of attributes to set for this particular log entry. Optional. |
AssertImage¶
Checks if 'img1' equals to image stored at 'path' and saves corresponding Report entry. Assertion is an atomic piece of verification. Assertion may contain some additional data (links, images, comments) set via 'data' parameter.
Tester.AssertImage(message, img1, path, data, tags)
Parameters:
Name | Type | Description |
---|---|---|
message | string | Message to put in the report. |
img1 | object | ImageWrapper object (1st image to compare). |
path | string | Path to the second image to compare. |
data | SeSReportLink | SeSReportText | SeSReportImage | Object[] | Additional information to put in the report. If 'string' is passed, then data is considered as additional comment attribute. Or 'array' may be passed. Each entry in the array should be one of: SeSReportLink, SeSReportImage, SeSReportText, SeSReportFile. Optional. |
tags | object | Hash of attributes to set for this particular log entry. Optional. |
AssertLess¶
Checks if n1 is less than n2 and saves corresponding Report entry. Assertion is an atomic piece of verification. Assertion may contain some additional data (links, images, comments) set via 'data' parameter.
Tester.AssertLess(message, n1, n2, data, tags)
Parameters:
Name | Type | Description |
---|---|---|
message | string | Message to put in the report. |
n1 | number | First value to compare. |
n2 | number | Second value to compare. |
data | SeSReportLink | SeSReportText | SeSReportImage | Object[] | Additional information to put in the report. If 'string' is passed, then data is considered as additional comment attribute. Or 'array' may be passed. Each entry in the array should be one of: SeSReportLink, SeSReportImage, SeSReportText, SeSReportFile. Optional. |
tags | object | Hash of attributes to set for this particular log entry. Optional. |
AssertLessOrEqual¶
Checks if n1 differs from n2 and saves corresponding Report entry. Assertion is an atomic piece of verification. Assertion may contain some additional data (links, images, comments) set via 'data' parameter.
Tester.AssertLessOrEqual(message, n1, n2, data, tags)
Parameters:
Name | Type | Description |
---|---|---|
message | string | Message to put in the report. |
n1 | object | First value to compare. |
n2 | object | Second value to compare. |
data | SeSReportLink | SeSReportText | SeSReportImage | Object[] | Additional information to put in the report. If 'string' is passed, then data is considered as additional comment attribute. Or 'array' may be passed. Each entry in the array should be one of: SeSReportLink, SeSReportImage, SeSReportText, SeSReportFile. Optional. |
tags | object | Hash of attributes to set for this particular log entry. Optional. |
AssertNotContains¶
Checks that str
does not contain substr
anywhere and saves corresponding Report entry.
Assertion is an atomic piece of verification. Assertion may contain some
additional data (links, images, comments) set via 'data' parameter.
Tester.AssertNotContains(message, str, substr, data, tags)
Parameters:
Name | Type | Description |
---|---|---|
message | string | Message to put in the report. |
str | string | String to search in. |
substr | string | Substring to find. |
data | SeSReportLink | SeSReportText | SeSReportImage | Object[] | Additional information to put in the report. If 'string' is passed, then data is considered as additional comment attribute. Or 'array' may be passed. Each entry in the array should be one of: SeSReportLink, SeSReportImage, SeSReportText, SeSReportFile. Optional. |
tags | object | Hash of attributes to set for this particular log entry. Optional. |
AssertNotEqual¶
Checks if obj1 differs from obj2 and saves corresponding Report entry. Assertion is an atomic piece of verification. Assertion may contain some additional data (links, images, comments) set via 'data' parameter.
Tester.AssertNotEqual(message, obj1, obj2, data, tags)
Parameters:
Name | Type | Description |
---|---|---|
message | string | Message to put in the report. |
obj1 | object | First object to compare. |
obj2 | object | Second object to compare. |
data | SeSReportLink | SeSReportText | SeSReportImage | Object[] | Additional information to put in the report. If 'string' is passed, then data is considered as additional comment attribute. Or 'array' may be passed. Each entry in the array should be one of: SeSReportLink, SeSReportImage, SeSReportText, SeSReportFile. Optional. |
tags | object | Hash of attributes to set for this particular log entry. Optional. |
AssertNotNull¶
Checks if val
is NotNull
and saves corresponding Report entry.
Assertion is an atomic piece of verification. Assertion may contain some
additional data (links, images, comments) set via 'data' parameter.
Tester.AssertNotNull(message, val, data, tags)
Parameters:
Name | Type | Description |
---|---|---|
message | string | Message to put in the report. |
val | object | Value to check. |
data | SeSReportLink | SeSReportText | SeSReportImage | Object[] | Additional information to put in the report. If 'string' is passed, then data is considered as additional comment attribute. Or 'array' may be passed. Each entry in the array should be one of: SeSReportLink, SeSReportImage, SeSReportText, SeSReportFile. Optional. |
tags | object | Hash of attributes to set for this particular log entry. Optional. |
AssertNotSet¶
Checks if val
is not set (i.e. it is null, 0, false or "") and saves corresponding Report entry.
Assertion is an atomic piece of verification. Assertion may contain some
additional data (links, images, comments) set via 'data' parameter.
Tester.AssertNotSet(message, val, data, tags)
Parameters:
Name | Type | Description |
---|---|---|
message | string | Message to put in the report. |
val | object | Value to check. |
data | SeSReportLink | SeSReportText | SeSReportImage | Object[] | Additional information to put in the report. If 'string' is passed, then data is considered as additional comment attribute. Or 'array' may be passed. Each entry in the array should be one of: SeSReportLink, SeSReportImage, SeSReportText, SeSReportFile. Optional. |
tags | object | Hash of attributes to set for this particular log entry. Optional. |
AssertNull¶
Checks if val
is null
and saves corresponding Report entry.
Assertion is an atomic piece of verification. Assertion may contain some
additional data (links, images, comments) set via 'data' parameter.
Tester.AssertNull(message, val, data, tags)
Parameters:
Name | Type | Description |
---|---|---|
message | string | Message to put in the report. |
val | object | Value to check. |
data | SeSReportLink | SeSReportText | SeSReportImage | Object[] | Additional information to put in the report. If 'string' is passed, then data is considered as additional comment attribute. Or 'array' may be passed. Each entry in the array should be one of: SeSReportLink, SeSReportImage, SeSReportText, SeSReportFile. Optional. |
tags | object | Hash of attributes to set for this particular log entry. Optional. |
AssertSet¶
Checks if val
is set (i.e. not false, not 0, not null, not "") and saves corresponding Report entry.
Assertion is an atomic piece of verification. Assertion may contain some
additional data (links, images, comments) set via 'data' parameter.
Tester.AssertSet(message, val, data, tags)
Parameters:
Name | Type | Description |
---|---|---|
message | string | Message to put in the report. |
val | object | Value to check. |
data | SeSReportLink | SeSReportText | SeSReportImage | Object[] | Additional information to put in the report. If 'string' is passed, then data is considered as additional comment attribute. Or 'array' may be passed. Each entry in the array should be one of: SeSReportLink, SeSReportImage, SeSReportText, SeSReportFile. Optional. |
tags | object | Hash of attributes to set for this particular log entry. Optional. |
AssertStartsWith¶
Checks if str
begins with substr
and saves corresponding Report entry.
Assertion is an atomic piece of verification. Assertion may contain some
additional data (links, images, comments) set via 'data' parameter.
Tester.AssertStartsWith(message, str, substr, data, tags)
Parameters:
Name | Type | Description |
---|---|---|
message | string | Message to put in the report. |
str | string | String to search in. |
substr | string | Substring to find. |
data | SeSReportLink | SeSReportText | SeSReportImage | Object[] | Additional information to put in the report. If 'string' is passed, then data is considered as additional comment attribute. Or 'array' may be passed. Each entry in the array should be one of: SeSReportLink, SeSReportImage, SeSReportText, SeSReportFile. Optional. |
tags | object | Hash of attributes to set for this particular log entry. Optional. |
BeginTest¶
Marks beginning of a test with a given name.
Tester.BeginTest(name, path, optionalParams, data)
Parameters:
Name | Type | Description |
---|---|---|
name | string | Test name |
path | string | Path to the test, that is executed. This string will be shown as a comment. Optional. |
optionalParams | object | Params to pass into Test(...) function. Optional. |
data | array | Additional info to put into report (array of SeSReportText()) Optional. |
BlockTest¶
Stops test execution and exits with Blocked status.
Tester.BlockTest(message)
Parameters:
Name | Type | Description |
---|---|---|
message | string | Reason why the test is blocked. Optional, Default: "Test execution blocked". |
CaptureDesktopImage¶
Captures screenshot of the desktop and adds it to the report.
Tester.CaptureDesktopImage(caption)
Parameters:
Name | Type | Description |
---|---|---|
caption | string | Image title for the report. |
CaptureObjectImage¶
Captures screenshot of an object and adds it to the report.
Tester.CaptureObjectImage(caption, objId)
Parameters:
Name | Type | Description |
---|---|---|
caption | string | Image title for the report. |
objId | objectId | Id of an object or SeSObject instance. |
CaptureWindowImage¶
Captures screenshot of an application window matched by title and class and adds it to the report.
Tester.CaptureWindowImage(caption, windowTitle, windowClass, bringToFront)
Parameters:
Name | Type | Description |
---|---|---|
caption | string | Image title for the report. |
windowTitle | string | String or regular expression to match window title. |
windowClass | string | String or regular expression to match window class. Optional, Default: "regex:.*". |
bringToFront | boolean | Set to 'false' to not restore the window before making the image. Optional, Default: "true". |
DumpCmdArgsJson¶
Dump node.json with all arguments.
Tester.DumpCmdArgsJson(optNodeJsonPath, mkPackageJson)
Parameters:
Name | Type | Description |
---|---|---|
optNodeJsonPath | string | node.json path Optional. |
mkPackageJson | string | Generate package.json for the test Optional. |
EndTest¶
Marks end of a currently executed test. Calculates test results and performs finalization of test execution.
Tester.EndTest()
ExpectFailure¶
Set Tester to expect a failed assertion with given message or data. When such error happens, it is reported as an expected Passed assertion. Requires Rapise 8.0+.
When null is passed, all expectations are reset.
Tester.ExpectFailure(messageOrData)
Parameters:
Name | Type | Description |
---|---|---|
messageOrData | string | Text to match against assertion message & data. |
ExpectFailureDone¶
If messageOrData
is set, checks that given assertion failed at least once.
If messageOrData
is null or empty, checks that all expected failed assertions failed.
Requires Rapise 8.0+.
Tester.ExpectFailureDone(messageOrData)
Parameters:
Name | Type | Description |
---|---|---|
messageOrData | string | Text to match against assertion message & data. Optional, Default: "null". |
FailTest¶
Stops test execution and sets it's status to failed.
Tester.FailTest(message, internal)
Parameters:
Name | Type | Description |
---|---|---|
message | string | Failure description. Optional, Default: "Test stopped on error". |
internal | For internal use Optional, Default: "null". |
GetEntryTestName¶
Retrieves the name of the test that was run by the user. Usually the value is the same as Tester.GetTestName. But in cases where one test calls another test, Tester.GetEntryTestName will remain equal to to the original test case, and GetTestName will change depending on the current test case being executed.
Tester.GetEntryTestName()
GetParam¶
Read parameter field passed into the Test function by field name.
Tester.GetParam(paramName, defaultValue)
Parameters:
Name | Type | Description |
---|---|---|
paramName | string | Parameter name |
defaultValue | string | Default value |
GetReportAttribute¶
Gets report attribute previously set by PushReportAttribute or SetReportAttribute.
Tester.GetReportAttribute(name)
Parameters:
Name | Type | Description |
---|---|---|
name | string | Attribute name. |
GetTestName¶
Returns name of the running test.
Tester.GetTestName()
GetTestStatus¶
Gets status of currently executed test.
Tester.GetTestStatus()
Returns:
One of: Tester.Info - test is neither passed nor failed; 1 - Tester.Pass - test passed; 0 - Tester.Fail - test failed; -1 - Tester.Unresolved - test status is unresolved, test terminated unexpectedly.
IgnoreStatus¶
In IgnoreStatus mode the assertion status is always treated as "Info". Real status is written to "realStatus" attribute in this case and used just for information purposes (i.e. it does not affect final test status).
This function is used when the test case needs to set test status manually.
Tester.IgnoreStatus(true); Tester.Assert("Ignored Assertion", false); // This assertion is failed. But its status is ignored. Tester.IgnoreStatus(false); Tester.Assert("Test passed", true); // The overall test is passed because failed assertion is ignored.
Tester.IgnoreStatus(ignore)
Parameters:
Name | Type | Description |
---|---|---|
ignore | boolean | Set to 'true' to report all messages but ignore the status (Pass/Fail) |
Message¶
Writes a message to the report. Use for logging purposes. Message may contain some additional data (links, images, comments) set via 'data' parameter.
Tester.Message(message, data, tags)
Parameters:
Name | Type | Description |
---|---|---|
message | string | Text to write into the report. |
data | SeSReportLink | SeSReportText | SeSReportImage | Object[] | Additional information to put in the report. If 'string' is passed, then data is considered as additional comment attribute. Or 'array' may be passed. Each entry in the array should be one of: SeSReportLink, SeSReportImage, SeSReportText, SeSReportFile. Optional. |
tags | object | Hash of attributes to set for this particular log entry. Optional. |
MessageBox¶
Shows message box to user. Use it for verbose and manual testing.
Tester.MessageBox(message)
Parameters:
Name | Type | Description |
---|---|---|
message | string | Message to display. |
MessageBoxPrompt¶
Shows message box with question to the user and checks if user presses "Yes" or "No". "Yes" => "Pass" goes to the report with this message. "No" => "Fail" is reported.
Tester.MessageBoxPrompt(question)
Parameters:
Name | Type | Description |
---|---|---|
question | string | Question to display. |
PopReportAttribute¶
Resets an attribute to its previous value. See PushReportAttribute for more information.
Tester.PopReportAttribute(name)
Parameters:
Name | Type | Description |
---|---|---|
name | string | Attribute name to recall from stack. |
Returns:
string: Previous value. Null if no such stacked attribute found.
PushReportAttribute¶
Maintains "stacked" attributes. Useful for nesting.
Example:
Main test sets scenario=Main. Then it calls another scenario (scenario Login) and then continues its own test actions.
We want all assertions to be attributed with current scenario name.
function Main() { Tester.PushReportAttribute("scenario", "Main"); Login(); ... Tester.Assert("Main test passed", mainStatus); // Saved with scenario=Main } function Login() { Tester.PushReportAttribute("scenario", "Login"); ... // Do login logic Tester.Assert("Login Result", loginStatus); Tester.PopReportAttribute("scenario"); // Set scenario value back to caller }
Tester.PushReportAttribute(name, value)
Parameters:
Name | Type | Description |
---|---|---|
name | string | Attribute name to recall from stack. |
value | string | New attribute value. |
ResetReportAttribute¶
Removes report attribute previously set by SetReportAttribute.
Tester.ResetReportAttribute(name)
Parameters:
Name | Type | Description |
---|---|---|
name | string | Attribute name. |
SetReportAttribute¶
Set persistent attribute. It will be set for all subsequent report items (assertions, tests, requirements, and so on). It may be changed by calling the ResetReportAttribute function.
Tester.SetReportAttribute(name, value)
Parameters:
Name | Type | Description |
---|---|---|
name | string | Attribute name to set. |
value | string | New attribute value. |
SoftAssert¶
Is identical to Tester.Assert. But when an assertion fails, don't stop execution and just record the failure. Later you may call Tester.SoftAssertAll(..)
that will stop execution if at least one assertion failed.
Tester.SoftAssert(message, condition, data, tags)
Parameters:
Name | Type | Description |
---|---|---|
message | string | Message to put in the report. |
condition | boolean | If 'true' - assertion is considered passed. |
data | SeSReportLink | SeSReportText | SeSReportImage | object[] | string | Additional information to put in the report. If 'string' is passed, then data is considered as additional comment attribute. Or 'array' may be passed. Each entry in the array should be one of: SeSReportLink, SeSReportImage, SeSReportText, SeSReportFile. Optional. |
tags | object | Hash of attributes to set for this particular log entry. Optional. |
SoftAssertAll¶
Fail test if there were any previous failures. This method is designed to be used after one or many calls to Tester.SoftAssert(...)
.
Tester.SoftAssertAll(message)
Parameters:
Name | Type | Description |
---|---|---|
message | string | Message to put in the report. |
SoftAssertContains¶
Checks if str
contains substr
somewhere and saves corresponding Report entry.
Assertion is an atomic piece of verification. Assertion may contain some
additional data (links, images, comments) set via 'data' parameter.
Tester.SoftAssertContains(message, str, substr, data, tags)
Parameters:
Name | Type | Description |
---|---|---|
message | string | Message to put in the report. |
str | string | String to search in. |
substr | string | Substring to find. |
data | SeSReportLink | SeSReportText | SeSReportImage | Object[] | Additional information to put in the report. If 'string' is passed, then data is considered as additional comment attribute. Or 'array' may be passed. Each entry in the array should be one of: SeSReportLink, SeSReportImage, SeSReportText, SeSReportFile. Optional. |
tags | object | Hash of attributes to set for this particular log entry. Optional. |
SoftAssertEndsWith¶
Checks that str
has substr
in the end and saves corresponding Report entry.
Assertion is an atomic piece of verification. Assertion may contain some
additional data (links, images, comments) set via 'data' parameter.
Tester.SoftAssertEndsWith(message, str, substr, data, tags)
Parameters:
Name | Type | Description |
---|---|---|
message | string | Message to put in the report. |
str | string | String to search in. |
substr | string | Substring to find. |
data | SeSReportLink | SeSReportText | SeSReportImage | Object[] | Additional information to put in the report. If 'string' is passed, then data is considered as additional comment attribute. Or 'array' may be passed. Each entry in the array should be one of: SeSReportLink, SeSReportImage, SeSReportText, SeSReportFile. Optional. |
tags | object | Hash of attributes to set for this particular log entry. Optional. |
SoftAssertEqual¶
Checks if obj1 equals to obj2 and saves corresponding Report entry. Assertion is an atomic piece of verification. Assertion may contain some additional data (links, images, comments) set via 'data' parameter.
Tester.SoftAssertEqual(message, obj1, obj2, data, tags)
Parameters:
Name | Type | Description |
---|---|---|
message | string | Message to put in the report. |
obj1 | object | First object to compare. |
obj2 | object | Second object to compare. |
data | SeSReportLink | SeSReportText | SeSReportImage | Object[] | Additional information to put in the report. If 'string' is passed, then data is considered as additional comment attribute. Or 'array' may be passed. Each entry in the array should be one of: SeSReportLink, SeSReportImage, SeSReportText, SeSReportFile. Optional. |
tags | object | Hash of attributes to set for this particular log entry. Optional. |
SoftAssertFalse¶
Checks if val
is false
and saves corresponding Report entry.
Assertion is an atomic piece of verification. Assertion may contain some
additional data (links, images, comments) set via 'data' parameter.
Tester.SoftAssertFalse(message, val, data, tags)
Parameters:
Name | Type | Description |
---|---|---|
message | string | Message to put in the report. |
val | object | Value to check. |
data | SeSReportLink | SeSReportText | SeSReportImage | Object[] | Additional information to put in the report. If 'string' is passed, then data is considered as additional comment attribute. Or 'array' may be passed. Each entry in the array should be one of: SeSReportLink, SeSReportImage, SeSReportText, SeSReportFile. Optional. |
tags | object | Hash of attributes to set for this particular log entry. Optional. |
SoftAssertGreater¶
Checks if n1 greater than n2 and saves corresponding Report entry. Assertion is an atomic piece of verification. Assertion may contain some additional data (links, images, comments) set via 'data' parameter.
Tester.SoftAssertGreater(message, n1, n2, data, tags)
Parameters:
Name | Type | Description |
---|---|---|
message | string | Message to put in the report. |
n1 | number | First value to compare. |
n2 | number | Second value to compare. |
data | SeSReportLink | SeSReportText | SeSReportImage | Object[] | Additional information to put in the report. If 'string' is passed, then data is considered as additional comment attribute. Or 'array' may be passed. Each entry in the array should be one of: SeSReportLink, SeSReportImage, SeSReportText, SeSReportFile. Optional. |
tags | object | Hash of attributes to set for this particular log entry. Optional. |
SoftAssertGreaterOrEqual¶
Checks if n1 greater or equal than n2 and saves corresponding Report entry. Assertion is an atomic piece of verification. Assertion may contain some additional data (links, images, comments) set via 'data' parameter.
Tester.SoftAssertGreaterOrEqual(message, n1, n2, data, tags)
Parameters:
Name | Type | Description |
---|---|---|
message | string | Message to put in the report. |
n1 | number | First value to compare. |
n2 | number | Second value to compare. |
data | SeSReportLink | SeSReportText | SeSReportImage | Object[] | Additional information to put in the report. If 'string' is passed, then data is considered as additional comment attribute. Or 'array' may be passed. Each entry in the array should be one of: SeSReportLink, SeSReportImage, SeSReportText, SeSReportFile. Optional. |
tags | object | Hash of attributes to set for this particular log entry. Optional. |
SoftAssertImage¶
Checks if 'img1' equals to image stored at 'path' and saves corresponding Report entry. Assertion is an atomic piece of verification. Assertion may contain some additional data (links, images, comments) set via 'data' parameter.
Tester.SoftAssertImage(message, img1, path, data, tags)
Parameters:
Name | Type | Description |
---|---|---|
message | string | Message to put in the report. |
img1 | object | ImageWrapper object (1st image to compare). |
path | string | Path to the second image to compare. |
data | SeSReportLink | SeSReportText | SeSReportImage | Object[] | Additional information to put in the report. If 'string' is passed, then data is considered as additional comment attribute. Or 'array' may be passed. Each entry in the array should be one of: SeSReportLink, SeSReportImage, SeSReportText, SeSReportFile. Optional. |
tags | object | Hash of attributes to set for this particular log entry. Optional. |
SoftAssertLess¶
Checks if n1 is less than n2 and saves corresponding Report entry. Assertion is an atomic piece of verification. Assertion may contain some additional data (links, images, comments) set via 'data' parameter.
Tester.SoftAssertLess(message, n1, n2, data, tags)
Parameters:
Name | Type | Description |
---|---|---|
message | string | Message to put in the report. |
n1 | number | First value to compare. |
n2 | number | Second value to compare. |
data | SeSReportLink | SeSReportText | SeSReportImage | Object[] | Additional information to put in the report. If 'string' is passed, then data is considered as additional comment attribute. Or 'array' may be passed. Each entry in the array should be one of: SeSReportLink, SeSReportImage, SeSReportText, SeSReportFile. Optional. |
tags | object | Hash of attributes to set for this particular log entry. Optional. |
SoftAssertLessOrEqual¶
Checks if n1 differs from n2 and saves corresponding Report entry. Assertion is an atomic piece of verification. Assertion may contain some additional data (links, images, comments) set via 'data' parameter.
Tester.SoftAssertLessOrEqual(message, n1, n2, data, tags)
Parameters:
Name | Type | Description |
---|---|---|
message | string | Message to put in the report. |
n1 | object | First value to compare. |
n2 | object | Second value to compare. |
data | SeSReportLink | SeSReportText | SeSReportImage | Object[] | Additional information to put in the report. If 'string' is passed, then data is considered as additional comment attribute. Or 'array' may be passed. Each entry in the array should be one of: SeSReportLink, SeSReportImage, SeSReportText, SeSReportFile. Optional. |
tags | object | Hash of attributes to set for this particular log entry. Optional. |
SoftAssertNotContains¶
Checks that str
does not contain substr
anywhere and saves corresponding Report entry.
Assertion is an atomic piece of verification. Assertion may contain some
additional data (links, images, comments) set via 'data' parameter.
Tester.SoftAssertNotContains(message, str, substr, data, tags)
Parameters:
Name | Type | Description |
---|---|---|
message | string | Message to put in the report. |
str | string | String to search in. |
substr | string | Substring to find. |
data | SeSReportLink | SeSReportText | SeSReportImage | Object[] | Additional information to put in the report. If 'string' is passed, then data is considered as additional comment attribute. Or 'array' may be passed. Each entry in the array should be one of: SeSReportLink, SeSReportImage, SeSReportText, SeSReportFile. Optional. |
tags | object | Hash of attributes to set for this particular log entry. Optional. |
SoftAssertNotEqual¶
Checks if obj1 differs from obj2 and saves corresponding Report entry. Assertion is an atomic piece of verification. Assertion may contain some additional data (links, images, comments) set via 'data' parameter.
Tester.SoftAssertNotEqual(message, obj1, obj2, data, tags)
Parameters:
Name | Type | Description |
---|---|---|
message | string | Message to put in the report. |
obj1 | object | First object to compare. |
obj2 | object | Second object to compare. |
data | SeSReportLink | SeSReportText | SeSReportImage | Object[] | Additional information to put in the report. If 'string' is passed, then data is considered as additional comment attribute. Or 'array' may be passed. Each entry in the array should be one of: SeSReportLink, SeSReportImage, SeSReportText, SeSReportFile. Optional. |
tags | object | Hash of attributes to set for this particular log entry. Optional. |
SoftAssertNotNull¶
Checks if val
is NotNull
and saves corresponding Report entry.
Assertion is an atomic piece of verification. Assertion may contain some
additional data (links, images, comments) set via 'data' parameter.
Tester.SoftAssertNotNull(message, val, data, tags)
Parameters:
Name | Type | Description |
---|---|---|
message | string | Message to put in the report. |
val | object | Value to check. |
data | SeSReportLink | SeSReportText | SeSReportImage | Object[] | Additional information to put in the report. If 'string' is passed, then data is considered as additional comment attribute. Or 'array' may be passed. Each entry in the array should be one of: SeSReportLink, SeSReportImage, SeSReportText, SeSReportFile. Optional. |
tags | object | Hash of attributes to set for this particular log entry. Optional. |
SoftAssertNotSet¶
Checks if val
is not set (i.e. it is null, 0, false or "") and saves corresponding Report entry.
Assertion is an atomic piece of verification. Assertion may contain some
additional data (links, images, comments) set via 'data' parameter.
Tester.SoftAssertNotSet(message, val, data, tags)
Parameters:
Name | Type | Description |
---|---|---|
message | string | Message to put in the report. |
val | object | Value to check. |
data | SeSReportLink | SeSReportText | SeSReportImage | Object[] | Additional information to put in the report. If 'string' is passed, then data is considered as additional comment attribute. Or 'array' may be passed. Each entry in the array should be one of: SeSReportLink, SeSReportImage, SeSReportText, SeSReportFile. Optional. |
tags | object | Hash of attributes to set for this particular log entry. Optional. |
SoftAssertNull¶
Checks if val
is null
and saves corresponding Report entry.
Assertion is an atomic piece of verification. Assertion may contain some
additional data (links, images, comments) set via 'data' parameter.
Tester.SoftAssertNull(message, val, data, tags)
Parameters:
Name | Type | Description |
---|---|---|
message | string | Message to put in the report. |
val | object | Value to check. |
data | SeSReportLink | SeSReportText | SeSReportImage | Object[] | Additional information to put in the report. If 'string' is passed, then data is considered as additional comment attribute. Or 'array' may be passed. Each entry in the array should be one of: SeSReportLink, SeSReportImage, SeSReportText, SeSReportFile. Optional. |
tags | object | Hash of attributes to set for this particular log entry. Optional. |
SoftAssertSet¶
Checks if val
is set (i.e. not false, not 0, not null, not "") and saves corresponding Report entry.
Assertion is an atomic piece of verification. Assertion may contain some
additional data (links, images, comments) set via 'data' parameter.
Tester.SoftAssertSet(message, val, data, tags)
Parameters:
Name | Type | Description |
---|---|---|
message | string | Message to put in the report. |
val | object | Value to check. |
data | SeSReportLink | SeSReportText | SeSReportImage | Object[] | Additional information to put in the report. If 'string' is passed, then data is considered as additional comment attribute. Or 'array' may be passed. Each entry in the array should be one of: SeSReportLink, SeSReportImage, SeSReportText, SeSReportFile. Optional. |
tags | object | Hash of attributes to set for this particular log entry. Optional. |
SoftAssertStartsWith¶
Checks if str
begins with substr
and saves corresponding Report entry.
Assertion is an atomic piece of verification. Assertion may contain some
additional data (links, images, comments) set via 'data' parameter.
Tester.SoftAssertStartsWith(message, str, substr, data, tags)
Parameters:
Name | Type | Description |
---|---|---|
message | string | Message to put in the report. |
str | string | String to search in. |
substr | string | Substring to find. |
data | SeSReportLink | SeSReportText | SeSReportImage | Object[] | Additional information to put in the report. If 'string' is passed, then data is considered as additional comment attribute. Or 'array' may be passed. Each entry in the array should be one of: SeSReportLink, SeSReportImage, SeSReportText, SeSReportFile. Optional. |
tags | object | Hash of attributes to set for this particular log entry. Optional. |
SuppressReport¶
In SuppressReport mode all assertions are ignored. That means no lines are added to report and all statuses are treated as "Info". This mode is like IgnoreStatus mode but no status messages are added to report.
Tester.SuppressReport(true);
Tester.Assert("No assertion", false); // Status of this assertion will be ignored and no record will be added to report
SeS('Obj1').DoClick(); // No line will be added to report and operation status will be ignored
Tester.SuppressReport(false);
Tester.SuppressReport(suppress)
Parameters:
Name | Type | Description |
---|---|---|
suppress | boolean | Set to 'True' to suppress adding anything into the report. |