Test framework interface
[Desktop Automation]
The Lua test framework provides functionality for uniform test suites and convenient result file formats.
Properties
Property | Read/write | Type | Description |
---|---|---|---|
childcount | read-only | Number | Number of direct sub test suites |
errormessage | read/write | String | Error message of this test on failure |
Duration | read/write | Number | Duration of this test in seconds |
failurecount | read | Number | Number of failed sub tests |
Name | read/write | String | Name of the test suite |
success | read/write | Boolean | True for success, false for failure |
testcount | read | Number | Number of all sub tests |
Methods
Name | Syntax | Description |
---|---|---|
asserttrue | suite:asserttrue(emessage: string; value: Boolean) | Asserts for value = true. For false value, the test fails and sets the errormessage |
assertequalsmeshgeometry | suite:asserequalsmeshgeometry(emessage:string; mesh1, mesh2:MeshObject; accuracy:Number) | Asserts for equal geometry of the two meshes with meshcompare considering to the optional accuracy. For not equal meshes, the test fails and sets the errormessage. |
assertequalsmeshproperties | suite:assertequalsmeshproperties(emessage:string; mesh1, mesh2:MeshObject) | Asserts for equal properties of the two meshes: NodeCount, EdgeCont and FaceCount. For not equal meshes, the test fails and sets the errormessage. |
assertequalsnumber | suite:assertequalsnumber(emessage:string; n1, n2, accuracy:Number) | Asserts for n1 = n2 with optional accuracy. For not equal numbers, the test fails and sets the errormessage. |
createtestsuite | subsuite = suite:createtestsuite(name:string) | Creates a new sub test suite for the current suite. |
fails | suite:fails(emessage:string) | The test fails. The parameter specifies the error message of the failed test. |
finishtest | suite:finishtest() | Finishes the current test. This call calculates the duration of the test. |
savetocsv | suite:savetocsv(file:string) | Saves the test result into specified file. The format is a comma-separated format. |
savetojunitxml | suite:savetojunitxml(file:string) | Saves the test result into specified file. The format is a junit convenient XML format. |