import QtQuick 2.13 import QtQuick.Controls 2.13 import QtQuick.Templates 2.13 as T import QtTest 1.13 import QtQuick.Window 2.13 Item { id: root Rectangle { id: rectangle x: 0 y: 0 width: 200 height: 200 color: dragHandler.active ? "red" : "orange" opacity: 0.8 Rectangle { implicitWidth: 50 implicitHeight: 50 color: "blue" MouseArea { id: ma anchors.fill: parent preventStealing: true } } DragHandler { id: dragHandler } } TestCase { id: testcase when: windowShown function test_1() { //popup.open() waitForRendering(root) var sequence = touchEvent(ma); sequence.press(0); sequence.commit(); compare(ma.pressed, true) sequence.move(0, ma, 200, 200); sequence.commit(); waitForRendering(root) compare(Qt.point(rectangle.x, rectangle.y), Qt.point(0, 0), "Shouldn't have been moved") } } }