import QtQuick 2.15 import QtTest 1.15 Item { id: root width: 400 height: 200 Component { id: customItem Rectangle { width: parent.width height: 50 color: "red" } } TestCase { when: windowShown function test_set_properties() { const properties = { width: 42, height: 33 } const item = customItem.createObject(root, properties) print("width", item.width) print("height", item.height) compare(item.height, 33) compare(item.width, 42) } } }