- Locations
document root
- Nested items
:qml
Matrix
, :qmlTestcase
- Properties
:cpp
name
, :cppreferences
, :cppworkingDirectory
A Project
item represents a collection of of test cases. Test cases can be defined in two ways:
in-line
Usually used for a bunch of trivial test cases with only few lines or if complex test cases are instantiated multiple times with slightly different configuration.
The test cases are executed in undefined order.
Example in-line project:
Project { name: "inline-project" Testcase { name: "trivial-1" function run() { // Qst.verify(...) } } // Assuming that ComplexTestcase.qml exists in the current // directory ComplexTestcase { name: "complex-1"; config: "something" } ComplexTestcase { name: "complex-2"; config: "something-else" } }
as references
Usually used in non-trivial projects. Test cases are defined in their own files and then referenced by the main project file. Any property
prop
attached to the project item is available in sub-items asproject.prop
.The execution order is defined by their occurrence order in the :cpp
references
item.Example references project:
Project { name: "referencing-project" property string someProperty: "sometext" // someProperty is available in all test cases as // project.someProperty references: [ "testcase1.qml", "testcase2.qml" ] }