Exports Item¶
-
class
Exports
¶ Forwards data to dependent
Testcase
items.
Locations: | Testcase |
---|
Detailed Description¶
The Exports item helps the surrounding test case to forward results and additional data to dependent test cases. It requires a Depends item on the other side to access the forwarded results. Together, the Exports and the Depends item form a dataflow graph. The Exports item does not have any built-in properties. Here is an example:
import qst 1.0
Project {
Testcase {
name: "A"
Exports {
id: exports
property string result
}
function run() {
exports.result = "excellent"
}
}
Testcase {
name: "B"
Depends {
name: "A"
}
function run() {
Qst.info("A was " + dependencies.A[0].result)
}
}
}
After completion of A, Qst copies the properties of the Exports
item over to B. Test case B can access them through the
dependencies
property. Only
basic QML types are considered for exporting
which avoids side effects.