I'm writing the tests of a component which looks something more or less like this:
FocusScope {
property ...
id: root
width: parent.width
Component {
id: focusMarker
Item {
z: 100
Rectangle {
objectName: "focusMarker"
visible: root.focus
//...
}
}
}
ListView {
id: sliderView
objectName: "sliderView"
highlight: focusMarker
highlightRangeMode: ListView.ApplyRange
//...
}
}
While doing the tests of the Focus Marker part, I don't seem to get to the focusMarker
. When I do
function test_focusMarker() {
var obj = createTemporaryObject(slider, testCase, {visible: true});
var focusMarker = findChild(obj, "focusMarker");
verify(focusMarker)
}
It returns FAIL! : qmltestrunner::<Slider />::test_focusMarker() 'verify()' returned FALSE. ()
. I'm definitely missing something but I don't get to know what. Maybe it is something related to the fact that I need to go to a focused item for it to appear and so to be tested. However I don't really know how to do that. Your help is much appreciated :) Hope my question is clear.