Add test methods with input checking

This commit is contained in:
B.Melnik 2021-10-21 18:51:31 +03:00
parent f701240610
commit e9ae3b59d7
No known key found for this signature in database
GPG Key ID: 4A9B2E42E3BD4727
1 changed files with 21 additions and 0 deletions

View File

@ -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()
} }