Add test methods with input checking
This commit is contained in:
parent
f701240610
commit
e9ae3b59d7
|
@ -22,6 +22,27 @@ TestCase {
|
||||||
visible: true
|
visible: true
|
||||||
}
|
}
|
||||||
|
|
||||||
|
property Helpers __helpers: Helpers {}
|
||||||
|
|
||||||
|
function getObjectByObjectName(parent, objectName) {
|
||||||
|
var result = __helpers.getObjectByObjectName(parent, objectName)
|
||||||
|
verify(result, "Method getObjectByObjectName can't find object with name:" + objectName + " in parent:" + parent.toString())
|
||||||
|
return result
|
||||||
|
}
|
||||||
|
|
||||||
|
function clickOnButton(item) {
|
||||||
|
verify(item, "item is null")
|
||||||
|
verify((item.width !== 0 && item.height !== 0) ||
|
||||||
|
(item.implicitWidth !== 0 && item.implicitHeight !== 0) , "item has zero sizes")
|
||||||
|
verify(item.visible, "item is invisibble")
|
||||||
|
|
||||||
|
if (item.width !== 0 && item.height !== 0) {
|
||||||
|
mouseClick(item, item.width / 2, item.height / 2, Qt.LeftButton)
|
||||||
|
} else {
|
||||||
|
mouseClick(item, item.implicitWidth / 2, item.implicitHeight / 2, Qt.LeftButton)
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
function initTestCase() {
|
function initTestCase() {
|
||||||
window.show()
|
window.show()
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in New Issue