summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorDimitrios Apostolou <dimitrios.apostolou@qt.io>2019-06-26 11:06:32 +0200
committerDimitrios Apostolou <dimitrios.apostolou@qt.io>2019-06-26 12:58:23 +0200
commit558eb844d59185d944c233348d2fef649e90b643 (patch)
tree865ac86a6bf1de39637206659ac6adb119eafae6
parentbc38b5338000ab85564272077b27c88bd472aa0c (diff)
downloadqtquickcontrols-558eb844d59185d944c233348d2fef649e90b643.tar.gz
Stabilise flaky test
Spread small delays in the test to mitigate severe flakiness on MacOS_10_12 platform in our CI. This is not a proper fix. It is acceptable because the module is deprecated and because it should greatly improve the instability of our CI. Fixes: QTBUG-76570 Change-Id: If2d7d15dffe23c7e0644b233e7757c04574c89d4 Reviewed-by: Frederik Gladhorn <frederik.gladhorn@qt.io>
-rw-r--r--tests/auto/controls/data/tst_treeview.qml57
1 files changed, 32 insertions, 25 deletions
diff --git a/tests/auto/controls/data/tst_treeview.qml b/tests/auto/controls/data/tst_treeview.qml
index 139be338..902d2178 100644
--- a/tests/auto/controls/data/tst_treeview.qml
+++ b/tests/auto/controls/data/tst_treeview.qml
@@ -127,7 +127,7 @@ Item {
spy.target = tree
spy.signalName = "clicked"
compare(spy.count, 0)
- mouseClick(tree, semiIndent + 50, 120, Qt.LeftButton)
+ mouseClick(tree, semiIndent + 50, 120, Qt.LeftButton, Qt.NoModifier, 10)
compare(spy.count, 1)
var clickedItem = spy.signalArguments[0][0]
verify(clickedItem.valid)
@@ -201,7 +201,7 @@ Item {
// expanded on click
compare(spy.count, 0)
- mouseClick(tree, semiIndent, 70, Qt.LeftButton)
+ mouseClick(tree, semiIndent, 70, Qt.LeftButton, Qt.NoModifier, 10)
compare(spy.count, 1)
var expandedIndex = spy.signalArguments[0][0]
verify(expandedIndex.valid)
@@ -268,8 +268,9 @@ Item {
spy.target = tree
spy.signalName = "pressAndHold"
compare(spy.count, 0)
- mousePress(tree, styleIndent + 50, 70, Qt.LeftButton)
+ mousePress(tree, styleIndent + 50, 70, Qt.LeftButton, Qt.NoModifier, 10)
mouseRelease(tree, styleIndent + 50, 70, Qt.LeftButton, Qt.NoModifier, 1000)
+ wait(20)
compare(spy.count, 1)
verify(spy.signalArguments[0][0].valid)
compare(spy.signalArguments[0][0].row, 0)
@@ -288,7 +289,7 @@ Item {
// select second item with no children
verify(!tree.currentIndex.valid)
- mouseClick(tree, semiIndent + 50, 120, Qt.LeftButton)
+ mouseClick(tree, semiIndent + 50, 120, Qt.LeftButton, Qt.NoModifier, 10)
var secondTopItem = tree.currentIndex
verify(secondTopItem.valid)
verify(!secondTopItem.parent.valid)
@@ -342,27 +343,27 @@ Item {
selectionModel.model = tree.model
// Collect some model index
- mouseClick(tree, semiIndent + 50, 20 + 50, Qt.LeftButton)
+ mouseClick(tree, semiIndent + 50, 20 + 50, Qt.LeftButton, Qt.NoModifier, 30)
var firstItem = tree.currentIndex
verify(firstItem.valid)
compare(firstItem.row, 0)
- mouseClick(tree, semiIndent + 50, 20 + 2*50, Qt.LeftButton)
+ mouseClick(tree, semiIndent + 50, 20 + 2*50, Qt.LeftButton, Qt.NoModifier, 10)
var secondItem = tree.currentIndex
verify(secondItem.valid)
compare(secondItem.row, 1)
- mouseClick(tree, semiIndent + 50, 20 + 3*50, Qt.LeftButton)
+ mouseClick(tree, semiIndent + 50, 20 + 3*50, Qt.LeftButton, Qt.NoModifier, 10)
var thirdItem = tree.currentIndex
verify(thirdItem.valid)
compare(thirdItem.row, 2)
- mouseClick(tree, semiIndent + 50, 20 + 4*50, Qt.LeftButton)
+ mouseClick(tree, semiIndent + 50, 20 + 4*50, Qt.LeftButton, Qt.NoModifier, 10)
var fourthItem = tree.currentIndex
verify(fourthItem.valid)
compare(fourthItem.row, 3)
- mouseClick(tree, semiIndent + 50, 20 + 5*50, Qt.LeftButton)
+ mouseClick(tree, semiIndent + 50, 20 + 5*50, Qt.LeftButton, Qt.NoModifier, 10)
var fifthItem = tree.currentIndex
verify(fifthItem.valid)
compare(fifthItem.row, 4)
- mouseClick(tree, semiIndent + 50, 20 + 6*50, Qt.LeftButton)
+ mouseClick(tree, semiIndent + 50, 20 + 6*50, Qt.LeftButton, Qt.NoModifier, 10)
var sixthItem = tree.currentIndex
verify(sixthItem.valid)
compare(sixthItem.row, 5)
@@ -377,7 +378,7 @@ Item {
compare(tree.selectionMode, SelectionMode.SingleSelection)
verify(!tree.selection.currentIndex.valid)
- mouseClick(tree, semiIndent + 50, 20 + 2*50, Qt.LeftButton)
+ mouseClick(tree, semiIndent + 50, 20 + 2*50, Qt.LeftButton, Qt.NoModifier, 10)
verify(tree.selection.currentIndex.valid)
compare(secondItem.internalId, tree.currentIndex.internalId)
@@ -467,17 +468,17 @@ Item {
selectionModel.model = tree.model
// Collect some model index
- mouseClick(tree, semiIndent + 50, 20 + 50, Qt.LeftButton)
+ mouseClick(tree, semiIndent + 50, 20 + 50, Qt.LeftButton, Qt.NoModifier0, 10)
var firstItem = tree.currentIndex
- mouseClick(tree, semiIndent + 50, 20 + 2*50, Qt.LeftButton)
+ mouseClick(tree, semiIndent + 50, 20 + 2*50, Qt.LeftButton, Qt.NoModifier, 10)
var secondItem = tree.currentIndex
- mouseClick(tree, semiIndent + 50, 20 + 3*50, Qt.LeftButton)
+ mouseClick(tree, semiIndent + 50, 20 + 3*50, Qt.LeftButton, Qt.NoModifier, 10)
var thirdItem = tree.currentIndex
- mouseClick(tree, semiIndent + 50, 20 + 4*50, Qt.LeftButton)
+ mouseClick(tree, semiIndent + 50, 20 + 4*50, Qt.LeftButton, Qt.NoModifier, 10)
var fourthItem = tree.currentIndex
- mouseClick(tree, semiIndent + 50, 20 + 5*50, Qt.LeftButton)
+ mouseClick(tree, semiIndent + 50, 20 + 5*50, Qt.LeftButton, Qt.NoModifier, 10)
var fifthItem = tree.currentIndex
- mouseClick(tree, semiIndent + 50, 20 + 6*50, Qt.LeftButton)
+ mouseClick(tree, semiIndent + 50, 20 + 6*50, Qt.LeftButton, Qt.NoModifier, 10)
var sixthItem = tree.currentIndex
compare(tree.selection, null)
@@ -490,7 +491,7 @@ Item {
tree.selectionMode = SelectionMode.MultiSelection
compare(tree.selectionMode, SelectionMode.MultiSelection)
- mouseClick(tree, semiIndent + 50, 70+50, Qt.LeftButton)
+ mouseClick(tree, semiIndent + 50, 70+50, Qt.LeftButton, Qt.NoModifier, 10)
compare(secondItem.internalId, tree.currentIndex.internalId)
compare(tree.selection.hasSelection, true)
@@ -576,17 +577,17 @@ Item {
selectionModel.model = tree.model
// Collect some model index
- mouseClick(tree, semiIndent + 50, 20 + 50, Qt.LeftButton)
+ mouseClick(tree, semiIndent + 50, 20 + 50, Qt.LeftButton, Qt.NoModifier, 10)
var firstItem = tree.currentIndex
- mouseClick(tree, semiIndent + 50, 20 + 2*50, Qt.LeftButton)
+ mouseClick(tree, semiIndent + 50, 20 + 2*50, Qt.LeftButton, Qt.NoModifier, 10)
var secondItem = tree.currentIndex
- mouseClick(tree, semiIndent + 50, 20 + 3*50, Qt.LeftButton)
+ mouseClick(tree, semiIndent + 50, 20 + 3*50, Qt.LeftButton, Qt.NoModifier, 10)
var thirdItem = tree.currentIndex
- mouseClick(tree, semiIndent + 50, 20 + 4*50, Qt.LeftButton)
+ mouseClick(tree, semiIndent + 50, 20 + 4*50, Qt.LeftButton, Qt.NoModifier, 10)
var fourthItem = tree.currentIndex
- mouseClick(tree, semiIndent + 50, 20 + 5*50, Qt.LeftButton)
+ mouseClick(tree, semiIndent + 50, 20 + 5*50, Qt.LeftButton, Qt.NoModifier, 10)
var fifthItem = tree.currentIndex
- mouseClick(tree, semiIndent + 50, 20 + 6*50, Qt.LeftButton)
+ mouseClick(tree, semiIndent + 50, 20 + 6*50, Qt.LeftButton, Qt.NoModifier, 10)
var sixthItem = tree.currentIndex
compare(tree.selection, null)
@@ -599,7 +600,7 @@ Item {
tree.selectionMode = SelectionMode.ExtendedSelection
compare(tree.selectionMode, SelectionMode.ExtendedSelection)
- mouseClick(tree, semiIndent + 50, 70+50, Qt.LeftButton)
+ mouseClick(tree, semiIndent + 50, 70+50, Qt.LeftButton, Qt.NoModifier, 10)
compare(secondItem.internalId, tree.currentIndex.internalId)
compare(tree.selection.hasSelection, true)
@@ -753,6 +754,7 @@ Item {
verify(tree !== null, "tree created is null")
verify(waitForRendering(tree), "TreeView did not render on time")
var model = tree.model
+ wait(50)
// Sample each row and test
for (var row = 0; row < tree.__listView.count; row++) {
@@ -764,7 +766,12 @@ Item {
|| treeIndex.internalId !== modelIndex.internalId) {
console.log("Test about to fail: row = " + row + ", __listView.count =" + tree.__listView.count)
console.log(" . . . . . . . . . x =" + x + ", getColumn(0).width =" + tree.getColumn(0).width)
+ console.log("pairs of should-be-equal values: ",
+ treeIndex.row, modelIndex.row,
+ treeIndex.column, modelIndex.column,
+ treeIndex.internalId, modelIndex.internalId)
}
+
compare(treeIndex.row, modelIndex.row)
compare(treeIndex.column, modelIndex.column)
compare(treeIndex.internalId, modelIndex.internalId)