aboutsummaryrefslogtreecommitdiffstats
path: root/src/qmltest/doc/snippets/testApp/tests/tst_testqml.qml
diff options
context:
space:
mode:
Diffstat (limited to 'src/qmltest/doc/snippets/testApp/tests/tst_testqml.qml')
-rw-r--r--src/qmltest/doc/snippets/testApp/tests/tst_testqml.qml31
1 files changed, 31 insertions, 0 deletions
diff --git a/src/qmltest/doc/snippets/testApp/tests/tst_testqml.qml b/src/qmltest/doc/snippets/testApp/tests/tst_testqml.qml
new file mode 100644
index 0000000000..5973a31ebb
--- /dev/null
+++ b/src/qmltest/doc/snippets/testApp/tests/tst_testqml.qml
@@ -0,0 +1,31 @@
+// Copyright (C) 2023 The Qt Company Ltd.
+// SPDX-License-Identifier: LicenseRef-Qt-Commercial OR BSD-3-Clause
+//! [import]
+import QtQuick
+import QtQuick.Controls
+
+import QtTest
+import MyModule
+
+Item {
+ width: 800
+ height: 600
+
+ MyButton {
+ id: myButton
+ anchors.centerIn: parent
+ }
+
+ TestCase {
+ name: "MyButton"
+ when: windowShown
+
+ function test_clickToExpand() {
+ const widthBeforeClick = myButton.width;
+ mouseClick(myButton);
+ const widthAfterClick = myButton.width;
+ verify(widthBeforeClick < widthAfterClick);
+ }
+ }
+}
+//! [import]